Jump to content

Issue with Build Environment to compile C# bindings


magnaparva
 Share

Recommended Posts

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?

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...