Developer forum

Forum » Development » Custom Module error after upgrade

Custom Module error after upgrade

Sonni Tost
Reply

Hi everyone,

We have just made a copy of our site and upgraded it from Content version 19.2.9.15 to 20.2.3.17 (DW 8.2.3.17).

We have made three custom modules - but one of them fails on front-end with the error below:

---
An error occured while attaching module (Dynamicweb.Frontend.Content)

System.MissingFieldException: Field not found: 'Dynamicweb.Frontend.PageView.ID'.
   at CustomRefaReno.refaRenomaticMobile.refaRenomaticMobile.GetContent()
   at Dynamicweb.Frontend.Content.getModule(DataRow& ParagraphRow)
---

On the back-end it gives me this error when I try to edit the module content:

---
Method not found: 'System.String Dynamicweb.Properties.get_getTable(System.String)'.
---

All the modules were successfully tested prior to the upgrade using the Compatibility Checker.

What am i doing wrong? Can somebody point me in a direction as to what the error could be?

Kind regards


Sonni T.


Replies

 
Nicolai Høeg Pedersen
Reply
This post has been marked as an answer

Hi Sonni

You are not doing anything wrong.

The Dynamicweb.Frontend.PageView.ID changed from a field to a Property between 7 and 8

Properties.get_getTable is now Values property.

The compatibility checker is not able to see all differences.

But just change these 2 things and rebuild your solution against the Dynamicweb 8 dll and .net 4 and you are up and running.

BR Nicolai

Votes for this answer: 1
 
Sonni Tost
Reply

Hi Nicolai,

I'll look into it promptly - thank you for the swift reply!

Sonni T.

 
Sonni Tost
Reply

Hi Nicolai,

It looks as if that did the trick! Thank you very much! :-)

 

Sonni T.

 
Sonni Tost
Reply

Hi again,

It looks as if I cheered a little too early.

When I try to access the module in the back-end I get the following error:

[NullReferenceException: Object reference not set to an instance of an object.]
   CustomRefaReno.refaRenomaticMobile.refaRenomaticMobile_edit.Page_Load(Object sender, EventArgs e) in C:\@dynamicweb\app.dynamicweb.dk\www.refa.dk\application\CustomModules\refaRenomaticMobile\refaRenomaticMobile_Edit.aspx.cs:78
   System.Web.UI.Control.LoadRecursive() +115
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2909

In my refaRenomaticMobile_edit.aspx.cs I only have this:

Dynamicweb.Properties p = Dynamicweb.Properties.LoadProperties();

And a list of p.SetDefaultValue("fieldnames", "values"); and field.Value = p.Values["fieldnames"].ToString(); and on line 78 I have name.Value = p.Values["name"].ToString();.

If I delete that - then the error occurs on line 79 instead where I have phone.Value = p.Values["phone"].ToString();

Am I missing something? I get no errors when I compile it.

 

Sonni T.

 
Nicolai Høeg Pedersen
Reply

You should use the new Item property of Properties object instead of the values hash table.

BR Nicolai

 
Nicolai Høeg Pedersen
Reply

And no reason to call tostring - it could return a null value, so tostring will give you an exception.

 
Sonni Tost
Reply

Hi Nicolai,

I was fortunate enough to make it work yesterday. After making DW7-to-DW8 updates it still did not work. Then I changed the name of the value from 'name' to 'nameStr' - suddenly it worked. I will follow your advice and make the other update as well.

Kind regards

Sonni

 
Medo Huremovic
Reply

Hi everyone,
I just upgraded to DW DW 8.4 and now I use .Net Framework 4.5.1. I can compile solution without error but my frontend show this error. what is the problem?

On the frontend I get this error:

Server Error in '/' Application.


Expression must evaluate to a node-set.

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.Xml.XPath.XPathException: Expression must evaluate to a node-set.

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:

BR
Medo

 

 

You must be logged in to post in the forum