Rider produces different output from dotnet

Good morning,

I have been having a very difficult time with VS Code on Mac and so wanted to find another IDE which enabled me to build and debug .net8 / MAUI code.

However, whilst the dotnet command compiles all the code without any errors, Rider (using MSBuild) is producing errors.

How can I get Rider to use the same build tool (dotnet) with the same parameters as I can do on the command line, before launching a debug session ?

Best regards
Simon

0
19 comments

In Settings | Build, Execution, Deployment | Toolset and Build, you can specify the MSBuild and .NET CLI used by Rider. For more information, please check this documentation.

0

Changing this setting, even unchecking the ReSharper option, does not change anything.

MSBuild.dll is still used, instead of dotnet.
When I use dotnet from the command line, the project builds fine.
However, when I use Rider, it uses MSBuild v17 (as it needs .net8 coverage) and the build fails.

Is there no way to “force” the usage of the dotnet command ?

0

Did you select the same toolchain as the dotnet CLI in Rider? Disable the ReSharper Build, Rider will perform as same as dotnet build actually. You can compare the result of the dotnet --info and the toolset settings in Rider, to check if they are the same.

0

I have done as you proposed, with no improvement.

The problem lies with two projects, one an ios specific project and another “generic” pcl project which is included as a reference project within the first.

