none
MVC 3 killed VS web preview

    Question

  • I install the MVC 3 and am now getting this lovely error when I try to view webpages.  Any suggestion of where it went and why it is gone and how to get it back?

    Could not load file or assembly 'Microsoft.VisualStudio.Web.Runtime, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.


    John J. Hughes II
    www.functioninternational.com
    Thursday, September 15, 2011 9:08 PM

Answers

  • Hi all,

    I uninstalled Page Inspector and it fixed the problem.

    Best luck,
    Yevgen Polyak


    • Edited by Yevgen Polyak Saturday, September 17, 2011 6:13 AM
    • Proposed as answer by waituk Saturday, September 17, 2011 7:49 AM
    • Marked as answer by Alexander Sun Tuesday, September 20, 2011 10:35 AM
    Saturday, September 17, 2011 6:13 AM
  • We've investigated and found out that installing Page Inspector on Visual Studio 2010 (RTM or SP1) will cause this problem. Page Inspector is only supported on the Visual Studio 11 Developer Preview, because it requires new components that only exist in ASP.NET 4.5. Page Inspector's installer is supposed to block if you don't have the Developer Preview installed, but apparently that's not happening.

    In the meantime, uninstalling Page Inspector is the correct workaround. It won't do anything for Visual Studio 2010, anyway.

    If you have the Developer Preview installed and still run into this problem, please contact us again.

    Thanks,

    Joe Davis
    jodavis@microsoft.com

     

    • Marked as answer by Alexander Sun Tuesday, September 20, 2011 10:35 AM
    Monday, September 19, 2011 8:57 PM

