Can a DLL in .NET use a different extension, for example. HUSBAND?

I know this is a stupid question, but in Visual Studio 2010 C # .Net there is a way to name the assembly with a different extension than the DLL. For example, MyAssembly.MLL instead of MyAssembly.DLL.

I poked, but could not find a way to do this.

+6
source share
1 answer

No, I don’t believe that - at least not without a bunch of extra work.

I just tried this with manual renaming, and although you can compile it with a renamed assembly, it will not be found at runtime. The code will contain a link to MyAssembly , and the runtime will try to solve this problem with MyAssembly.dll and MyAssembly.exe ... but it will not know the actual file name that you used. There may be a way to configure this setting in app.config or using AppDomain.AssemblyResolve to allow the build itself, but I strongly suspect that other things might break.

Among other things, I would dissuade you from this simply from the point of view of unconventionality. You will surprise other developers, tools, etc. - not a good idea.

+10
source

Source: https://habr.com/ru/post/946422/


All Articles