views:

141

answers:

2

When you embed a resource into a .NET assembly using Visual Studio, it is prefixed with the assembly name. However, assemblies can have embedded resources that are not assembly-name-prefixed. The only way I can see to do this is to disassemble the assembly using ILDASM, then re-assemble it, adding the new resource -- which works, but... do I really need to finish that sentence?

(Desktop .NET Framework 3.5, Visual Studio 2008 SP1, C#, Windows 7 Enterprise x64.)

+1  A: 

Not assembly name - namespace ;) Default namespace, IIRC. The prefix is the default namespace ;)

TomTom
Okay, thanks.... in that case, is there a way (other than removing the default namespace) to prevent that behavior?
Robert Fraser
@Robert stop it. What are you doing? Leave it alone. You're going to get hurt messing with that. Wait until your father gets home.
Will
No other way. Removing the default namespace is not so bad, and will have no effect on the rest of your existing code that already has a namespace surrounding it. Although it will affect anything that creates a URI that references anything in your app that isn't explicitly namespaced.
slugster
@Will - I'm not actually accessing the resource from within the assembly; the assembly is being processed by a separate tool that requires the resource have a specific name.
Robert Fraser
@slugster - It has an effect on ReSharper :-(. Ah well, thanks
Robert Fraser
+1  A: 

Answer was provided by slugster in comments: there is no way to prevent this behavior other than removing the default namespace.

Robert Fraser