All replies

  • Well after uninstalling and reinstalling and a bunch of other things I removed the following line of code from the web.config file and it went back to working.  Not sure why it was added and what it is suppose to do but it does not work on my system :(

    <add assembly="Microsoft.VisualStudio.Web.Runtime, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />


    John J. Hughes II
    www.functioninternational.com
    Friday, September 16, 2011 1:04 AM
  • I'm having the exact problem, but my web.config doesn't have the line "add assembly..." line.  Any ideas?
    • Edited by kent mead Friday, September 16, 2011 9:21 PM
    Friday, September 16, 2011 9:18 PM
  • Hi,

    Why no one is in not giving any solution for this issue.

    Is this that much difficult one.

     

    • Proposed as answer by Yevgen Polyak Saturday, September 17, 2011 6:06 AM
    • Unproposed as answer by Yevgen Polyak Saturday, September 17, 2011 6:07 AM
    Saturday, September 17, 2011 3:26 AM
  • Hi all,

    I uninstalled Page Inspector and it fixed the problem.

    Best luck,
    Yevgen Polyak


    • Edited by Yevgen Polyak Saturday, September 17, 2011 6:13 AM
    • Proposed as answer by waituk Saturday, September 17, 2011 7:49 AM
    • Marked as answer by Alexander Sun Tuesday, September 20, 2011 10:35 AM
    Saturday, September 17, 2011 6:13 AM
  • Yevgen Polyak - you are spot on buddy - I was having the same issue and after reinstalling it multiple times and trying various other stuff - I was kind of going to do (God knows what - I have no idea) - but I uninstalled the Page Inspector and Bingo!!!

     

    So thank you for saving the day!

     

    Regards

     

    Sanjeev

    Saturday, September 17, 2011 7:34 AM
  • Worked for me too.

    It took me awhile to find it in my Add/Remove Programs (too much stuff in there!)

    In Add/Remove Programs for me it was called 'Microsoft Page Inspector - Visual Studio vNext'


    Travis Wright Senior Program Manager Microsoft
    Saturday, September 17, 2011 11:24 PM
  • I will praise you forever!  I struggled whole weekend for this and this is posted!  Inspector is the problem!!!
    Monday, September 19, 2011 9:39 AM
  • What is your computer configuration and what other VS features did you install besides the CTP? I'd like to help you figure out why this happened and provide a fix without having to uninstall the page inspector.

     

    Jorge Gabuardi

    jorge.gabuardi@microsoft.com

    Monday, September 19, 2011 7:28 PM
  • We've investigated and found out that installing Page Inspector on Visual Studio 2010 (RTM or SP1) will cause this problem. Page Inspector is only supported on the Visual Studio 11 Developer Preview, because it requires new components that only exist in ASP.NET 4.5. Page Inspector's installer is supposed to block if you don't have the Developer Preview installed, but apparently that's not happening.

    In the meantime, uninstalling Page Inspector is the correct workaround. It won't do anything for Visual Studio 2010, anyway.

    If you have the Developer Preview installed and still run into this problem, please contact us again.

    Thanks,

    Joe Davis
    jodavis@microsoft.com

     

    • Marked as answer by Alexander Sun Tuesday, September 20, 2011 10:35 AM
    Monday, September 19, 2011 8:57 PM
  • Yes, After uninstalling Page Inspector it works. thx
    Thanks Rajakumar Selvaraj Application Server Engineer
    Wednesday, September 21, 2011 10:10 AM
  • Hey, How I can Uninstall Page Inspector

    • Edited by Kerwin Arias Wednesday, September 21, 2011 3:19 PM
    Wednesday, September 21, 2011 3:18 PM
  • look into your installed software.

    Order the installed software by name (by clicking on name in the header)

    Navigate down to Page Inspector

    Rightclick and uninstall

    Thursday, September 22, 2011 6:40 PM
  • There is not writting Page Inspector in installed software. But in visual studio 2010 I can see for Page Inspector is installed. How can i uninstall?
    Friday, September 30, 2011 12:01 PM
  • If you have downloaded/installed from this link

    Download through the Web Platform Installer - http://go.microsoft.com/fwlink/?LinkID=227946

    then you will have page inspector in your software list. If you have a windows 7 machine just type "page inspector" it into the search field.

    If nothing is found then it should not be there.

     

    Good luck

    Friday, September 30, 2011 8:20 PM
  • We've investigated and found out that installing Page Inspector on Visual Studio 2010 (RTM or SP1) will cause this problem. Page Inspector is only supported on the Visual Studio 11 Developer Preview, because it requires new components that only exist in ASP.NET 4.5. Page Inspector's installer is supposed to block if you don't have the Developer Preview installed, but apparently that's not happening.

    In the meantime, uninstalling Page Inspector is the correct workaround. It won't do anything for Visual Studio 2010, anyway.

    If you have the Developer Preview installed and still run into this problem, please contact us again.

    Thanks,

    Joe Davis
    jodavis@microsoft.com

     

    So, if you've investigated and found Page Inspector to be the problem in 4.0, why is it still included in the download? Why does MS want to cause people problems by leaving it in there? How hard could it be for MS to remove it from the download package?
    Sunday, October 02, 2011 1:33 PM
  • It works! To unisntall Page Inspector and fix the problem, I believe your post here is the most detailed and helpful one for me, maybe also for others. Thanks.

    Monday, October 03, 2011 3:44 PM
  • Thanks :after Unstalling "microsoft page inspectator " Its Works. its help me lot.

     

    Control Panel-> add and remove ->microsoft page inspectator ->click uninstall

    Tuesday, October 04, 2011 9:19 AM
  • Same problem here. Uninstalled page inspector and solved the problem.
    Adelino Araujo
    • Proposed as answer by Lou Mateo Thursday, October 13, 2011 8:16 PM
    Monday, October 10, 2011 6:56 PM
  • "Ditto" it works...

    Luo Mateo

    Thursday, October 13, 2011 8:17 PM
  • In IIS 7, goto  yourSite > Asp.net > .Net Compilation > General > Assemblies. Find and remove the reference to this dll. Click "Apply", and you are done ! Let me know if it works for you as well.
    • Proposed as answer by Sharon Talbot Tuesday, August 21, 2012 2:20 AM
    Tuesday, November 08, 2011 8:03 PM
  • It seems that you need to remove the dll reference by adding below to your web.config:

    <remove assembly="Microsoft.VisualStudio.Web.Runtime, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />

    or view this page to check the full web.config for your case.

    H2.

    Friday, March 16, 2012 9:22 AM
  • This problem also occurred for me with the RTM of Visual Studio 2012 on Windows 8.  codeNovice's solution worked for me. Thanks, I had been searching for most of a day.

    I suspect it may have something to do with installing Visual Studio 2010 as well? In any case, this only occurred some of the "Server.Execute" calls in my site, not all.  Partial stack trace is below.


    Length cannot be less than 0 or exceed input length.
    Parameter name: length

    Stack Trace:
    [ArgumentOutOfRangeException: Length cannot be less than 0 or exceed input length.
    Parameter name: length]
       System.Text.RegularExpressions.Regex.Run(Boolean quick, Int32 prevlen, String input, Int32 beginning, Int32 length, Int32 startat) +6697802
       System.Text.RegularExpressions.Regex.Match(String input, Int32 beginning, Int32 length) +48
       Microsoft.VisualStudio.Web.PageInspector.Runtime.WebForms.LiteralWithCommentsHelper.FindComments(String source, Int32 sourceStart, Int32 sourceEnd) +83
       Microsoft.VisualStudio.Web.PageInspector.Runtime.WebForms.SelectionMappingParseRecorder.PostProcessBlockList() +325
       Microsoft.VisualStudio.Web.PageInspector.Runtime.WebForms.SelectionMappingParseRecorder.BuildBlockList(ControlBuilder root) +105
       Microsoft.VisualStudio.Web.PageInspector.Runtime.WebForms.SelectionMappingParseRecorder.ParseComplete(ControlBuilder root) +95

    Tuesday, August 21, 2012 2:20 AM
  • Hello Sharon,

    Could you please provide more info on what you installed in your machine when you started seeing that issue? For instance:

    • Did you install VS 2012 first?
    • Did you see the issue with only VS 2012 installed?
    • Was VS 2010 installed first?

    I could def help you with this issue if you can help me narrow down. 

    Cheers,

    Jorge


    Tuesday, August 21, 2012 3:29 PM
  • Hi JorgeGabuardi,

    • Did you install VS 2012 first?

    I installed VS2012 first, and VS2010 immediately after.  Then I installed MVC3 Tools update for VS2010.

    • Did you see the issue with only VS 2012 installed?

    I didn't use VS2012 until I had both installed so I could make sure roundtripping our solutions worked for the rest of the team, so I don't know if it occurs with only VS2012 installed.

    • Was VS 2010 installed first?

    As earlier, no.  VS2012 was installed first.

    Tuesday, August 21, 2012 5:55 PM
  • Thanks for your reply Sharon. Can you please send me an email at jorge.gabuardi@microsoft.com to follow up offline? When we figure out the issue I can reply to the thread with the solution. 

    We have a couple of ideas about what could've happened, but I'd like to work this out over email. 

    Thursday, August 23, 2012 6:02 PM
  • We have the exact same error (exactly Sharons stack trace) on three different machines that all installed Visual Studio 2012 after everything else. Did you find any solution to the problem? I have searched Stack Overflow and beyond but cannot find a solution to this yet. It seems to have to do with pages that has server side includes that in turn have <% Response.Write(...) %> stuff in them... but seems to also be dependent upon the total size of the pages.
    Wednesday, November 28, 2012 3:25 PM
  • So, this seems to be a bug in Microsoft Page Inspector. Here is some insight to how you can reproduce the error:

    http://stackoverflow.com/questions/12629991/asp-net-webforms-length-cannot-be-less-than-0-or-exceed-input-length-on-appli

    You can tell VS2012 to use Page Inspector instead of Chrome/IE/Firefox when debugging web sites. However, I do not understand why the Page Inspector is involved when I have chosen not to use it, but it is there. To us, it causes both the call stack that Sharon above has. It also causes HTML documents to be clipped half way through.

    The best solution I have found is to disable the Page Inspector by removing its assembly, in web.config:

        <compilation defaultLanguage="c#" debug="true" targetFramework="4.0">
          <assemblies>
            <remove assembly="Microsoft.VisualStudio.Web.PageInspector.Loader, Version=1.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
          </assemblies>
        </compilation>
    

    • Proposed as answer by Sharon Talbot Wednesday, February 06, 2013 12:50 AM
    Thursday, November 29, 2012 9:32 AM
  • Another solution would be

    Getting into a text editor with administrator privilege and change the web.config file in the directory

      C: \ Windows \ Microsoft.NET \ Framework \ v4.0.30319 \ Config \

    remove the line
                     <add assembly="Microsoft.VisualStudio.Web.PageInspector.Loader, Version=1.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />

    in my case the inspector is not there in the list to uninstall
    Saturday, December 14, 2013 7:52 PM