Completed
Last Updated: 20 Jan 2021 12:21 by ADMIN
Stacy
Created on: 03 Apr 2019 21:42
Category: UI for ASP.NET MVC
Type: Bug Report
3
Telerik UI ASP.NET MVC Visual Studio Extension

Using Visual Studio Enterprise 16.0.0.

Created MVC Project 4.6.1

Run Telerik utility to "Convert to Telerik Web Application" from Project context menu. On a clean project just created from the VS Template.

 

Error output from from Telerik VSX:


An error occurred while running the wizard.

 

Error executing custom action Telerik.KendoUI.Mvc.VSX.Actions.UpdateWebConfigAction: Could not instantiate a TextTransformation object from the compiled assembly. The following Exception was thrown:

System.InvalidCastException: Unable to cast object of type 'Microsoft.VisualStudio.TextTemplating1fd31dc42b754a598ac1cf6e6d72e8f7.GeneratedTextTransformation' to type 'Microsoft.VisualStudio.TextTemplating.TextTransformation'.

   at Microsoft.VisualStudio.TextTemplating.TransformationRunner.CreateTextTransformation(String fullClassName, ITextTemplatingEngineHost host, Assembly assembly, ITextTemplatingSession userSession)
Web.config as generated by VS 2019 MVC project Template


<?xml version="1.0" encoding="utf-8"?>
<!--
  For more information on how to configure your ASP.NET application, please visit
  https://go.microsoft.com/fwlink/?LinkId=301879
  -->
<configuration>
  <appSettings>
    <add key="webpages:Version" value="3.0.0.0"/>
    <add key="webpages:Enabled" value="false"/>
    <add key="ClientValidationEnabled" value="true"/>
    <add key="UnobtrusiveJavaScriptEnabled" value="true"/>
  </appSettings>
  <system.web>
    <compilation debug="true" targetFramework="4.6.1"/>
    <httpRuntime targetFramework="4.6.1"/>
    <authentication mode="Windows"/>
    <authorization>
      <deny users="?"/>
    </authorization>
  </system.web>
  <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="Antlr3.Runtime" publicKeyToken="eb42632606e9261f"/>
        <bindingRedirect oldVersion="0.0.0.0-3.5.0.2" newVersion="3.5.0.2"/>
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="System.Web.Optimization" publicKeyToken="31bf3856ad364e35"/>
        <bindingRedirect oldVersion="0.0.0.0-1.1.0.0" newVersion="1.1.0.0"/>
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="WebGrease" publicKeyToken="31bf3856ad364e35"/>
        <bindingRedirect oldVersion="0.0.0.0-1.6.5135.21930" newVersion="1.6.5135.21930"/>
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed"/>
        <bindingRedirect oldVersion="0.0.0.0-11.0.0.0" newVersion="11.0.0.0"/>
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="System.Web.Helpers" publicKeyToken="31bf3856ad364e35"/>
        <bindingRedirect oldVersion="0.0.0.0-3.0.0.0" newVersion="3.0.0.0"/>
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35"/>
        <bindingRedirect oldVersion="0.0.0.0-5.2.7.0" newVersion="5.2.7.0"/>
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="System.Web.WebPages" publicKeyToken="31bf3856ad364e35"/>
        <bindingRedirect oldVersion="0.0.0.0-3.0.0.0" newVersion="3.0.0.0"/>
      </dependentAssembly>
    </assemblyBinding>
  </runtime>
  <system.codedom>
    <compilers>
      <compiler language="c#;cs;csharp" extension=".cs"
        type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.CSharpCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
        warningLevel="4" compilerOptions="/langversion:default /nowarn:1659;1699;1701"/>
      <compiler language="vb;vbs;visualbasic;vbscript" extension=".vb"
        type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.VBCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
        warningLevel="4" compilerOptions="/langversion:default /nowarn:41008 /define:_MYTYPE=\&quot;Web\&quot; /optionInfer+"/>
    </compilers>
  </system.codedom>
</configuration>

Attached Files:
2 comments
ADMIN
Nikola
Posted on: 10 Apr 2019 13:23
Hello Stacy,

I regret to hear that you have encountered difficulties with our extensions for Visual Studio and at the same time I am glad that you were able to find a solution.

There was a problem with the first release of the Telerik UI for ASP.NET MVC VSExtension we made last week. We have deployed a fix on the next day (version 2019.2.404), therefore I suggest that you update the VSExtension and then try to convert a project again. To do that please:

1. Launch Visual Studio 2019
2. Select Extensions > Manage Extensions
3. Select Updates

You should see Telerik ASP.NET MVC VSExtensions with the option to Update it. 

Try to convert a project again afterwards and get back to us with more information as to what was the outcome. I am looking forward to your reply.

Regards,
Nikola
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Stacy
Posted on: 04 Apr 2019 21:38

Manually edited the ../Views/Web.config adding Kendo.MVC.UI namespace reference seems to have fixed the project where the VS Extension failed.

 

Added: <add namespace="Kendo.Mvc.UI" />

 To:

 

<system.web.webPages.razor>
    <host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=5.2.7.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
    <pages pageBaseType="System.Web.Mvc.WebViewPage">
      <namespaces>
        <add namespace="System.Web.Mvc" />
        <add namespace="System.Web.Mvc.Ajax" />
        <add namespace="System.Web.Mvc.Html" />
        <add namespace="System.Web.Optimization"/>
        <add namespace="System.Web.Routing" />
        <add namespace="ASOVTC.Internal.Web" />
<add namespace="Kendo.Mvc.UI" />
      </namespaces>
    </pages>
  </system.web.webPages.razor>

 

Also added to the application level Web.config

 

<system.web>
    <compilation debug="true" targetFramework="4.6.1" />
    <httpRuntime targetFramework="4.6.1" />
    <authentication mode="Windows" />
    <authorization>
      <deny users="?" />
    </authorization>
    <pages>
      <namespaces>
        <add namespace="Kendo.Mvc.UI" />
      </namespaces>
    </pages>
  </system.web>