1
  • 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

Sycho AN
  • 73
  • 6

2 Answers2

4

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

d.moncada
  • 16,900
  • 5
  • 53
  • 82
  • 1
    Technically this is a low-quality post (URL post only). It would be better to add a summary and some examples because the URL might change in the future (MS does this all the time). – John Alexiou Feb 18 '22 at 05:14
1

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

theficus
  • 53
  • 5