Developer forum

Forum » Ecommerce - Standard features » Crash when ASP.NET 4.6.2 is installed

Crash when ASP.NET 4.6.2 is installed

Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply

Hi there,

ASP.NET 4.6.2. introduces a new Globalization namespace inside System.Web. This causes an issues with on-demand compilation when the existing Globalization namespace isn't prefixed with System. An example can be found here which crashes when you try to build the old index :

Admin\Content\Management\SearchEngine\Manage.aspx

The code looks as follows:

If Not DateTime.TryParseExact(indexerStatus("StartTime"), "dd-MM-yyyy HH:mm:ss", Nothing, Globalization.DateTimeStyles.None, startTime) Then

This causes .NET to crash because Globalization is now ambiguous between System and System.Web. The fix is easy; just prefix it with System:

If Not DateTime.TryParseExact(indexerStatus("StartTime"), "dd-MM-yyyy HH:mm:ss", Nothing, System.Globalization.DateTimeStyles.None, startTime) Then

There might be other cases in the code where this is an issue too.

Can this be fixed so developers can continue to work locally and rebuild the old index? 4.6.2 seems to be a mandatory part of the Win 10 Anniversary Update so more people will run into this soon.

Imar


Replies

 
Nicolai Høeg Pedersen
Reply

Hi Imar

Yes, I'll have that fixed allover.

BR Nicolai

 
Anders Ebdrup
Anders Ebdrup
Reply

Hi Nicolai,

 

Has this been fixed in the 8.6.x-branch? Or can we make a workaround to fix this in an old version?

 

Best regards, Anders

 
Morten Bengtson Dynamicweb Employee
Morten Bengtson
Reply

Hi Anders,

8.6? Thats an oldie. I would recommend upgrading :)

You can try to fix this by adding something like this to web.config...

<location path="Admin/Content/Management/SearchEngine">
    <system.web>
      <pages>
        <namespaces>
          <remove namespace="System.Web" />
        </namespaces>
      </pages>
    </system.web>
  </location>

I'm not sure if there are any issues with this workaround though.

Best regards,
Morten

 
Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply

Or you could modify the admin ASPX pages and append System in front of the references.

Imar

 
Anders Ebdrup
Anders Ebdrup
Reply

Thanks, Morten! It works perfectly!

 

You must be logged in to post in the forum