Trex98HD
Trex98HD

Reputation: 3

Error MSB4186 while build c# ".NET 5.0" in mono

Maybe one of you know how to solve the problem.

I want to run a written c# project ".NET 5.0 Framework" on a raspberry pi 4 in the mono ide. For this I insalled allready the ".Net 5.0 SDK Framework" from Microsoft homepage. In the settings of mono I set the right path to the "dotnet" folder. He found the ".NET Core SDK" (5.0.201) and ".NET Core Runtime" (5.0.4).

If I try now to build the project in the mono ide, I get the build error :

"/home/pi/dotnet5sdk/sdk/5.0.201/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.TargetFrameworkInference.targets(54,5): error MSB4186: Invalid call syntax for static method: "[MSBuild]: : GetTargetFrameworkIdentifier ('$ (TargetFramework)') ". Method '[MSBuild] :: GetTargetFrameworkIdentifier' not found. The following format must be used to call static methods: $ ([complete type name] :: method ()). Example: $ ([System.IO.Path] :: Combine (a, b)). Make sure that all parameters are defined, are of the correct type, and are specified in the correct order.

I also use xbuild instead of MSBuild.

I searched in a lot of forums but didn't found anything that could help me with this issue.

Did I forget some required settings?

Upvotes: 0

Views: 782

Answers (1)

Lex Li
Lex Li

Reputation: 63295

https://github.com/mono/mono/issues/20250

Wait for an update to introduce latest MSBuild please. Without that .NET 5 projects can only be compiled by .NET 5 SDK dotnet command.

Upvotes: 1

Related Questions