dotnet 5 and Xamarin Android: The imported project "Xamarin.Android.CSharp.targets" was not found
Asked Answered
B

2

11

I'm running on MacOs Apple M1 chip (ARM64 but using Rosetta 2):

  • Rider 2020.3 EAP 10
  • dotnet 5
  • Xamarin Android plugin and SDK installed within Rider.

When I open a Xamarin Android app solution, most of the code is red including statements like "using System" and I get the following build error:

The imported project "/usr/local/share/dotnet/sdk/5.0.100/Xamarin/Android/Xamarin.Android.CSharp.targets" was not found.

It seems to be related to dotnet 5 judging by that path. Anyone has a clue?

Barfly answered 5/12, 2020 at 0:44 Comment(2)
.net 5 is not compatible w/ Xamarin, .net 6 will be "...Xamarin developers can use the unified .NET platform when we release .NET 6.0...." : devblogs.microsoft.com/dotnet/announcing-net-5-0Mcbee
@Mcbee Thank you! I guess I have to install an older dotnet SDK thenBarfly
P
1

Had the same problem. Updating VS for Mac and all its dependencies (MSBuild and Mono) solved the problem.

PS: make sure that Rider has Auto detected mode enabled in Preferences->Build, Execution, Deployment->Toolset and Build-> Use MSBuild version

If you don't have VS4Mac installed and don't want to install it you can just extract MSBuild from the VSMac installer (without installing the whole application) and have it working in Rider as a custom MSBuild.

Postdate answered 11/6, 2021 at 9:1 Comment(0)
B
-1

@SushiHangover

.net 5 is not compatible w/ Xamarin, .net 6 will be "...Xamarin developers can use the unified .NET platform when we release .NET 6.0...." : devblogs.microsoft.com/dotnet/announcing-net-5-0

Barfly answered 6/12, 2020 at 10:38 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.