Home > Net >  Can i make a clean exe without dll files ? in C#
Can i make a clean exe without dll files ? in C#

Time:02-18

  • hi , i have a question
  • Can i import this dll files in the program itself in C# ?
  • Note : the program will not open without them !

enter image description here

CodePudding user response:

Yes. Net 6 supports this, it's called a SingleFileApplication. see https://docs.microsoft.com/en-us/dotnet/core/deploying/single-file

CodePudding user response:

What you’re referring to is called static linking. As others have mentioned .NET 6 has a concept of a “single file application” that can handle this for you. If you’re using .NET Framework then things get a little more challenging as there’s no out of the box mechanism to do this. Fortunately there are techniques that can make this work — from bundling the library DLLs as resources and extracting them on the fly or using a tool like ilmerge. This is covered in depth here: Static Linking of libraries created on C# .NET

  •  Tags:  
  • c#
  • Related