Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can DLL in .NET use a different extension, e.g. MLL?

I know this is a wacky question, but in Visual Studio 2010 C#.Net is there a way to name an Assembly with a different extension than DLL. E.g., MyAssembly.MLL instead of MyAssembly.DLL.

I poked around but could not find a way to do it.

like image 370
Neil Weicher Avatar asked Jun 03 '13 15:06

Neil Weicher


1 Answers

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

I've just tried this with a manual rename step, and although you can compile against a renamed assembly, it won't be found at execution time. The code will contain a reference to MyAssembly, and the runtime will try to resolve that to MyAssembly.dll and MyAssembly.exe... but it won't know the actual filename you used. It's possible that there's a way of configuring this within app.config or using AppDomain.AssemblyResolve to resolve the assembly yourself - but I strongly suspect other things may break.

Aside from anything else, I would discourage you from doing this just in terms of unconventionality. You'll surprise other developers, tools etc - not a good idea.

like image 119
Jon Skeet Avatar answered Oct 13 '22 09:10

Jon Skeet