none
Visual Studio 2015 MVC 5 web application error when adding empty controller scaffold

    Question

  • I am using VS 2015 Enterprise Update 2.  I created a new empty MVC web application.  In the Controllers folder I try to add a new Controller (Add-> Controller...).  The Add Scaffold window opens I select "MVC 5 Controller - Empty" click Add and then I get the error "There was an error running the selected code generator: 'Failed to render template because of the following errors: Compiling transformation: Missing compiler required member 'System.Runtime.ComplierServices.CompilationRelaxationsAttribute.ctor' ..." 

    Here's what I've tried so far:

    - Uninstall-Package EntityFramework -Force

    - Install-Package MvcScaffolding.VS2015

    - I repaired VS (twice)

    Please help!

    Friday, May 20, 2016 6:53 PM

All replies

  • Hi dm1512,

    According to the error message, this problem should be related to the broken templates. Please try restore all templates for Visual Studio with following steps.

    1. In the command prompt, navigate to the location of devenv.exe. This file is located in <Visual Studio Installation Path>\Common7\IDE.
    2. Type "devenv /installvstemplates" and press Enter.

    In addition, please check whether you have installed some third part packages and extensions for your project and Visual Studio, please try run your Visual Studio in safe mode to prevents all third-party VSPackages from loading when Visual Studio starts, thus ensuring stable execution.

    If all above steps can resolve the problem, Please use http://aka.ms/vscollect  to gather the VS and .Net Frameowrk installation logs. After using it, you will find vslogs.cab from %temp% folder. Please upload the file to Onedrive and share the link here.

    Best Regards,
    Weiwei


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Monday, May 23, 2016 3:19 AM
    Moderator
  • Thanks for the reply.  I tried your suggestions and still get the error.  Here's a screenshot of the error also.

    Here's the link to the collected logs.

    https://onedrive.live.com/redir?resid=21C9F37FD24C3F1A!2462&authkey=!AE4dVca_91TzBos&ithint=file%2czip


    • Edited by dm80 Tuesday, May 31, 2016 10:18 PM
    Tuesday, May 31, 2016 10:17 PM
  • Hi dm,

    According to the installation log, there has any installation errors that I quote in below.

    Error 0x80096010: Failed authenticode verification of payload: C:\ProgramData\Package Cache\{ABD37F71-FC3F-F525-C7B3-BDD95F684C51}v10.0.10150\packages\Win10_UniversalCRTSDK\6ee7bbee8435130a869cf971694fd9e2.cab
    Error 0x80096010: Failed to verify signature of payload: cabA99F2C64C2AD25614A846B668357B554
    Failed to verify payload: cabA99F2C64C2AD25614A846B668357B554 at path: C:\ProgramData\Package Cache\{ABD37F71-FC3F-F525-C7B3-BDD95F684C51}v10.0.10150\packages\Win10_UniversalCRTSDK\6ee7bbee8435130a869cf971694fd9e2.cab, error: 0x80096010, delete: Yes

    For this error message, please check whether you have installed the MS Root Certificate Update for your windows, which enables distribution of trusted root certificates within Windows operating systems. Please refer to:

    https://technet.microsoft.com/en-us/library/dn265983.aspx?f=255&MSPPError=-2147217396

    If have installed and after installing the problem still exist, please try download the Visual Studio 2015 ISO installer from below link.

    https://www.visualstudio.com/en-us/downloads/download-visual-studio-vs.aspx

    Then use FCIV.exe http://support.microsoft.com/kb/841290 to verify hash of the ISO. Any discrepancy would indicate that the file was corrupted. The Visual Studio Enterprise 2015 SHA-1 value is B670AFC74F19247ADE5252A79700764BD5A36623.

    Please refer to:

    https://www.visualstudio.com/en-us/downloads/visual-studio-2015-iso-sha1-vs.aspx

    If the SHA-1 value is correct, please use this installer to reinstall your Visual Studio again.

    Best Regards,
    Weiwei


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Wednesday, June 01, 2016 6:04 AM
    Moderator
  • I believe my machine has the MS Root Certificate Update (sorry not sure how to verify) but I went ahead and manually applied the certs using CertUtil command as outline in https://technet.microsoft.com/en-us/library/dn265983.aspx?f=255&MSPPError=-2147217396

    I downloaded Visual Studio Enterprise 2015 with Update 2 ISO from https://www.visualstudio.com/en-us/downloads/download-visual-studio-vs.aspx.  FYI the SHA-1 value is different than the one you posted I got C966B61E4E35210C7C186D4EC1A0450B0A0FBF9C which matches the value posted on https://www.visualstudio.com/en-us/downloads/visual-studio-2015-iso-sha1-vs.aspx.  I uninstalled VS then installed using the above ISO with default installation type.  After successful install I launch VS and tried to reproduce the issue and I still get that same error message.

    Here are the logs:

    https://1drv.ms/u/s!AtH6Rapv0hyab0RfEZQD3TWGAHM


    Thursday, June 02, 2016 7:51 PM
  • Hi dm,

    I find the same installation error in the reinstallation log file. Do you reinstall Visual Studio as administrator? Please run the installer as administrator to make sure it has enough permission to do any operations.

    In addition, the error message is related to the MS Root Certificate Update for your windows. I suggest you restore your Windows to check whether this problem caused by the machine environment. And if there has other machine, please try install your Visual Studio in another machine to check whether this problem still exist.

    Best Regards,
    Weiwei


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Friday, June 03, 2016 2:48 AM
    Moderator