I've encountered that problem when working with RC1 builds (but now confirmed with final RC1 installed via official package) and people are reporting this as well on generator-aspnet:
https://github.com/OmniSharp/generator-aspnet/issues/509
Steps to repeat:
1) clone this repo
2) make sure to using latest bits
3) switch to samples/1.0.0-rc1-final/HelloMvc
4) make sure your runtime is CoreCLR:
dnvm use -r coreclr 1.0.0-rc1-final
dnvm list
Active Version Runtime Architecture OperatingSystem Alias
------ ------- ------- ------------ --------------- -----
* 1.0.0-rc1-final coreclr x64 darwin default
1.0.0-rc1-final mono linux/osx
5) run dnu restore which ends fine:
Restore complete, 5073ms elapsed
NuGet Config files used:
/Users/piotrblazejewicz/.config/NuGet/nuget.config
/Users/piotrblazejewicz/git/Home/samples/1.0.0-rc1-final/nuget.config
/Users/piotrblazejewicz/git/Home/samples/1.0.0-rc1-final/HelloMvc/nuget.config
Feeds used:
https://nuget.org/api/v2/
https://www.myget.org/F/aspnetrc1/api/v2/
6) run dnu build, which fails:
Using Package dependency System.Threading 4.0.0
Source: /Users/piotrblazejewicz/.dnx/packages/System.Threading/4.0.0
Unable to resolve dependency fx/mscorlib
Unable to resolve dependency fx/System
Unable to resolve dependency fx/System.Core
Unable to resolve dependency fx/Microsoft.CSharp
....
Build failed.
1 Warning(s)
64 Error(s)
Time elapsed 00:00:05.7016511
Total build time elapsed: 00:00:05.8210009
Total projects built: 1
I'd be more then happy to move it to related project (coreclr or dnx?), if this one is not proper one.
Somehow related (at least could be found via Google/Bing):
https://github.com/aspnet/dnx/issues/2566
Thanks!
You can't build for dnx451 with coreclr on Unix systems
@BrennanConroy
Does it mean that some part of .NET Core are not yet available under CoreCLR and requires .NET or Mono?
And should I simply point people to check status on dotnet/coreclr project?
Thanks! (and sorry for questions)
For this particular case you need mono in order to build the 451 target
@BrennanConroy Thanks!
This is actually caused by a few factors:
When you call "dnu build" without specifying a target framework, it will attempt to build ALL targets specified in the project.json file.
For instance:
dnxcore50
dnx451
If you are currently using "dnu" from a CoreCLR version of the runtime, it will fail to build the dnx451 target framework as it is unable to resolve framework dependencies. The correct solution, for the time being is to do one of the following:
1) Build the dnxcore50 target (only) using the CoreCLR:
dnvm use default -r coreclr && dnu build --framework dnxcore50
2) Build both targets using the CLR (or Mono):
dnvm use default -r mono && dnu build
This problem also seems to happen if you target dnx46, even if it's the only target you have and if you're using mono. (I'm trying to build the app in Ubuntu using Mono 4.2.1.102 and runtime 1.0.0-rc1-final)
Any ideas why this happens? Or a workaround?
dnx46 isn't supported by mono, I don't believe... so you would have to stick with 4.5.1 for now for xplat.
That's definitely unfortunate, but I'll stick to 4.5.1 then.
Thank you for the answer
Most helpful comment
This is actually caused by a few factors:
When you call "dnu build" without specifying a target framework, it will attempt to build ALL targets specified in the project.json file.
For instance:
dnxcore50
dnx451
If you are currently using "dnu" from a CoreCLR version of the runtime, it will fail to build the dnx451 target framework as it is unable to resolve framework dependencies. The correct solution, for the time being is to do one of the following:
1) Build the dnxcore50 target (only) using the CoreCLR:
2) Build both targets using the CLR (or Mono):