Making web app strong named?

You should be able to do this the same way as any other application; generate a keyfile with sn -k and then add a reference to it from your AssemblyInfo.vb (or .cs) with an AssemblyKeyFile attribute.
 
That's right :) But the problem occurs for example when you want to load a user control. I receive a "System.IO.FileLoadException: The located assembly's manifest definition with name 'XXX' does not match the assembly reference". I think, that's because of dynamic compilation of pages through asp.net (\Microsoft.NET\Framework\v1.1.4322\Temporary ASP.NET Files\). These dlls are not strong typed. How can I make asp.net use my *.snk file during the compilation? That's my problem (I've thought it's common ;).
 
Have you tried giving the application a hard coded version number in the AssemblyInfo file?
Also out of interest is there a reason why you need to give a web app a strong name?
 
PlausiblyDamp said:
Have you tried giving the application a hard coded version number in the AssemblyInfo file?

Yes, I have.

Also out of interest is there a reason why you need to give a web app a strong name?

I have an idea to secure my business logic using the code security. I can then restrict an access to my public functions/objects etc. only to assemblies with known public key.
 
That shouldn't require the web application to require a strong name though, a strong name is required to authenticate the origin of a .Net assembly. A web application would be installed on a server and as such shouldn't need a strong name.
 
Back
Top