Developer forum

Forum » Development » Dynamicweb.Templatev2.Template is obsolete

Dynamicweb.Templatev2.Template is obsolete

Dmitrij Jazel
Reply
Hi guys,

I am working with dynamicweb 8.0.1.5, can feel it should be quite easy to solve this one.
After I linked to DW 8.0.1.5 application, I could not build, the error says that:
Dynamicweb.Templatev2.Template is obsolete and I should use Dynamicweb.Rendering.Template
Class: Frontend.cs method:
private void ShowElement(Dealer objDealer, Dynamicweb.Templatev2.Template DealerTemplate)
If I change it as it asks, than it misses the definition for 
Database.SQLEscapeInjection
Could you have any hings about this one? What can cause it and what could be the solution?

Kind regards,
Dmitrij


Replies

 
Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply
Hi Dmitrij,

Between version 7.2 and 8, Dynamicweb has made some significant changes in the API. Members have been renamed, hidden, or capitalize correctly. As you found out, the Template class has been moved from the TemplateV2 namespace to the Rendering namespace. The SQLEscapeInjection metoh has been renamed to SqlEscapeInjection to align with naming guidelines.

IntelliSense (for existing members) and the error list (for obsolete or moved typed) usually will help you find the new version. Also, the DW 8 API documentation is a good resource: http://developer.dynamicweb-cms.com/api8/

Hope this helps,

Imar

 
Dmitrij Jazel
Reply
Hej Imar,
Please correct me if I am missing something here
I could feel that the problem is - changes in api, and the fact I am using version 7.2 codebase against dw8 build (this is why it is asking my t).
I was actually following the article from your blog (http://devierkoeden.com/articles/custom-modules-part-1-introduction.aspx) witch I think is pretty cool :-), and there you are covering how can you setup custom modules for dw7, but not for dw8.

I am using CustomModulesCsharp.zip from DW downloads, but that is dw7 cobebase (as I understand). Or it does not matter really much and I am missing something here...

Regards,
Dmitrij

 
Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply
Hi ,

For the DW 8 version of that article series, take a look here: http://developer.dynamicweb-cms.com/documentation/for-developers/dynamicweb-modules/building-modules-series.aspx

Also, be sure to install the latest templates for Visual Studio (http://developer.dynamicweb-cms.com/documentation/for-developers/visual-studio-templates.aspx) and use those project templates for new projects.

Or it does not matter really much and I am missing something here...

It does matter; I don't think the files in the download section have been updated, so you'll get compile errors because of the API changes. The VS templates are the recommended solution as they also target 7.2 and 8 projects separately.

Hope this helps,

Imar
 
Dmitrij Jazel
Reply
Hi again Imar,

Thanks so far :-) I will take a look at it and will come back to you with my findings...

Cheers,
Dmitrij
 
Dmitrij Jazel
Reply
Hi Imar,
Can you please correct me if I am wrong here?

So, as I can see from those resources you send me, you must have Visual Studio templates installed if you want to make any custom modules for DW8. And the Custom Modules zip on the download page fits only to DW7.

But are there any restrictions regarding visual studio and those templates, any of you know? Cause I was trying to install those templates at home on my Visual Web Developer 2010 version, and it did not run. So this means that if you want to make any custom modules for DW8, you must have a Visual Studio 2010 pro (no express version or anything else). Is this correct?

But is this the only way for developers to get into the game, should there be a possibility to use "old approach" if you want to get started with DW8, and let's say use it for educational reasons to start with?

Would be really great to have both options?

Kind regards,
Dmitrij


 
Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply
This post has been marked as an answer
Cause I was trying to install those templates at home on my Visual Web Developer 2010 version
Ah, yes. For some reason, the installer doesn't work for Visual Web Developer Express. It does work on all commercial versions of Visual Studio.

I am attaching the templates for the DW 8 project (VB and C#) to this message. I'll upload them to the Downloads section as soon as possible.

You should drop these files in the custom templates folder for Visual Web Developer (choose Tools | Options | Projects and Solutions to find the exact path to the User project templates location.)

Cheers,

Imar
Votes for this answer: 0
 
Dmitrij Jazel
Reply
Hi Imar,

Thanks alot for the help :-)
It works good (so far) and I think it will...

Kind regards,
Dmitrij
 
Dmitrij Jazel
Reply
Hello Imar,

Sorry for late post, I hope you can help me here.
I used the CustomModulesCS.zip one that you just send me here, I opened it as the project. Changed the code, all build all is fine.. but
After I build, I cannot find the right .dll I must add to bins.
As far as I know, I should get a DLL with Project name after compile. CustomModules.dll
But instead of this dll, I get tons of other DLLs,
And I am pretty sure that if I use dynamicweb.dll located in that compiled bin folder and replace it will brake the solution.
Am I doing something wrong here? how can I locate right dll for this one. As I would expect, it should have gave me CustomModules.dll.

Hope you answer soon,
Kind regards,
Dmitrij
 
Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply
Hi Dmitrij,

Take a look at the Project Properties for the project in VS. You'll see a field for the Assembly Name which is the name of your DLL.

All the other DLL and XML files you have in the Bin folder were pulled in by Visual Studio based on the references to the Dynamicweb.dll you added. Since your VS project is the root of your site, these files need to be in /Bin in order for the site to run under IIS. If you're deploying your DLL to another site, all you need indeed is your custom DLL. However, for debugging purposes it's useful to be able to run your site on your local machine using IIS....

Cheers,

Imar
 
Dmitrij Jazel
Reply
Hello Imar,
Thanks for lightning fast response! :-)
Well it looks like it works now...

BIG thanks again :-) 
Kind regards,
Dmitrij

 

You must be logged in to post in the forum