Friday, April 29, 2011

ASP.NET 3.5 deployment issue under IIS5

Having gone through the pain of converting an ASP.NET website project to a web application project, I am now have trouble deploying this to our live web server under IIS5.

Under my local development machine (running IIS7) the deployment is working fine. I publish the web application project in Visual Studio 2008 to a folder on my local machine and then create a new website under IIS7.

When I try to do the same (with the same deployed files) on our live server under IIS5 I get the following:

"Object reference not set to an instance of an object.

Line 1: <%@ Language="C#" MasterPageFile="~/MyMaster.master" AutoEventWireup="true" Inherits="MyMaster.index" Codebehind="index.aspx.cs" %> "

Anyone got any ideas??

From stackoverflow
    1. Did you install the .NET Framework 3.5 on the server too? And did you change the Framework version to 2.0 in the ASP.NET settings of the web site in the IIS manager?

    2. Shouldn't the first line of an aspx file look like the following snippet?

      <%@ Page Language="C#" MasterPageFile="~/MyMaster.master" AutoEventWireup="true" Inherits="MyMaster.index" Codebehind="index.aspx.cs" %>
      (I took your line and added the "Page" keyword.)

    3. Did you deploy all assemblies from your local bin folder to the server?

    splattne : yes, there. The version for .NET 3.5 is ASP.NET 2.0.
    splattne : To be sure if you've installed 3.5 check the assembly folder. For Windows Server 2000 it should be C:\WINNT\assembly. You should find some .NET 3.5 version assemblies.
    splattne : So then, it's IIS 6, not IIS 5.
    splattne : Did you try to insert "Page" in the first line of your aspx?
  • .NET Framework 3.5 is not supported on Windows 2000.


    UPDATE

    If you are converting a Web Site Project to a Web Application Project make sure to check these pointers.

    Darin Dimitrov : Is there any reason for not using the default IIS6 on Windows Server 2003?
    AnthonyWJones : @Ryan: Umm... how on earth did you manage to install IIS5 on Server 2003 and why why why would you want to?? Are you sure you don't mean IIS6 in your question?
    Darin Dimitrov : Could you post the complete stack trace of the exception you are getting?
  • For clarity, Darin is correct .NET 3.5 is not supported on Windows 2000. The assumption you are using 2000 is derived from your question referencing IIS5. However in a comment you mention your server is 2003. Hence you are actually using IIS6.

    Assuming you have actually installed .NET 3.5 on the server you also need to open the applications properties dialog in IIS manager and visit the .NET tab, select the appropriate framework, 3.5 in this case.

    AnthonyWJones : It seems likely to me that something that has been built and working under IIS7 is targeting the 3.5 framework. Hence you should change the selection in the .NET tab, its worth at try, it can't be any worse that what you have now.
  • Yes just to clarify as AnthonyWJones has kindly pointed out, the server is running Windows Server 2003 NOT 2000 and therefore IIS 6.

    Furthermore, .NET 3.5 is definitely installed on this server.

    AnthonyWJones : @Ryan: Here at SO you can edit your question, clarifications and adjustments to the original question are encouraged. You should not be adding such things as answers. SO is not a NG or forum, answer are not necessarily even sequential but are generally viewed in votes order.

0 comments:

Post a Comment