March 15, 2007  

Just in case anyone else is having problems getting debugging to work with Visual Studio 2005 and IIS7, here is a link that will fix your problem.

http://mvolo.com/blogs/serverside/archive/2006/12/28/Fix-problems-with-Visual-Studio-F5-debugging-of-ASP.NET-applications-on-IIS7-Vista.aspx

 

Thanks Mike….

|Categories :   Comments [0] Trackback
May 23, 2006  

I received a question today from one of my readers. (1 of the 10 I guess. LOL ) about VS2005 web projects.

Doc,

    I am trying to add some class code to my website project and it does not seem to want to recognize the namespace that I am using. When I create a namespace in my aspx files I can see them but not in my class files. What am I doing wrong?

This is a common mistake for those who are new to VS2005.  Since you are now able to point to a folder on your drive and bring up a web project without setting up an IIS virtual directory, you need to do things a  bit different. All class files need to be put in a special folder called App_Code. This folder will automatically be compiled at run time. You can use it to store .cs, .vb, xsd, wsdl etc..

The compiler will look to see what extension .cs or .vb your files have and use that languages compiler for C# or VB respectively. The code is then compiled into a single assembly and is made available to the code in your project. This means that you cannot have files of different languages inside this folder.

Or can you...?

By placing a <compilation><codeSubDirectory> set of tags in your web.config. The compiler will create separate assemblies for each folder. Of course, you have to put the files of like type into those folders.

<configuration>
   <system.web>
      <compilation>
         <codeSubDirectories>
           <codeSubDirectory directoryName="/aspnet/code/mySubDir1"/>
           <codeSubDirectory directoryName="/aspnet/code/mySubDir2"/>
           <codeSubDirectory directoryName="/aspnet/code/mySubDir3"/>
         </codeSubDirectories>
      </compilation>
   </system.web>
</configuration>
Hope that helped.
Happy Programming!
Doc
|Categories :   Comments [0] Trackback