Neil Weicher
Neil Weicher

Reputation: 2502

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.

Upvotes: 6

Views: 966

Answers (1)

Jon Skeet
Jon Skeet

Reputation: 1499770

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.

Upvotes: 10

Related Questions