(Translator used.)
I was making an exe file using Costura and Fody. However, if the dll file is missing, it cannot run. And there is a warning in my Visual Studio.
Warn:
FodyPackageReference Fody: The package reference for Costura.Fody is missing the 'compile' part in the IncludeAssets setting; it's recommended to completely remove IncludeAssets
C# - why costura and fody doesn't work to me?
8.2k Views Asked by 농심짜파게티 At
3
There are 3 best solutions below
0
On
Looks like previous answer, I got rid of the warning this way:
- Double click on project node
- In CSPROJ file add "compile;":
<IncludeAssets>runtime; compile; build;.....
- Reload project
1
On
Actually, the error message tells you what to do: "... it's recommended to completely remove IncludeAssets".
More specifically, in your project file ( .csproj or .vbprog ) find where it says as an example:
<PackageReference Include="Fody">
<Version>6.3.0</Version>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
and change it to:
<PackageReference Include="Fody">
<Version>6.3.0</Version>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
(i.e. remove the <IncludeAssets .....> line entirely).
Doing this, as applicable, for both costura and fody.
I have this warn, too. But it works fine for me. So it's not the warn that leads to your issue.
In my opinion, maybe it's because the costura version does't fit your project. You can try an older version.
As for me, my project is using .NET Framework 4.6, and the latest costura.fody 5.3 version isn't compatible. But the 5.2 work fine.
And how to remove the warn: (edit the csproj file)
Find below and comment "
IncludeAssets" line as below (by adding<!-- -->)If you don't know how to edit this file you can find the steps here: How to edit .csproj file