0
votes

I have just upgraded an old project to use .Net Framework 4.5.2 from 4.0.0.

I am getting a build error, that the log reports as follows:

Restoring NuGet packages... (TaskId:38)

To prevent NuGet from downloading packages during build, open the Visual Studio Options dialog, click on the Package Manager node and uncheck 'Allow NuGet to download missing packages'. (TaskId:38)

EXEC : warning : The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel. [C:\Builds\1\SCD4\SCD4 - Test\Sources\MVC4\SCD4\SCD4.Model\SCD4.Model.csproj]

C:\Builds\1\SCD4\XXX - Test\Sources\MVC4\XXX.nuget\NuGet.targets(100,9): error : Unable to find version '6.1.3' of package 'EntityFramework'. [C:\Builds\1\XXX\XXX - Test\Sources\MVC4\XXX\XXX.Model\XXX.Model.csproj]

C:\Builds\1\XXX\XXX - Test\Sources\MVC4\XXX.nuget\NuGet.targets(100,9): error MSB3073: The command ""C:\Builds\1\XXX\XXX - Test\Sources\MVC4\XXX.nuget\NuGet.exe" install "C:\Builds\1\XXX\XXX - Test\Sources\MVC4\XXX\XXX.Model\packages.config" -source "" -NonInteractive -RequireConsent -solutionDir "C:\Builds\1\XXX\XXX - Test\Sources\MVC4\XXX\ "" exited with code 1. [C:\Builds\1\XXX\XXX - Test\Sources\MVC4\XXX\XXX.Model\XXX.Model.csproj]

Done executing task "Exec" -- FAILED. (TaskId:38) Done building target "RestorePackages" in project "XXX.Model.csproj" -- FAILED.: (TargetId:63) Done Building Project "C:\Builds\1\XXX\XXX - Test\Sources\MVC4\XXX\XXX.Model\XXX.Model.csproj" (default targets) -- FAILED. Done executing task "MSBuild" -- FAILED. (TaskId:4) Done building target "Build" in project "XXX.csproj.metaproj" -- FAILED.: (TargetId:6) Done Building Project "C:\Builds\1\XXX\XXX - Test\Sources\MVC4\XXX\XXX\XXX.csproj.metaproj" (default targets) -- FAILED.

How do I fix this?

2
If you open the nuget package manager in this solution, can you see the packages? Is the connection ok? Can you find EntityFramework 6.1.3 manually?Jeremy

2 Answers

1
votes

It seems that you can't access NuGet source

Go to

Tools -> NuGet Package Manager -> Manage NuGet Packages for Solution and see if you are able to connect to nuget.org in Online section

If you can't:

Go to Tools -> NuGet Package Manager -> Package Manager Settings to see if you have the right nuget source.

If it still doesn't work, try clearing Package cache. Idk why but it helps somehow.

And if it still doesn't work, it may be related with your browser's (thus Visual Studio's) security settings. Try adding https://www.nuget.org/api/v2/ to your browser's Trusted Sites

0
votes

I had a similar problem(not the same one) and was stuck for 4 days with this. What i did in the end was that i update my visual studio from 2013 to 2015 and every thing worked like a charm. the message i was getting was getting was that the nuget package was unable to update itself when i tried to open my project with .net framework 4.5, I downloaded "Nuget client" from nuget manager but with no luck so i update my visual studio to 2015 and every thing was good I hope it helps you. or any one else with this problem.