a developer's notes – a semi-technical web development BLOG

September 29, 2011

Why can’t I run my .NET 4.0 site on Windows 2003 with IIS 6?

Filed under: ASP.NET — Duy Nguyen @ 10:44 pm
Tags: , , , , , , , , , , , , , , , , , ,

IIS 6 (that comes with Windows 2003) does not let you have more than one framework at a time running in the same instance like IIS7 that can create Application PoolS targeting different frameworks. This just means a single application pool can’t be used for two different frameworks like IIS7.

You have a two options:

  1. Downgrade the .NET application to 3.5 with Visual Studio 2010. Just go to the Website project properties, Application tab and there is a drop down with all the framework releases, select 3.5.

    VS2010 will reload the project and modify the web.config. If you added A web service reference, thEN you may have to delete them and re-add them under 3.5

  2. Configure IIS6 with a second application pool and a second web site.

    • Create a new application pool…

      and new web site…

      Then assign this application pool to the Framework 4 web application that will be hosted by your new site. To assign the application pool, in the IIS console open the properties section of the web application, and click on the “Home directory” tab and select the application pool which you have created earlier.

    • Then you need to change the ASP.NET version of your application. Right click your virtual directory that hosts your application and click the property and check the ASP.Net. Select Framework 4.

    • Select ASP.NET 4.0 on IIS6 under Web Service Extension. Go to the IIS6 console open “web service extension node” which is right below the “default website” node. You will see the entire ASP.Net framework list that is installed. By default these frameworks might be prohibited so please select ASP.Net Framework 4 and click allow button.

      *If you don’t see ASP.NET 4.0, make sure the framework is installed on the server! If it is, then open a command prompt go to this directory: C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319
      Then run this command: aspnet_regiis -i

      You will now see ASP.NET 4.0. If you don’t set ASP.NET 4.0 to ALLOW, You will get a “404 Page is not found.”

Check out this great article:

http://stackoverflow.com/questions/2821514/default-aspx-with-iis-6-0-and-net-4

Advertisements

“No symbols have been loaded for this document” when trying to debug on a ASP.NET MVC .aspx View page

Filed under: General Tips — Duy Nguyen @ 5:50 pm
Tags: , , , , , , , , , , , , , ,

Problem:
I was always able to set a break point on any server side code within an MVC .aspx View page.

Server side code like this:

<a href="url">Link text1</a> 

//(Sever side code is code that is between <% and %>
<%                
	string x = "";
	if (ViewData["status"] != null)
	{
		x = ViewData["status"].ToString();
	}
%>

<a href="url">Link text2</a> 

Then while coding, all of a sudden I lost that ability. When you hover over the breakpoint, it would say “The breakpoint will not currently be hit. No symbols have been loaded for this document.” The strangest part is that I was able to set a break point on the controller of the view!

Resolution:
There is some server side code that is throwing an error. Remove all code and put in a simple statement such as int x = 0;

Then set a break point on that. When I did that, I was able to hit the break point, then use the immediate window to make sure the code I was trying to use wasn’t throwing any errors.

Missing Modules Window in Visual Studio 2010

Filed under: General Tips — Duy Nguyen @ 1:44 pm
Tags: , , , ,

If the Modules Window in Visual Studio 2010 is not under Debug, Windows, Modules, you can get it back by pressing Ctrl-Alt-U.

Create a free website or blog at WordPress.com.