Reputation: 2899
I have a .Net CORE (Framework) Project that I want to build and deploy using TFS. I do a Nuget Restore Task first on the solution and than run MSBuild Solution with the following argument
/p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=true /p:SkipInvalidConfigurations=true /p:PackageLocation="$(build.artifactstagingdirectory)\" (Visual Studio Version 2015)
I get the Please run "dotnet restore" to generate a new lock file. message but I cannot run that because there is a library that is referenced that is 4.5 and the dotnet cli errors on that project. Is there a workaround for this?
Upvotes: 1
Views: 1294
Reputation: 51073
No workaround for this situation, you have to run dotnet restore.
This behavior is by design. […] If you wish to restore all of the dependencies for all your projects in one go, so to speak, just run
dotnet restore
at the root of your solution (where you have theglobal.json
file).
As for your "mixed" solution with 4.5, it's not support by ASP.NET Core 1.0 with msbuild.
You could also take a look at this simialr issue in GITHub: dotnet restore unable to resolve .NET Framework libraries (4.5.2)
Upvotes: 1