This is a migrated thread and some comments may be shown as answers.

[Solved] telerik and mvc3

4 Answers 830 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Daniel
Top achievements
Rank 1
Daniel asked on 21 Oct 2010, 02:38 PM
Hi,

just wanted to post my experience trying to get the telerik components running in a mvc3 project.
Perhaps some of you won't run in trouble and experiencing the same problems.

I tried two days to get the grid running in my project but it failed all the time with strange errors like System.ArrayTypeMismatchException when the StyleSheetRegistrar or ScriptRegistrar was called.
Including the scripts and queries manually resultet in many many other failures.

After some time i createt a brand new MVC3 project and tada - it worked!
Regarding the configs i found out that the web.config of my project contained following entries:

 

 

 

 

<dependentAssembly>
  <assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
  <bindingRedirect oldVersion="1.0.0.0" newVersion="2.0.0.0" />
</dependentAssembly>
<dependentAssembly>
  <assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
  <bindingRedirect oldVersion="2.0.0.0" newVersion="3.0.0.0" />
</dependentAssembly>

These entries have been created by a converter (MvcAppConverter) when i converted my MVC2 project into a MVC3 project (quiet a time ago).

In order to get telerik for mvc working change these entries:

 

 

 

 

 

 

 

 

<dependentAssembly>
  <assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
  <bindingRedirect oldVersion="1.0.0.0-2.0.0.0" newVersion="3.0.0.0" />
</dependentAssembly>

 


With this setup in the web.config the tools are instantly working!
Hopefully this information can help some others ;-)

Daniel

 

 

 

 

 

4 Answers, 1 is accepted

Sort by
0
Erik
Top achievements
Rank 2
answered on 30 Nov 2010, 05:22 PM
Thanks Daniel, that was verry helpfull!

Telerik: I read that the new release was MVC 3 ready? When I create a new MVC 2 application, and I right click on my project, i see:
"Telerik MVC UI Extentions" > "Convert to Telerik MVC application"

When I create a new MVC 3 application and I do the same, I see "Convert to Telerik Webapplication"! 

Erik
0
Erik
Top achievements
Rank 2
answered on 30 Nov 2010, 06:18 PM
Also, and maybe as a result of, combining with framework 4 is a problem.

I'm using VS2010, create new project and choose Telerik MVC project. When you open the site.master (in Views\Shared) you see an error 'Telerik' is not a member of 'System.Web.Mvc.HtmlHelper(Of Object)'

so, I'm surmising that MVC3 and/or framework 4 is not supported yet?
0
Atanas Korchev
Telerik team
answered on 01 Dec 2010, 08:18 AM
Hello Proovit,

 I am attaching a sample project showing how to use Telerik Extensions for ASP.NET MVC in a .NET 4 ASP.NET MVC 3 RC application.

Regards,
Atanas Korchev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Håvard
Top achievements
Rank 1
answered on 01 Dec 2010, 05:11 PM

I'm getting an similar error

 'System.Web.Mvc.HtmlHelper<dynamic>' does not contain a definition for 'Telerik' and no extension method 'Telerik' accepting a first argument of type 'System.Web.Mvc.HtmlHelper<dynamic>' could be found (are you missing a using directive or an assembly reference?)

Created an Mvc 3 rc1 project

Added reference to Telerik.Web.Mvc version 2010.3.1110.235

added <add namespace="Telerik.Web.Mvc.UI" /> to web.config

copied javascript and css files to project

do you have a project example with the newest mvc version and using razor view engine?

EDIT: never mind, I just needed @using Telerik.Web.Mvc.UI line on the page

Tags
General Discussions
Asked by
Daniel
Top achievements
Rank 1
Answers by
Erik
Top achievements
Rank 2
Atanas Korchev
Telerik team
Håvard
Top achievements
Rank 1
Share this question
or