Closed g3rzi closed 12 months ago
Hello there,
Have you discovered any answers to this problem? This is the bottleneck for us, and we need a solution. Could you please make this a priority?
Thanks in advance.
Unfortunately, I haven't found it yet, I hope the owner @neuecc will help us because this issue is not solved.
Hello @neuecc,
Could you please help us.
Can you remove Microsoft.Net.Compilers
?
It hookss special compiling process, it harms the generator.
If you want to use Microsoft.Net.Compilers,
It seems to work with <PackageReference Include="Microsoft.Net.Compilers.Toolset" Version="4.8.0-2.final">
.
Hello @neuecc
Thanks for your response, but i haven't used Microsoft.Net.Compilers in my application. I have used below dependencies.
It seems that the situation with g3rzi is different. Please provide more details about your situation (csproj, Version of IDE (Visual Studio), generated code).
@neuecc thank you, it works!
after going to Packages and removing the Microsoft.Net.Compilers
it worked:
Also, the second solution to edit the MemoryPackConsole1.csproj
file works too:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net7.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="MemoryPack" Version="1.9.16" />
<PackageReference Include="Microsoft.Net.Compilers.Toolset" Version="4.8.0-2.final">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>
</Project>
There was already issue about that:
https://github.com/Cysharp/MemoryPack/issues/119
The solution was to go to the csproj file and change from
MemoryPack
toMemoryPack.Core
.Unfortunately, my csproj has only
MemoryPack
and it still doesn't work, this is why I opened a new case.I installed MemoryPack from the documentation:
Also Roslyn:
I have Visual Studio 2022 17.7.3, I am using the example from the documentation:
And I am getting the same error:
My csproject file:
I saw that in the exception that it still uses the
MemoryPack.core
:Also here:
Here the code generated: