Jump to content
Tuts 4 You

How to build dnspy with dnlib as dependency project


Recommended Posts

I am trying to build dnspy with dnlib as a dependency project in VS2019. So I can debug dnspy and follow whats happening in the dnlib source.

Things I have tried:

1. git clone just dnspy and build using "dotnet build" works. But how can I add dnlib project to dnspy solution in vs2019 and make it build.

2. I also tried the NuGet from vs2019 and install dnlib, but it gets only the dnlib.dll not the entire project.

3. downloaded the dnlib project and added manually to the dnspy sln. it wasnt building at all.

4. dnlib byitself builds fine.

5. dnspy builds fine in git bash shell. Once this is done. the dnspy sln builds fine in vs2019 but only with the dnlib.dll already downloaded by the script.

Any help would be appreciated.

Edited by extonoxt
Link to comment

Hi atom0s,

Thanks. I did

git clone --recursive https://github.com/0xd4d/dnspy.git

and that didnt pull the dnlib.

This is what I did today, still no dnlib

1. no response


2. All of the following did not pull the dnlib







3. VS2019 shows the dnlib.dll from NuGetI, but dont know how to replace them with the actual project




Link to comment

If they are referenced through nuget then you would have to remove all the nuget references from each project that uses it. Then readd the dnlib project to the solution and add references back to each project that used to have it.

  • Like 1
Link to comment

@atom0s : no offence but you should probably try the advice before giving it..

dnSpy/dnLib/de4dot have switched to SDK-style projects. Removing nuget reference is trivial. Adding dnlib project to the dnspy solution and making it compile is not. There are no build dependencies in SDK-style projects, libraries can (and do) target different platforms and it all is one unholy unmaintainable mess. I spent last hour trying to do what you suggested and I've still failed to make it compile.

If you manage to build it, would you kindly post the required steps so that I can do that too? :)

  • Like 1
Link to comment


Thank you. I tried that too. There are simply too many references and errors. I dont know how to resolve them. I was able to build de4dot though. There has to be a way.

Edited by extonoxt
Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...