0

Extract Code from Nuget Package

Can i extract complete source code from a nuget package File? e.g. (Filename.nupkg)

I was trying to decrypt a nuget package and get its source code. I have tried decompilers like dotpeek but no luck. It just gave me an overview of how that code was compiled

Links i have searched are below Extracting Nupkg files using command line

6
  • 2
    Most nuget packages does not contain any source code to extract. If they do then I would assume that they also publish it elsewhere (like Github). If not then decompiling is the only way to view the "source", though it won't match the original source exactly. Commented May 2, 2024 at 12:12
  • you may enable "SourceLink" which will search for the packages sourcecode on the internet, assuming it was even published (e.g. on github or Azure DevOps) Commented May 2, 2024 at 12:16
  • @MakePeaceGreatAgain..kindly let me know how can i enable "SourceLink" any article? Commented May 2, 2024 at 12:16
  • If the package contains source code, it's in reality just a .zip file, so you can just extract it and look. If doesn't contain the source code, then that won't work. Commented May 2, 2024 at 12:25
  • Before decompiling anything, I'd first try to find that package on nuget.org, follow the "Source repository" link. If that's not leading you anywhere, then follow the "Project website" link and try to read up on it there if they released sources in any shape or form. If neither happens to be the case: why do you think you need the sources in the first place? If that project doesn't want you to see their sources, maybe switch to another one, that does? Commented May 2, 2024 at 12:48

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.