I'm having some trouble trying to get my project to build. I started a game engine project in .Net a little while ago with the view to be able to compile for Linux and OS X when .Net 5 and the surrounding ecosystem had matured enough. I figured late beta versions were probably far enough along that I could start experimenting with transferring my projects and source files to the new runtimes and project format.
The first platform I'm supporting is Windows, using SharpDX, which has a 3.x version that supports coreclr. I've kept my Windows-specific stuff in a separate project/package and kept the core engine code completely platform independant. My first attempts at getting this new setup working are failing though.
My primary platform-independent project will not build at all, citing several errors like this:
(1,29): error CS0433: The type 'AssemblyFileVersionAttribute' exists in both 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' and 'System.Runtime, Version=4.0.20.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
and hundreds of errors like this:
(1,58): error CS0518: Predefined type 'System.String' is not defined or imported
(2,54): error CS0518: Predefined type 'System.String' is not defined or imported
(3,67): error CS0518: Predefined type 'System.String' is not defined or imported
error CS0518: Predefined type 'System.Void' is not defined or imported
error CS0518: Predefined type 'System.Void' is not defined or imported
error CS0518: Predefined type 'System.Boolean' is not defined or imported
The new project.json file looks like this:
{
"version": "1.0.0-alpha-1",
"description": "Core library for the Grasshopper game engine",
"authors": [ "Nathan Ridley" ],
"tags": [ "game engine" ],
"projectUrl": "https://github.com/GrasshopperEngine/Grasshopper",
"licenseUrl": "https://github.com/GrasshopperEngine/Grasshopper/LICENSE.txt",
"dependencies": {
"Serilog": "1.5.7",
"System.Numerics.Vectors": "4.1.0-beta-23019",
"Rx-Core": "2.3.0-beta2",
"Rx-Interfaces": "2.3.0-beta2",
"Rx-Main": "2.3.0-beta2",
"Rx-PlatformServices": "2.3.0-beta2",
"Microsoft.CSharp": "4.0.0-beta-23019"
},
"frameworks": {
"dnx451": {},
"dnxcore50": { }
}
}
Here are the runtimes I have installed:
Active Version Runtime Architecture Location Alias
------ ------- ------- ------------ -------- -----
1.0.0-beta4 clr x64 C:\Users\nathan\.dnx\runtimes
1.0.0-beta4 clr x86 C:\Users\nathan\.dnx\runtimes
1.0.0-beta4 coreclr x64 C:\Users\nathan\.dnx\runtimes
1.0.0-beta4 coreclr x86 C:\Users\nathan\.dnx\runtimes
1.0.0-beta5-12103 clr x86 C:\Users\nathan\.dnx\runtimes
* 1.0.0-beta6-12216 clr x86 C:\Users\nathan\.dnx\runtimes default
I have no idea how to resolve the errors I mentioned above. I don't even understand what relationship between mscorlib and System.Runtime is, or how or why a conflict is even occurring there. I can actually delete the dnx451 framework target from the project file and all of the errors disappear, but I can't do that because I need dnx451 as a platform target, otherwise I can't open a window in which to render graphics.
- How do I resolve the above errors, and what do I need to know to avoid them in future so that I can properly use the dnx451 platform target?
- What is the relationship between the dnx451 platform target and the old, monolothic, non-modular .Net 4.5.1, which predates dnx?
EDIT
I added the following line to my project's shared dependencies and the number of errors dropped to 5:
"System.Runtime": "4.0.20-beta-22816"
And I get these errors (cropped for brevity):
error CS0433: The type 'Stopwatch' exists in both 'System.Runtime.Extensions, Version=4.0.10.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' and 'System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'
error CS0433: The type 'Environment' exists in both 'System.Runtime.Extensions, Version=4.0.10.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' and 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'
error CS0433: The type 'Stopwatch' exists in both 'System.Runtime.Extensions, Version=4.0.10.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' and 'System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'
error CS0433: The type 'Stopwatch' exists in both 'System.Runtime.Extensions, Version=4.0.10.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' and 'System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'
error CS0433: The type 'Convert' exists in both 'System.Runtime.Extensions, Version=4.0.10.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' and 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'
Note that I am using VS2015 RC, coupled with some help from the command line, and ReSharper 9.1 just to add a bit of extra exploratory help, and none of them offer any suggestions regarding the correct way to resolve these sorts of issues. What's the new workflow supposed to look like with regards to figuring out what dependencies to specify for different scenarios?
My earlier questions still stand also, I guess.
I'm having some trouble trying to get my project to build. I started a game engine project in .Net a little while ago with the view to be able to compile for Linux and OS X when .Net 5 and the surrounding ecosystem had matured enough. I figured late beta versions were probably far enough along that I could start experimenting with transferring my projects and source files to the new runtimes and project format.
The first platform I'm supporting is Windows, using SharpDX, which has a 3.x version that supports coreclr. I've kept my Windows-specific stuff in a separate project/package and kept the core engine code completely platform independant. My first attempts at getting this new setup working are failing though.
My primary platform-independent project will not build at all, citing several errors like this:
and hundreds of errors like this:
The new project.json file looks like this:
Here are the runtimes I have installed:
I have no idea how to resolve the errors I mentioned above. I don't even understand what relationship between mscorlib and System.Runtime is, or how or why a conflict is even occurring there. I can actually delete the
dnx451framework target from the project file and all of the errors disappear, but I can't do that because I need dnx451 as a platform target, otherwise I can't open a window in which to render graphics.EDIT
I added the following line to my project's shared dependencies and the number of errors dropped to 5:
And I get these errors (cropped for brevity):
Note that I am using VS2015 RC, coupled with some help from the command line, and ReSharper 9.1 just to add a bit of extra exploratory help, and none of them offer any suggestions regarding the correct way to resolve these sorts of issues. What's the new workflow supposed to look like with regards to figuring out what dependencies to specify for different scenarios?
My earlier questions still stand also, I guess.