I am currently trying to get an ASP.NET Core 1.1 testproject to build within the microsoft/aspnetcore-build:1.1.0-msbuild docker image.
I am running Docker on Windows 10 Pro 64 and have the newest CLI/SDK (1.0.0-preview4-004233) installed. And I think there lies the problem. The current image uses (1.0.0-preview3-004056) and throws an error "error MSB4057: The target Restore does not exist in the project." when I execute "dotnet restore" within the running container in interactive mode.
My question is: Is it the version mismatch that creates the error or am I missing something? My guess is that it has to do with some msbuild specific changes between preview3 and preview4. Can I build my own docker image that uses the right SDK version? Links to good tutorials are very appreciated.
Steps to replicate:
- Install the newest 1.1 SDK
- Open Powershell and navigate in an new and empty project folder
- Validate that you have preview4 "dotnet --info"
- Create new project "dotnet new -t Web"
- Open the *.csproj file change netcoreapp1.0 to netcoreapp1.1 and Microsoft.NETCore.App Version to "1.1.0".
- Restore packages "dotnet restore"
- Test with "dotnet run"
- Start docker-container in interactive mode docker run -it --rm -v "$pwd:/sln" --workdir /sln microsoft/aspnetcore-build:1.1.0-msbuild
- Within the running container use "dotnet restore" to force the error
Cheers Martin