Developer forum

Forum » Dynamicweb 9.0 Upgrade issues » 9.1.3 update : NullReferenceException on launch

9.1.3 update : NullReferenceException on launch

Gaëtan
Reply

Hi,

 

I upgraded my solution from 9.0.0 to 9.1.3 (overwrote the dlls, web.config, global.asax and Admin folder), but I get this error when I try to start the website :

[NullReferenceException: Object reference not set to an instance of an object.]
   Dynamicweb.Frontend.GlobalAsaxHandler.IsUrlPathSetup() +21
   Dynamicweb.Frontend.GlobalAsaxHandler.StartDynamicweb(Object sender, EventArgs e) +139
   Dynamicweb.Frontend.GlobalAsaxHandler.EnsureDynamicwebStarted(Object sender, EventArgs e) +146
   Dynamicweb.Frontend.GlobalAsaxHandler.Application_BeginRequest(Object sender, EventArgs e) +110
   System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +141
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +91

Any idea where that could come from ? I can't get anywhere (same error on both frontend and backend) and I don't seem to be able to get more information.

 

Thanks

2016-12-12_08_36_18-Object_reference_not_set_to_an_instance_of_an_object..png

Replies

 
Martin Vang
Reply
This post has been marked as an answer

Hi Gaƫtan,

Can I get you to tell me which version of Dynamicweb.Environment.Web you have in your bin folder? It needs to be the latest version, otherwise the httpcontext will not be available.

Votes for this answer: 1
 
Gaetan Caro
Reply

Ah yes, that was the problem ! For some reason it hadn't been updated.
 Just to be sure I re-pasted the whole content of the bin folder.

 

However now I have a weird error :

[ActivationException: IModuleService - 
LoaderExceptions information:
Could not load type 'Dynamicweb.Core.TemporaryContracts.IAnalyticsService' from assembly 'Dynamicweb.Core, Version=1.0.1.0, Culture=neutral, PublicKeyToken=null'.
Could not load type 'Dynamicweb.Core.TemporaryContracts.IItemService' from assembly 'Dynamicweb.Core, Version=1.0.1.0, Culture=neutral, PublicKeyToken=null'.
]
   Dynamicweb.Extensibility.Providers.ServiceLocator.GetInstance(Type serviceType, String key) +156
   Dynamicweb.Extensibility.Providers.ServiceLocator.GetInstance() +62
   Dynamicweb.Modules.ModuleManager.RegisterModules() +41
   Dynamicweb.Modules.ModuleManager.Initialize() +125
   Dynamicweb.Frontend.GlobalAsaxHandler.StartDynamicweb(Object sender, EventArgs e) +666
   Dynamicweb.Frontend.GlobalAsaxHandler.EnsureDynamicwebStarted(Object sender, EventArgs e) +147
   Dynamicweb.Frontend.GlobalAsaxHandler.Application_BeginRequest(Object sender, EventArgs e) +111
   System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +142
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +92

Which is weird because the Dynamicweb.Core.dll in my bin folder is v1.0.2.0. I tried removing the reference from my visual studio project and adding it again, but to no avail. I also tried adding an assembly binding in the web.config, but it didn't change anything.

2016-12-12_10_44_27-Unable_to_load_one_or_more_of_the_requested_types._Retrieve_the_LoaderExceptions.png
 
Martin Vang
Reply

I suspect it can be solved by deleting everything in your bin-folder and copying the updated content into it's place.

 
Gaetan Caro
Reply

Indeed, simply overwriting the content wasn't enough, deleting everything first made it work. Thanks.

But (of course there's a but !), now I can't log into the backend. I have an sql error about "AccessUserCountryCode" when I try. My AccessUser table doesn't have such a column.

2016-12-12_11_08_17-AccessUserCountryCode.png
 
Martin Vang
Reply

This is a bit technical, so I hope it makes sense.

You should set ecom_update.xml and update.xml to 0 og recycle your application pool.

 
Gaetan Caro
Reply

Perfect, it works fine now.

Thanks !

 
Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi Guys,

I am getting the same error, only I am installing it from scratch.
What can be wrong?

I have a fresh set of files and a fresh applicataion folder but I still get the error.

Thanks,

Adrian

 
Nicolai Pedersen
Reply

Hi Adrian

Can you provide a stack trace?

BR Nicolai

 
Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi Nicolai,

It's the same one as in the initial post, that's why I have not posted anything.
You can see it live here: http://op.dw9.dotfusion.ro/

 


[NullReferenceException: Object reference not set to an instance of an object.]
   Dynamicweb.Frontend.GlobalAsaxHandler.IsUrlPathSetup() +10
   Dynamicweb.Frontend.GlobalAsaxHandler.StartDynamicweb(Object sender, EventArgs e) +113
   Dynamicweb.Frontend.GlobalAsaxHandler.EnsureDynamicwebStarted(Object sender, EventArgs e) +121
   Dynamicweb.Frontend.GlobalAsaxHandler.Application_BeginRequest(Object sender, EventArgs e) +81
   Dynamicweb.Admin.Global.Application_BeginRequest(Object sender, EventArgs e) +20
   System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +141
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +69

Thanks,

Adrian

 
Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply

Hi Adrian,

Two things you may want to check if you run as a custom setup (I ran into something similar)

1. Make sure you use web.config from the application and not your own (stuff has changed between versions)

2. Clear your Bin folder and then copy the files from the application's bin to your project.

Hope this helps,

imar

 

 
Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Thanks Imar,

I actually started with the Rizzo files you gave me.

After I received the error, I looked for a similar problem on the forum and found out this post.

After reading the post, I tried with plain vanilla 9.x.x versions. I have tried every version starting with 9.1.0.

I have checked the permissions, the IIS settings and they seem fine. I have a another solution on the same server, running 9.1.0 

The only thing I kept from Rizzo is the Files folder and database.

Can it be related to any of them?

Thanks,

Adrian

 
Nicolai Pedersen
Reply

It is related to something in your setup.

This happens if the httpcontext has not been set by Dynamicweb. That happens in Global.asax. Do you have a custom version of that?

BR Nicolai

 
Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi Nicolai,

As far as I know, I have used the one supplied with the Application.

In this case, I am trying to use 9.1.5 but I have also tried with previous versions of 9.1

Adrian

 
Nicolai Pedersen
Reply

Can I see the entire screendump of this stack?

 
Nicolai Pedersen
Reply

And how you have set it up in IIS?

 
Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi Nicolai,

What you see when accesing the URL is all I have.

I have not made any special changes to the setup.

I have assigned the Application folder as default folder and I have added a virtual folder for Files.

I have disabled 32 bit for App Pool and I am using Integrated Mode.

I have attached a screenshot

 Adrian

mstsc_2017-02-07_11-58-42.png
 
Nicolai Pedersen
Reply

Hi Adrian

You have shown me half the error message. Would like to see all of it... And a dump of how this website looks like in IIS and your folder structure.

 
Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

I have made a video here: https://www.screencast.com/t/yTTJ7VN38SUJ

Not sure if it helps.

In the meantime I tried another approach.

I have removed the old "Files" and started the Install procedure keeping just the Database.

it looks like this approach at least started the website without issues.

Therefore I assume the problem lies in the content of the Files folder.

I will keep investigatinn until I find the difference.

Thanks,

Adrian

 

You must be logged in to post in the forum