Handling deps.json due to embedded assembly using Costura.Fody

1k Views Asked by At

I have a .NET Core console application that references a .NET Standard assembly.
I've also added a NuGet package for Costura.Fody and a FodyWeavers.xml file (see below).

This builds fine and everything seems great, but when I try to run my app (dotnet "MyApp.exe") it complains that it cannot find the file of the assembly that I've embedded mentioned in the MyApp.deps.json file.

The error message is:

An assembly specified in the application dependencies manifest (MyApp.deps.json) was not found:
package: 'My.Assembly', version: '1.0.0.0'
path: 'My.Assembly.dll'

This makes sense and running the app works fine if I remove mentions from this file manually, but my question is: Is there a way to tell either Visual Studio or Costura to remove mentions of this assembly from my deps.json file so that I don't need to edit this after each build? Although I could whip up a tool to edit this during post-build, I would prefer a built-in way. I did not see anything documented on the Fody github page...

FodyWeavers.xml for reference:

<?xml version="1.0" encoding="utf-8"?>
<Weavers>
  <Costura IncludeDebugSymbols="false">
    <IncludeAssemblies>
      My.Assembly
    </IncludeAssemblies>
  </Costura>
</Weavers>
1

There are 1 best solutions below

1
On

Delete deps.json and run your app.

That file is really unnecesary.