magnaparva Geschrieben March 3, 2017 at 12:54 Share Geschrieben March 3, 2017 at 12:54 I am attempting to compile the C# bindings in a Ubuntu 16.0 environment using mono compiler version Stable 4.8.0.495/e4a3cf3. Reverting to csharp-2.1.12 git tag and running the following commands: cd ~/tf/generators/csharp python generate_csharp_bindings.py && python generate_csharp_zip.py I receive the following xbuild compile errors: Project "/tmp/generator/csharp/source/Tinkerforge/Tinkerforge.csproj" (default target(s)): Target PrepareForBuild: Configuration: Release Platform: AnyCPU Created directory "bin/Release/" Created directory "obj/Release/" Target ResolveNuGetPackageAssets: : error : Your project is not referencing the ".NETFramework,Version=v4.0" framework. Add a reference to ".NETFramework,Version=v4.0" in the "frameworks" section of your project.json, and then re-run NuGet restore. Task "ResolveNuGetPackageAssets" execution -- FAILED Done building target "ResolveNuGetPackageAssets" in project "/tmp/generator/csharp/source/Tinkerforge/Tinkerforge.csproj".-- FAILED Done building project "/tmp/generator/csharp/source/Tinkerforge/Tinkerforge.csproj".-- FAILED Build FAILED. Errors: /tmp/generator/csharp/source/Tinkerforge/Tinkerforge.csproj (default targets) -> /usr/lib/mono/xbuild/Microsoft/NuGet/Microsoft.NuGet.targets (ResolveNuGetPackageAssets target) -> : error : Your project is not referencing the ".NETFramework,Version=v4.0" framework. Add a reference to ".NETFramework,Version=v4.0" in the "frameworks" section of your project.json, and then re-run NuGet restore. 0 Warning(s) 1 Error(s) I assumed the issue was with the project.json requesting invalid dependencies, though that all looks as fairly minimal and correct. Doing some research it seems that the project.lock.json file is generated anyway by the project.json file so I thought I would try simply deleting it, and it now compiles fine. The easiest way I found to remove it was to delete line 77 from generate_csharp_zip.py as well as deleting the file. Is the project.lock.json actually required? Zitieren Link zu diesem Kommentar Share on other sites More sharing options...
magnaparva Geschrieben March 3, 2017 at 13:03 Autor Share Geschrieben March 3, 2017 at 13:03 Further to this I have just tried to compile tag csharp-2.1.10 which does not include the json files and works perfectly, it is only in 2.1.11 and 2.1.12 where I have the compile problems. Zitieren Link zu diesem Kommentar Share on other sites More sharing options...
photron Geschrieben March 6, 2017 at 14:51 Share Geschrieben March 6, 2017 at 14:51 Oh, I didn't notice that recent Mono picks up those project.json files as well. They are only meant for Visual Studio. You can just delete them on Linux for now. I'll look into a correct solution for this problem. Thanks for the report. Zitieren Link zu diesem Kommentar Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.