Dockertools: dotnet restore on 2.1 preview 1 fails with MSB3202 using the generated Dockerfile

Created on 14 Mar 2018  路  5Comments  路  Source: microsoft/DockerTools

Just a heads up as I have not really been able to find anything mentioned about this. Just want to be sure it's on someone radar :)

When trying out ASP.NET Core 2.1 preview 1 with the current Docker tools for VS I'm running into the following. See the issue here for details: https://github.com/NuGet/Home/issues/6651

The error is:

/usr/share/dotnet/sdk/2.1.300-preview1-008174/NuGet.targets(239,5): error MSB3202: The project file "/src/SomeApp.SomeLib/SomeApp.SomeLib.csproj" was not found. [/src/SomeApp.sln] /usr/share/dotnet/sdk/2.1.300-preview1-008174/NuGet.targets(239,5): error MSB3202: The project file "/src/docker-compose.dcproj" was not found. [/src/SomeApp.sln] ERROR: Service 'someapp' failed to build: The command '/bin/sh -c dotnet restore -nowarn:msb3202,nu1503' returned a non-zero code: 1

It appears that MSB3202 is not a warning, but an error on 2.1 preview 1 and it affects the "Add docker support" tooling in VS.

I suspect that this: https://github.com/Microsoft/DockerTools/issues/84. might also be related?

After messing around with the Dockerfile to include all .csproj's to get around MSB3202. but excluding the .dcproj file (as the docker tools sdk is not included in the aspnetcore-build image). I'm of course still getting the MSB3202, because the .dcproj file is in the sln and thus missing.

I gave up on trying out 2.1 on docker :(

Most helpful comment

This has killed me even attempting to use 2.1 in docker and if it still exists on release, I won't be able to use it then either.

Even following the spaghetti issues that are linked was hard to understand.

I did finally find that if you add -p:RestoreUseSkipNonexistentTargets=false to the dotnet restore line, then it magically works again.

All 5 comments

It is probably worth noting that, in #84, I am not trying to use the 2.1 preview, but the 2.0 release; yet I am getting the same error.

The Dockerfile is running the build in microsoft/dotnet:2.0-sdk, but the Nuget.targets error is coming from /usr/share/dotnet/sdk/2.1.101/NuGet.targets. Does the 2.0-sdk image have the wrong sdk installed?

I don't think it has the wrong sdk installed, but they update the 2.0 versions with new minors of the runtime and sdk and sdk 2.1.101 seems to be breaking this. I just experienced this demoing the eShopOnContainers sample to a coworker. See https://github.com/dotnet-architecture/eShopOnContainers/issues/543

Using aspnetcore-build:2.0.5-2.1.4 in ASP.NET Core land works, what the equivalent dotnet sdk image is I'm unsure.

This has killed me even attempting to use 2.1 in docker and if it still exists on release, I won't be able to use it then either.

Even following the spaghetti issues that are linked was hard to understand.

I did finally find that if you add -p:RestoreUseSkipNonexistentTargets=false to the dotnet restore line, then it magically works again.

Root issue is fixed now. aspnet/aspnet-docker#388

Was this page helpful?
0 / 5 - 0 ratings

Related issues

belchevgb picture belchevgb  路  7Comments

hannesne picture hannesne  路  7Comments

kaicianflone picture kaicianflone  路  7Comments

SWarnberg picture SWarnberg  路  3Comments

tanaka-takayoshi picture tanaka-takayoshi  路  5Comments