Posts

Showing posts from 2008

Missing designer.cs files

Issue I imported a web application that had only .aspx and .aspx.cs pages and was missing the designer.cs pages. When the application was compiled got an error stating that the web controls were not defined. Resolution: The error message received during compilation is because of the missing designer.cs and so you will need to do the following to address it. a) Select the .aspx file and right click to see options. b) Select the option "Convert to web application". c) By doing so the designer.cs file will be created and the error message for this particular case should be avoided.

Namespace missing or dll not referenced

ISSUE: I have a class file called "test.cs " and the namespace is "sajjas.business" . When referencing the namespace in an " default.aspx.cs " file using the construct using sajjas.business; It gives me an error stating that the namespace is missing or dll is not referenced. RESOLUTION Reviewing the properties of the class " test.cs" found that the property "Build Action" was set to "content" and so the class was not precompiled, so that it could referenced in the default.aspx.cs page. To avoid the issue the value of the property "Build Action" should be set to "Compile".

Placing a .NET assembly in the GAC using MMC and sn.exe

Image
Step 1: Locate the assembly Locate the correct version of assembly with the mode you want to work with. (Debug, Release) Step 2: Open Visual Studio Command Prompt (Available in Visual Studio.NET Program group > Visual Studio.NET Tools >) • See the screenshot below • Switch to the directory location of assembly that you want to place in GAC. • Verify whether the assembly is strongly named or not, by typing the following command: sn –v myassembly.dll (-v switch verifies whether that assembly represents a strongly named assembly or not.) • If it represents a strongly named assembly, skip to step 4. Step 3: So you have an assembly that needs to be strongly named? • Create a key pair file that can be assigned to an assembly. To create a new key pair file Use sn –k keyfile.snk. Place this key file (keyfile.snk) in to the root of t...