Developer forum

Forum » Development » .Net 4.0

Reply
Hi all,

I updated the .Net framework on a server to 4.0, and after that I get an exception when accessing folder paths like /Admin og /Admin/Access:

 

Server Error in '/' Application.

Object reference not set to an instance of an object.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[NullReferenceException: Object reference not set to an instance of an object.]
   Dynamicweb.Admin.Global.Application_OnPreRequestHandlerExecute(Object sender, EventArgs e) +329
   System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +148
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +75


Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.1


When accessing /Admin/Default.aspx everything works fine, but merely accessing the folder causes the exception.

Any ideas?

BR.
Lars

Replies

 
Reply
Hi Lars,

1. Is this a custom solution that runs under 4.0 ?
2. Are you using IIS Integrated pipeline mode ?
3. What is the app version ?

- Pavel
 
Reply
Hey buddy:)

It's standard 19.1.1.0 running on IIS 6. This is a 64 bit server running 32 bit, and apparantly I have no chance of specifying neither .Net version nor pipeline mode on the IIS.

BR.
Lars
 
Jeppe Eriksson Agger Dynamicweb Employee
Jeppe Eriksson Agger
Reply

When you say, that you can't specify the .net version on the server, is that because you don't have access to the IIS manager?

If you do, then you can set the .net version in IIS6 Manager. Right-click your website and select Properties. Go to the tab "ASP.NET" and select another version from the dropdown list.
With regard to pipeline modes, then you are correct. IIS6 only has the classic pipeline mode, therefore it's not possible to change it.

I am wondering though. If you're on a 64-bit server, then you're probably using Windows Server 2008 or 2008 R2. Why then use IIS6 and not IIS7 or IIS7.5?

- Jeppe

 
Reply
The thing is I don't have the ASP.NET tab in the Properties window. It's a 2003 R2 server.

BR.
Lars
 
Nicolai Høeg Pedersen
Reply
Then that could be you issue.

Run aspnet_regiis -i from a command prompt from the .net framework folder.

http://msdn.microsoft.com/en-us/library/k6h9cz8h(VS.80).aspx
 
Reply
That also works, but running DW in .NET 4.0 causes the previously mentioned error, so I want to run some sites in 2.0 and others in 4.0. That's quite difficult since I don't have the ASP.NET pane in the website properties:)

I was hoping register 4.0 on single websites using the cmd prompt, so any ideas are welcome.

BR.
Lars
 
Nicolai Høeg Pedersen
Reply
What does the isapi handler mapping look like on the DW site that is not working? If it works on files with .aspx but not on default document - that could be the issue.

Default document setup - is that ok?

 
Reply
Yup, default document's OK as well. That's why I find it so odd. /Admin causes the error, but /Admin/Default.aspx works perfectly.
 
Nicolai Høeg Pedersen
Reply
Coffee, late night, "#¤%&, and a couple of hours and it is fixed...
 
Reply
You don't drink coffee?
 
Jeppe Eriksson Agger Dynamicweb Employee
Jeppe Eriksson Agger
Reply
You can change the asp.net version of a specific website. You need to know the MetaBase Path for that site though.

This can be done using the same utility (aspnet_regiis.exe). This utility is usually found in the "C:\Windows\Microsoft.NET\Framework\<version>\" folder. Using the cmd "aspnet_regiis.exe -lk" will list all the websites MetaBase Paths. Find the correct one, and note the path.

Next run "aspnet_regiis -s <MetaBase Path>" and that website is now set to use the .net version that the "aspnet_regiis.exe" utility belongs to.

- Jeppe
 
Reply
Oh, interesting. Actually I tried that but didn't find the correct path (read: didn't understand, what I found:)), so that didn't work out for me. I'll deffinately give it another try. Thanks:)
 
Jeppe Eriksson Agger Dynamicweb Employee
Jeppe Eriksson Agger
Reply
The path usually looks something like this: "W3SVC\1\ROOT".

So I think for you, that the path would look like that, and you just need to change the "1" to the correct value for your site. And not bother with any sub-paths. Using the "-s" option and not the "-sn" will ensure, that all child paths are set to the correct .net version as well.

Edit: I'm actually not sure whether it's "\" or "/" separators, but the tool can tell you :-)
 
Reply
Excellent, thanks, I'll let you know how it works out:)
 
Reply
Yehaa, it worked. Thanks a lot Jeppe. Only problem was that damned Via Spawn service blocking the process from shutting down W3SVC service, so I had to kill it manually. Perhaps other might benefint from that information.

Thank again, your're my hero:)

 

You must be logged in to post in the forum