Rider complains that the second project does not target .net8-ios, which is normal as it is generic.
I see that I cannot submit files here, so here are their contents (it's not long) :

Plugin.AudioRecorder (PCL).csproj
<?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Microsoft.NET.Sdk">
 <PropertyGroup>
   <AppDesignerFolder>Properties</AppDesignerFolder>
   <RootNamespace>GalaSoft.MvvmLight</RootNamespace>
   <TargetFramework>net8.0</TargetFramework>
   <Nullable>disable</Nullable>
   <ImplicitUsings>true</ImplicitUsings>
   <EnableDefaultCompileItems>true</EnableDefaultCompileItems>
 </PropertyGroup>
 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
   <DebugSymbols>true</DebugSymbols>
   <DebugType>full</DebugType>
   <Optimize>false</Optimize>
   <OutputPath>bin\Debug\</OutputPath>
   <ErrorReport>prompt</ErrorReport>
   <WarningLevel>4</WarningLevel>
 </PropertyGroup>
 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
   <DebugType>pdbonly</DebugType>
   <Optimize>true</Optimize>
   <OutputPath>bin\Release\</OutputPath>
   <ErrorReport>prompt</ErrorReport>
   <WarningLevel>4</WarningLevel>
 </PropertyGroup>
</Project>

Plugin.AudioProject (iOS).csproj
<?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Microsoft.NET.Sdk" DefaultTargets="Build">
 <PropertyGroup>
   <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
   <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
   <RootNamespace>Plugin.AudioRecorder</RootNamespace>
   <TargetFramework>net8.0-ios</TargetFramework>
   <Nullable>disable</Nullable>
   <ImplicitUsings>true</ImplicitUsings>
   <EnableDefaultCompileItems>true</EnableDefaultCompileItems>
   <UseMauiEssentials>true</UseMauiEssentials>
 </PropertyGroup>
 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
   <DebugSymbols>true</DebugSymbols>
   <DebugType>full</DebugType>
   <Optimize>false</Optimize>
   <OutputPath>bin\Debug</OutputPath>
   <DefineConstants>DEBUG;</DefineConstants>
   <ErrorReport>prompt</ErrorReport>
   <WarningLevel>4</WarningLevel>
   <MtouchDebug>true</MtouchDebug>
   <MtouchFastDev>true</MtouchFastDev>
   <MtouchProfiling>true</MtouchProfiling>
   <IOSDebuggerPort>25459</IOSDebuggerPort>
   <AllowUnsafeBlocks>false</AllowUnsafeBlocks>
   <CreatePackage>false</CreatePackage>
 </PropertyGroup>
 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
   <DebugType>pdbonly</DebugType>
   <Optimize>true</Optimize>
   <OutputPath>bin\Release</OutputPath>
   <ErrorReport>prompt</ErrorReport>
   <WarningLevel>4</WarningLevel>
   <MtouchNoSymbolStrip>true</MtouchNoSymbolStrip>
   <MtouchLink>SdkOnly</MtouchLink>
   <CreatePackage>false</CreatePackage>
 </PropertyGroup>
 <ItemGroup>
   <ProjectReference Include="..\Plugin.AudioRecorder %28PCL%29\Plugin.AudioRecorder %28PCL%29.csproj" />
 </ItemGroup>
 <ItemGroup>
   <PackageReference Update="Microsoft.Maui.Essentials" Version="8.0.92" />
 </ItemGroup>
</Project>

This compiles without any problem from the dotnet cli and from within VS Code.
How can I get this to compile correctly from within Rider ?

0

What's the build error message in your project? It might be a problem with your setup. You can paste the error here and I will check further.

0

Good morning Tao,

Here is the compile time message :
Microsoft.PackageDependencyResolution.targets(266,5): Error NETSDK1005 : Le fichier de composants '/AppName/Utils/Plugin.AudioRecorder (PCL)/obj/project.assets.json' n'a aucune cible pour 'net8.0-ios'. Vérifiez que la restauration s'est exécutée et que vous avez inclus 'net8.0-ios' dans TargetFrameworks pour votre projet.

I remind you that all the code compiles without error when using dotnet on the command line or from VS Code.

The version of Rider I am using is : 
JetBrains Rider 2024.3.6
Build #RD-243.25659.34, built on February 27, 2025
Licensed to Simon Giddings
Subscription is active until April 1, 2026.
For non-commercial use only.
Runtime version: 21.0.6+8-b631.39 x86_64 (JCEF 122.1.9)
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
Toolkit: sun.lwawt.macosx.LWCToolkit
macOS 15.3
.NET Core v8.0.11 x64 (Server GC)
GC: G1 Young Generation, G1 Concurrent GC, G1 Old Generation
Memory: 2048M
Cores: 8
Metal Rendering is ON
Registry:
 ide.experimental.ui=true
 llm.show.ai.promotion.window.on.start=false
 

I explicitly deleted the content of the ./obj directory before running a dotnet clean command on the command line.  Only afterwards did I proceed with the build in Rider.

I hope this helps.
Best regards
Simon

0

Hi Simon Giddings , I found a similar problem on our bug tracker as yours. 

RIDER-116616 .NET MAUI Blazor Can't be debugged, due to a build error (NETSDK1005) which is only produced in Rider.

Could you please reproduce the issue and collect the full log bundle so we could take a closer look at the case? Please clean the solution (delete the .obj and .bin in the solution) then reproduce the issue.

Please upload the file to our server and share the ID. I will verify if you are in the same situation and see if it's possible to find a workaround.

 

0

Hi Tao Sun,

I have sent the log to your server, it's ID is : 2025_04_14_jW8upyUHgmvomgzqL1y3BP

Please note that this is on our commercial product, for which I am evaluating Rider.

Best regards
Simon

0

Good morining,

Can you tell me if you have any news on this issue, please ?

Best regards
Simon

0

Hello,

Can you please give me an update of your progress on this issue ?

Best regards
Simon

0

Simon Giddings Hi, I'm waiting for our developer response. It's better if you can try with the latest Rider release to prevent any potential issues. 

I found two possible solutions to this problem:

  • Did you try to specify the project references in Rider? Right-click your solution root node in the Solution Explorer, in Properties, add project dependency from the iOS project to the PCL project.
  • In the PCL project try to add <TargetFramework>net8.0;net8.0-ios</TargetFramework> to see if explicit declaration works in your situation.

Since I could not easily reproduce the problem from my side, appreciate if you can try with dotnet build -v diag (clean and rebuild the solution) to show the diagnostic build output when using CLI, thus we may figure out the differences between Rider and dotnet CLI invocations.

0

Good morning Tao,

Thank you for getting back to me.

I have tried the two possible solutions you mention here.
The first one is already done, the pcl project is indeed referenced as a project dependency.
The second causes a build error.

I have sent two files with diagnostic information via your upload server (ref: 2025_05_07_qrpbFDakgVSVfxcU5S1XQq).
The name of each file should be explicit enough, I think.

Two other pieces of information which might be of help -

  1. This is part of a larger multiplatform mobile project (Android/iOS), originally created in Xamarin.
  2. The command to build, used on the command line is :
    dotnet build Appname.sln -target:Appname_iOS -property:Configuration=Debug
    (name of app changed as this is a public forum)

Best regards
Simon

0

One further piece of info, here is the command generated by the vscode environment :

dotnet build -t:Build -p:Configuration=Debug -r ios-arm64 -p:CustomAfterMicrosoftCSharpTargets="/Users/developer/.vscode/extensions/ms-dotnettools.dotnet-maui-1.9.21-darwin-x64/dist/resources/Custom.After.Microsoft.CSharp.targets" -p:MauiVSCodeBuildOutputFile="/var/folders/by/v2zd999120bfwr5rrvftk5gr0000gr/T/dotnet-maui/maui-vsc-13525ea8-0665-4a10-b5a7-81bb892cb3d0.json" -p:MauiTargetProject="/Users/developer/Dev/Appname/App/Appname.iOS/Appname.iOS.csproj" -p:XamlTools="/Users/developer/.vscode/extensions/ms-dotnettools.csharp-2.72.34-darwin-x64/.xamlTools" /Users/developer/Dev/Appname/App/Appname.iOS/Appname.iOS.csproj

Regards
Simon

0

Good morning Tao,

Do you have any news on this issue, one week later, please ?

Regards
Simon

0

I checked my previous response, you should use 

<TargetFrameworks>net8.0;net8.0-ios</TargetFrameworks>

but not 

<TargetFramework>net8.0;net8.0-ios</TargetFramework>

in the PCL project to prevent the build error, is that works for you? 

If the problem persists, please reply with the error message in Rider in this thread for further investigation.

0

Good morning Tao,

Well, we seem to have got further now.

The build still produces errors, however, that are not present in the dotnet build :

14>AudioRecordManager.cs(5,14): Error CS0234 : Le nom de type ou d'espace de noms 'AudioRecorder' n'existe pas dans l'espace de noms 'Plugin' (vous manque-t-il une référence d'assembly ?)
14>ISoundHelper.cs(3,14): Error CS0234 : Le nom de type ou d'espace de noms 'AudioRecorder' n'existe pas dans l'espace de noms 'Plugin' (vous manque-t-il une référence d'assembly ?)
14>AudioRecordManager.cs(23,26): Error CS0246 : Le nom de type ou d'espace de noms 'IAudioRecorderService' est introuvable (vous manque-t-il une directive using ou une référence d'assembly ?)
14>ISoundHelper.cs(22,9): Error CS0246 : Le nom de type ou d'espace de noms 'IAudioRecorderService' est introuvable (vous manque-t-il une directive using ou une référence d'assembly ?)

I will send relevant files onto your upload server.

 

0

The upload id is 2025_05_26_kMU7mE4u4UFfvSTHZG8d8x, and contains the impacted files.

0

Hello,

After a month of silence from yourselves, can you please give me some news of your progress in this matter ?

Best regards

0

You should have a check with your .csproj declaration.

In the Plugin.AudioRecorder (iOS).csproj, Project Reference was added with incorrect relative paths. Escape characters should not been added here.

When replace the incorrect escape characters with the actual Plugin.AudioRecorder (PCL), I can compile it successfully. If the Project References are added in Rider and you always can reproduce the same problem, please let me know.

  <ItemGroup>
    <ProjectReference Include="..\Plugin.AudioRecorder %28PCL%29\Plugin.AudioRecorder %28PCL%29.csproj" />
  </ItemGroup>
0

Please sign in to leave a comment.