Debugging in Visual Studio Mac 2022(17.5 (build 1802))

Hi all,

I am debugging a GH app in Visual Studio Mac 2022(17.5 (build 1802)), and got those error messages upon debug. The app was originally coded in Visual Studio Windows 2022 and runs/debugs well in Visual Studio Mac 2019. I understand this has something to do with targeting, with which I have no clue how to fix it.

/usr/local/share/dotnet/sdk/7.0.200/Microsoft.Common.CurrentVersion.targets(5,5): Error MSB3823: Non-string resources require the property GenerateResourceUsePreserializedResources to be set to true. (MSB3823)

/usr/local/share/dotnet/sdk/7.0.200/Microsoft.Common.CurrentVersion.targets(5,5): Error MSB3822: Non-string resources require the System.Resources.Extensions assembly at runtime, but it was not found in this project’s references. (MSB3822)

Thanks,

W

For those of you facing the same issue,

Open your csproj file and add the two lines.

MSB3823

<PropertyGroup>     
.. 
<GenerateResourceUsePreserializedResources>true</GenerateResourceUsePreserializedResources>
..
</PropertyGroup>

MSB3822(Or you can add SystemResourceExtensions from Nuget package manager)

<ItemGroup>
..
<PackageReference Include="System.Resources.Extensions" Version="7.0.0" />
..
</ItemGroup>
1 Like