I'm trying to install a package via the package manager console for PowerBI, and I keep getting this error:
Install-Package : An error occurred while applying transformation to 'Views\web.config' in project 'Application': No element in the source document matches
'/configuration/system.web/compilation/assemblies'
At line:1 char:1
+ Install-Package Microsoft.PowerBi.AspNet.Mvc
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Install-Package], InvalidDataException
+ FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PowerShell.Commands.InstallPackageCommand
The command I'm trying to run is:
Install-Package Microsoft.PowerBi.AspNet.Mvc
I've tried installing different versions, that hasn't worked either.
Not really sure why this is failing, I've never had issues with the package manager console before.
Okay so not five minutes after I posted this, I figured out the issue. In my web.config, this block of code was not present
<compilation>
<assemblies>
</assemblies>
<buildProviders>
</buildProviders>
</compilation>
Simply adding that between the <system.web> </system.web>
headers allowed the install to work, and now my web.config has the following code:
<compilation>
<assemblies>
<add assembly="Microsoft.PowerBI.AspNet.Mvc, Version=1.1.1.16190, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
</assemblies>
<buildProviders>
</buildProviders>
</compilation>
Not really sure why the package manager can't create its own elements.. but all is well now. I'll leave this up just in case someone else has the same issue.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With