Package 'Microsoft.CodeDom.Providers.DotNetCompilerPlatform 2.0.1' is not found in the following primary source(s)
I have an old project built on the .Net Framework v4.5.2 that references Microsoft.CodeDom.Providers.DotNetCompilerPlatform 2.0.1.
I can Browse to it in NuGet and attempt to install the version I need.
In the image above, you will notice that it says "Requires a package source mapping. Configure"
I have followed the Configure link, and it looks like everything is configured correctly. I don't understand what isn't working. I've followed the steps I could find online. Either I have done something incorrectly, or there is a Visual Studio caching issue that prevents it from seeing that my package source mapping is configured.
However, the error I get is:
Severity Code Description Project File Line Suppression State Error Package 'Microsoft.CodeDom.Providers.DotNetCompilerPlatform 2.0.1' is not found in the following primary source(s): 'https://api.nuget.org/v3/index.json,https://malibuboats.pkgs.visualstudio.com/_packaging/malibuboats/nuget/v3/index.json,C:\Program Files (x86)\Microsoft SDKs\NuGetPackages'. Please verify all your online package sources are available (OR) package id, version are specified correctly.
As you can see, there are 3 locations that Visual Studio attempts to download packages from:
- https://api.nuget.org/v3/index.json
- https://malibuboats.pkgs.visualstudio.com/_packaging/malibuboats/nuget/v3/index.json
- C:\Program Files (x86)\Microsoft SDKs\NuGetPackages\
The first one is nuget.org, which should work fine. The second one is my company's packages on visualstudio.com, and it seems to work fine (it returns json text), and the third one points to files on the C: drive.
I found the NuGet package that I needed online here:
I copied the text to install this version using Package Manager:
PM> NuGet\Install-Package Microsoft.CodeDom.Providers.DotNetCompilerPlatform -Version 2.0.1
Attempting to gather dependency information for package 'Microsoft.CodeDom.Providers.DotNetCompilerPlatform.2.0.1' with respect to project 'CCNRebuild', targeting '.NETFramework,Version=v4.5.2'
NuGet\Install-Package : Package 'Microsoft.CodeDom.Providers.DotNetCompilerPlatform 2.0.1' is not found in the following primary source(s):
'https://api.nuget.org/v3/index.json,https://malibuboats.pkgs.visualstudio.com/_packaging/malibuboats/nuget/v3/index.json,C:\Program Files (x86)\Microsoft
SDKs\NuGetPackages\'. Please verify all your online package sources are available (OR) package id, version are specified correctly.
At line:1 char:1
+ NuGet\Install-Package Microsoft.CodeDom.Providers.DotNetCompilerPlatf ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Install-Package], Exception
+ FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PackageManagement.PowerShellCmdlets.InstallPackageCommand
I do not understand that error that says "At line:1 char:1."
So back on the nuget.org link, I manually downloaded the package (13.07 MB) and followed the steps here to install the package on my C: drive:
The install path is C:\Program Files (x86)\Microsoft SDKs\NuGetPackages\
I created the folder structure "microsoft.codedom.providers.dotnetcompileplatform \ 2.0.1 \ lib \ net45" and moved the download to that location.
Again, I tried to install via the Package Manager console, but again I got the same error saying it could not find the package in any of the locations.
PM> NuGet\Install-Package Microsoft.CodeDom.Providers.DotNetCompilerPlatform -Version 2.0.1
Attempting to gather dependency information for package 'Microsoft.CodeDom.Providers.DotNetCompilerPlatform.2.0.1' with respect to project 'CCNRebuild', targeting '.NETFramework,Version=v4.5.2'
NuGet\Install-Package : Package 'Microsoft.CodeDom.Providers.DotNetCompilerPlatform 2.0.1' is not found in the following primary source(s):
'https://api.nuget.org/v3/index.json,https://malibuboats.pkgs.visualstudio.com/_packaging/malibuboats/nuget/v3/index.json,C:\Program Files (x86)\Microsoft
SDKs\NuGetPackages\'. Please verify all your online package sources are available (OR) package id, version are specified correctly.
At line:1 char:1
+ NuGet\Install-Package Microsoft.CodeDom.Providers.DotNetCompilerPlatf ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Install-Package], Exception
+ FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PackageManagement.PowerShellCmdlets.InstallPackageCommand
Time Elapsed: 00:00:05.7718461
Am I doing something wrong?
I used this same approach to install all of my other packages. This one is giving me problems, and I don't know enough about NuGet to understand what I am doing wrong.