views:

1873

answers:

4

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??

A: 
  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
As far as I am aware yes .NET Framework 3.5 is installed on the server. As for changing the framework version, do you mean the runtime version on the ASP.NET tab in the website properties?
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
Yeah there are 3.5 assemblies in the GAC. And yes the runtime version is set to 2.0. Is the above answer correct in that 3.5 isnt supported on win2000?
Actually the server is running Windows Server 2003.
So then, it's IIS 6, not IIS 5.
splattne
Did you try to insert "Page" in the first line of your aspx?
splattne
Yeah I have tried that. Still no change. You can start to see these are the issues in converting a legacy website project to WAP. Utter nightmare.
+2  A: 

.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
The server is Windows Server 2003 BTW. but thanks for the reply.
Is there any reason for not using the default IIS6 on Windows Server 2003?
Darin Dimitrov
Unfortunately I am not sure as to why this is the case.
@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?
AnthonyWJones
Ah yeah my apologies, think Im going mental, yes...IIS6.
Could you post the complete stack trace of the exception you are getting?
Darin Dimitrov
A: 

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
Anthony, under the websites properties, I have selected the ASP.NET runtime version 2.0.50727 under the ASP.NET tab. Is this what you mean by the .NET tab? If so, you say the framework version not the runtime?
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.
AnthonyWJones
A: 

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.

@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.
AnthonyWJones