none
Cannot Open ASP MVC 5 Views in Visual Studio

    Question

  • I have an existing ASP MVC 5 project that I work on almost daily. Starting today, I can no longer open any views in the project. When I attempt to do so, I get an error Object reference not set to an instance of an object.

    To be clear, this happens when trying to edit the View is VS not run it.

    I have work to do.  Any help or suggestions will be greatly appreciated.

    Thanks,

    Glen


    Edit - After doing a "Repair" the problem persists.  A project that I worked with on Friday with no issues, I cannot open any views without the Object reference error.
    Monday, February 01, 2016 8:41 PM

Answers

  • Jack,

    I am using VS2015 Update 1.

    All projects behaved the same way.  I did install a PowerShell update so that may have done it. 

    Apparently there is a problem with the MEF cache in Update 1. An update can corrupt the cache and cause problems. It was suggested that I delete the cache file and try again.  The cache file is in C:\Users\User Name\AppData\Local\Microsoft\VisualStudio\14.0\ComponentModelCache

    By the time that I received this suggestion, I had already uninstalled VS and was installing it again.  As soon as the installation was complete, the project opened and behaved as expected.

    Glen

    • Marked as answer by glenrswanson Tuesday, February 02, 2016 5:07 PM
    Tuesday, February 02, 2016 5:07 PM

All replies

  • Hi Glen,

    Just to make this issue clearly, whether all MVC 5 projects have the same issue or just the specific one?

    If all projects have this issue now, since it worked well before, did you install any add-ins or extension tools? If you run your VS in safe mode, how about the result?

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

    Please also install the VS2015 update 1 if you use the VS2015.

    >>A project that I worked with on Friday with no issues, I cannot open any views without the Object reference error.

    If just the specific app has this issue, create a blank solution, and then add all project files to the new blank solution, clean and rebuild the whole solution, check it again.

    Best Regards,

    Jack


    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.

    Tuesday, February 02, 2016 9:32 AM
    Moderator
  • Jack,

    I am using VS2015 Update 1.

    All projects behaved the same way.  I did install a PowerShell update so that may have done it. 

    Apparently there is a problem with the MEF cache in Update 1. An update can corrupt the cache and cause problems. It was suggested that I delete the cache file and try again.  The cache file is in C:\Users\User Name\AppData\Local\Microsoft\VisualStudio\14.0\ComponentModelCache

    By the time that I received this suggestion, I had already uninstalled VS and was installing it again.  As soon as the installation was complete, the project opened and behaved as expected.

    Glen

    • Marked as answer by glenrswanson Tuesday, February 02, 2016 5:07 PM
    Tuesday, February 02, 2016 5:07 PM
  • Glad to know that you have resolved this issue, Glen:)Thanks for sharing your solution here.

    Have a nice day,

    Jack


    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, February 03, 2016 1:48 AM
    Moderator