1

I apologize if this is a dumb question, but I'm fairly new to .NET development, and very new to NuGet packages.

I have installed a NuGet package to be used in a Visual Studio project. When I run the .exe file located in my project's bin/debug folder, the program works fine. However, if I copy and paste the .exe file to a different directory, the program no longer works.

How do I run this program without including the entire project folder (with packages subfolder included)?

Greg
  • 51
  • 8
  • Surely this will help you? https://stackoverflow.com/questions/34255864/how-do-i-create-an-exe-file-from-windows-forms/34255892#34255892 – Camilo Terevinto Oct 26 '20 at 17:32
  • 1
    Is this .net Core or and older .net framework application? – gunr2171 Oct 26 '20 at 17:38
  • (assuming .Net Core) Does this answer your question? [Publish .NET Core App As Portable Executable](https://stackoverflow.com/questions/50703578/publish-net-core-app-as-portable-executable) – gunr2171 Oct 26 '20 at 17:42
  • Unfortunately I receive the same error when using the .exe file compiled in the Release folder that I receive when using the file in the Debug folder. – Greg Oct 26 '20 at 17:54
  • This is not .NET Core, but .NET Framework. – Greg Oct 26 '20 at 18:19
  • 1
    For .NET Framework Does this answer your question? [Embedding DLLs in a compiled executable](https://stackoverflow.com/questions/189549/embedding-dlls-in-a-compiled-executable) – derpirscher Oct 26 '20 at 18:36
  • Thank you all very much. @derpirscher's suggestion of using Costura.Fody appears to have solved the problem. Still, I can't help but wonder if there's a simpler way. Perhaps I did not try compiling the program with the right settings, or I overlooked something else. Guess that's the price of being new to this for now. – Greg Oct 26 '20 at 21:35

0 Answers0