The MusicStore sample app does not build
The docker-compose -f .\docker-compose.windows.yml build command fails. It happens for me on both Docker for Windows beta (1.13.0-rc4) and the standard 1.12.2 Docker on Windows Server 2016.
Step 10/13 : RUN dotnet build .\samples\MusicStore.Standalone
---> Running in 757c95651249
Project MusicStore.Standalone (.NETCoreApp,Version=v1.1) will be compiled because expected outputs are missing
Compiling MusicStore.Standalone for .NETCoreApp,Version=v1.1
C:\Program Files\dotnet\dotnet.exe compile-csc @C:\MusicStore\samples\MusicStore.Standalone\obj\Debug\netcoreapp1.1\dotn
et-compile.rsp returned Exit Code 1
C:\MusicStore\samples\MusicStore\MessageServices.cs(7,23): error CS0433: The type 'Task' exists in both 'System.Threadin
g.Tasks, Version=4.0.10.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' and 'System.Runtime, Version=4.2.0.0, Cultu
re=neutral, PublicKeyToken=b03f5f7f11d50a3a'
C:\MusicStore\samples\MusicStore\MessageServices.cs(13,23): error CS0433: The type 'Task' exists in both 'System.Threadi
ng.Tasks, Version=4.0.10.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' and 'System.Runtime, Version=4.2.0.0, Cult
ure=neutral, PublicKeyToken=b03f5f7f11d50a3a'
C:\MusicStore\samples\MusicStore\Controllers\AccountController.cs(49,42): error CS1983: The return type of an async meth
od must be void, Task or Task<T>
C:\MusicStore\samples\MusicStore\Controllers\AccountController.cs(49,22): error CS0433: The type 'Task<TResult>' exists
in both 'System.Threading.Tasks, Version=4.0.10.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' and 'System.Runtime
, Version=4.2.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
C:\MusicStore\samples\MusicStore\Controllers\AccountController.cs(83,41): error CS1983: The return type of an async meth
od must be void, Task or Task<T>
C:\MusicStore\samples\MusicStore\Controllers\AccountController.cs(83,22): error CS0433: The type 'Task<TResult>' exists
in both 'System.Threading.Tasks, Version=4.0.10.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' and 'System.Runtime
, Version=4.2.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
C:\MusicStore\samples\MusicStore\Controllers\AccountController.cs(106,41): error CS1983: The return type of an async met
hod must be void, Task or Task<T>
Same here :|
Getting the same annoying error
Severity Code Description Project File Line Suppression State
Error CS0433 The type 'Task' exists in both 'System.Threading.Tasks, Version=4.0.10.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' and 'System.Runtime, Version=4.2.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' Fairies.Web..NETCoreApp,Version=v1.1
Seems that is issue has been going on for a while and the netcore to NETStandard mappings are messed up -
Discussion about this here https://github.com/dotnet/corefx/issues/14203
PS C:\Users\Administrator\Downloads\MusicStore> docker build -t web -f .\Dockerfile.windows .
Sending build context to Docker daemon 2.558 MB
Step 1/13 : FROM microsoft/dotnet:nanoserver
---> e4d55b5b2ddc
Step 2/13 : SHELL powershell -Command $ErrorActionPreference = 'Stop';
---> Using cache
---> 093e75409771
Step 3/13 : RUN set-itemproperty -path 'HKLM:\SYSTEM\CurrentControlSet\Services\Dnscache\Parameters' -Name ServerPriorityTimeLimit -Value 0 -Type DWord
---> Using cache
---> 0d430c7670b7
Step 4/13 : RUN New-Item -Path \MusicStore\samples\MusicStore.Standalone -Type Directory
---> Using cache
---> 81fd4d80bd2c
Step 5/13 : WORKDIR MusicStore
---> Using cache
---> 9e0774ff4c51
Step 6/13 : ADD samples/MusicStore.Standalone/project.json samples/MusicStore.Standalone/project.json
---> Using cache
---> 2f42d1df9e07
Step 7/13 : ADD NuGet.config .
---> Using cache
---> 57c83bf9b191
Step 8/13 : RUN dotnet restore .\samples\MusicStore.Standalone
---> Using cache
---> 2e584c1d9811
Step 9/13 : ADD samples samples
---> Using cache
---> 60b9e9b2c71c
Step 10/13 : RUN dotnet build .\samples\MusicStore.Standalone
---> Running in 7d403cc141e1
Project MusicStore.Standalone (.NETCoreApp,Version=v1.1) will be compiled because expected outputs are missing
Compiling MusicStore.Standalone for .NETCoreApp,Version=v1.1
C:\Program Files\dotnet\dotnet.exe compile-csc @C:\MusicStore\samples\MusicStore.Standalone\obj\Debug\netcoreapp1.1\dotnet-compile.rsp returned Exit Code 1
C:\MusicStore\samples\MusicStore\Controllers\AccountController.cs(49,42): error CS1983: The return type of an async method must be void, Task or Task
........... ........... ........... ........... ........... ...........
Compilation failed. 0 Warning(s) 159 Error(s)
Time elapsed 00:00:04.8859879
The command 'powershell -Command $ErrorActionPreference = 'Stop'; dotnet build .\samples\MusicStore.Standalone' returned a non-zero code: 1
The work around that I found is to revert the version of the NETCoreApp:
"dependencies": { "Microsoft.NETCore.App": { "version": "1.0.3", "type": "platform" } }
1.0.3 works for me
Thanks jsoveral. Where do I have to change that version info?
I see near-matches in the project.json files under /samples, but changing the values to 1.0.3 didn't get me there...
I found 4 project.json files in the solution:
\Musicstore\samples\MusicStore.Standalone\project.json
\Musicstore\samples\MusicStore\project.json
\Musicstore\test\E2ETests\project.json
\Musicstore\test\MusicStore.Test\project.json
I changed version to 1.0.3 in all of them, as suggested by @jsoveral:
"Microsoft.NETCore.App": {
"version": "1.0.3"
}
Even so, when trying to rebuild the error message is the same. Any ideas on how to workaround this error?
Sorry guys, I updated my code now: https://github.com/friism/MusicStore
Also updated the PR to Microsoft: https://github.com/aspnet/MusicStore/pull/736
@sixeyed @ManoMarks can you check if this works on your machines? If yes, pls. close

I got some new errors! /Mats
I had the same error, @easec. Updating docker-compose to 1.10.0 fixed it.
Ok! I was checking for that! Thanks! /Mats
However now when I'm running app it complains that Login failed for user 'sa'. Are you getting the same?
I´m stuck with upgading docker-compose, how did you do that? /Mats
I'm using Chocolatey, choco install docker-compose.
Ok, I did not! /Mats
@friism Tried your repo and it worked out of the box with docker-compose 1.10, docker 1.13.0 on a Win2016 machine.

I got a lot of errors! /Mats
I have to stop and restart couple of times, now it´s working!

Strange, I also had to restart several times and finally got rid of that login failed for user sa -error. And I thought Docker was supposed to help us get rid of "works on my machine" :)