steven.miles:
Hi,
I've attempted to migrate a VS2005 "Web Site Project" to "Web Application Project". I overcome all issues except 1. When i try to build my new project it compains that a referenced assembly isn't strong named. Unfortunatley this is a third party .NET assembly so it is not built as part of my solution. Both new and old web projects are instructed to be signed in the assemblyinfo.cs the old web site project compiles and publishes fine and the new one doesn't. I've read some pages that suggest i can sign my precompiled(3rd party) assembly but haven't found anything that suggests how this is done. Ultimatley i have 2 questions.
1. What is the difference between "Site" and "Application" projects that makes this a problem for one and not the other?
2. How do i get my new application project to build
Thanks.
Steve.
(1)
A Web-Site Project is a project type that is built-in to VS.NET 2005. It provides a structure for building an ASP.NET web-based application. For compilation, as Web-Site Project uses the "new" compilation model for web-sites promoted by VS.NET 2005. This compilation model rests on the Precompilation of the site and it is quite different from the "old" compilation model in VS.NET 2003. There are many ways to configure Precompilation, but, in general the site compiles to >1 DLL files and 0..N content files/placeholders. It is complicated, but not too much so once you find the Precompilation configuration that you like. It can be more secure that the old VS.NET 2003 compilation model. See below for more details.
A Web-Application Project is a project type that is provided as an add-on project type. The Web-Application Projects compile to (generally) a single-DLL and 1...N content files. It is, pretty much, the same compilation model that VS.NET 2003 used.
(2)
You have a good question regarding signing a single DLL file.
Here is some information, but I got stuck trying to find the "module name", as mentioned in the MSDN help.
Here are some of the steps.
- First, you need to create a Public/Private Key Pair.
- Choose >Start, >Programs, >Microsoft Visual Studio 2005, >Visual Studio Tools, >Visual Studio 2005 Command Prompt.
- Enter the following at the command prompt and then press Enter...
sn -k C:\Temp\sgKey.snk
- Now the key pair is created.
- Next, sign the assembly, (for example "MyAssembly.dll"), with a strong name using the key file, (for example "sgKey.snk").
- At that point, MSDN, says... "At the command prompt, type the following command:
al /out:<assembly name> <module name> /keyfile:<file name>
In this command, assembly name is the name of the assembly to sign with a strong name, module name is the name of the code module used to create the assembly, and file name is the name of the container or file that contains the key pair."
- What is NOT clear to me is where one gets the "module name". Where does that come from if one is only starting with a singe file, MyAssembly.dll??? I want to type something like this...
al /out:"c:\Temp\MyAssembly.dll" MyModule.netmodule /keyfile:"c:\Temp\sgKey.snk"
...but the file MyModule.netmodule does not exist. What gets used for "module name" when one starts with a single file???
So, for question (2) I am just adding to the question and (I hope) framing it a bit --
So that one can sign a single DLL file Assembly with the Assembly Linker (al.exe), where does one get a "module file" for the command line syntax if one is starting with just a single DLL file?
(Note that most of the signing information above is paraphrased from MSDN.)
For more details, check here...
ASP.NET Web Site Precompilation -- http://msdn2.microsoft.com/en-us/library/ms228015.aspx
How to: Create a Public/Private Key Pair -- http://msdn2.microsoft.com/en-us/library/6f05ezxy.aspx
How to: Sign an Assembly with a Strong Name -- http://msdn2.microsoft.com/en-us/library/xc31ft41.aspx
If you or anyone finds an answer to the "when does one get the module name" question, please post it.
Thank you.
-- Mark Kamoski
http://www.WebLogicArts.com