locked
Visual Studio Error - VS 2012 Pro RRS feed

  • Question

  • The other day, I started to get this error with the first page I load upon starting a new instance of Visual Studio:
    466 ERROR System.ArgumentException: Value does not fall within the expected range. at System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode, IntPtr errorInfo) at System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(Int32 errorCode) at Microsoft.VisualStudio.Web.HTML.Implementation.Chrome.ColorStorage.GetColor(Guid category, String group) at Microsoft.VisualStudio.Web.HTML.Implementation.Chrome.ControlChrome.ControlContainer..ctor() at Microsoft.VisualStudio.Web.HTML.Implementation.Chrome.ControlChrome.ShowMarker() at Microsoft.VisualStudio.Web.HTML.Implementation.Chrome.ControlChrome.OnSelectionChanged(Object sender, EventArgs e) at Microsoft.VisualStudio.Web.HTML.Implementation.Chrome.ChromeSelection.FireSelectionChanged() at Microsoft.VisualStudio.Web.HTML.Implementation.Chrome.ChromeSelection.SetCaretPosition(Int32 pos) at Microsoft.VisualStudio.Web.HTML.Implementation.Chrome.ControlChrome.OnCaretPositionChanged(Object sender, CaretPositionChangedEventArgs e) at Microsoft.VisualStudio.Text.Utilities.GuardedOperations.RaiseEvent[TArgs](Object sender, EventHandler`1 eventHandlers, TArgs args) Editor or Editor Extension 2013/09/17 20:47:47.360

    I am trying to Bing this but not finding the cause yet or how to fix it but it seems to be messing up my "color coding" for things like regions, object names, etc.  I can still use Visual Studio, but you lose some of those basic things you just get used to seeing. 

    Anyone have an idea on how to fix this or what is causing it?
    Tuesday, September 17, 2013 8:58 PM

Answers

All replies

  • Hi OzTheGreatAndPowerful,

    Since this forum is to discuss the Visual Studio WPF/SL Designer, Visual Studio Guidance Automation Toolkit, Developer Documentation and Help System, and Visual Studio Editor.

    Just to make this issue clearly, do you mean that you get the error when you run an app? If so, which kind of app are you running, an ASP.NET web app or others?

    If you run your app in other VS Environment, does it work well? If the app works well in other machine, so we could make sure that it will be related to this specific VS environment, but if it has the same issue, I’m afraid that it would be the app issue, if we could make sure that it is the specific app issue, I suggest you post this issue to the development forum, for example, if it is the web app, the ASP.NET forum will be better for this issue: http://forums.asp.net. You could debug your app with breakpoints, and get more useful information.

    But if it is not the app issue, I’m afraid that we could check the VS setup. For example, please install the VS2012 update3.

    System.ArgumentException: Value does not fall within the expected range.

    Like the above error message, I’m afraid that it will be related to app code.

    Reference:

    http://msdn.microsoft.com/en-us/library/system.argumentexception.aspx

    If I have misunderstood anything, please make free feel to let me know.

    Have a nice day,


    Jack Zhai[MSFT]
    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support
    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    Thursday, September 19, 2013 6:07 AM
  • The error isn't a result of any specific code, but inside visual studio itself.  Here are the steps I do to produce the error:

    1).  Open an instance of Visual Studio

    2).  Open a coding file

    3).  Click anywhere inside the .aspx file

    4).  An error pops up saying:  "An exception has been encountered.  This may be caused by an extension.  You can get more information by examing the file 'C:\Users\User1\AppData\Roaming\Microsoft\VisualStudio\11.0\ActivityLog.xml"

    What I posted above is the error message inside the ActivityLog.xml file

    I do not think this is related anything coding wise, but an issue with Visual Studio itself as it occurs everytime I do the above steps.  I do not have to compile anything, modify / insert a line of code.  I am not trying to run / debug any code.  Simply a mouse click inside causes it to occur.

    Thursday, September 19, 2013 11:11 AM
  • Hi OzTheGreatAndPowerful,

    Thanks for your response.

    Just to make this issue clearly, do you get this issue if you just create a simple web project?

    4).  An error pops up saying:  "An exception has been encountered.  This may be caused by an extension.  You can get more information by examing the file 'C:\Users\User1\AppData\Roaming\Microsoft\VisualStudio\11.0\ActivityLog.xml"

    Based on the error message, it seems that you installed an extension tool in your VS IDE, and I doubt that it will be related to your extension tool, maybe you could disable/remove it, and then create a simple app, check it again. If you have to install an extension tool and develop an app, maybe you could re-install it again.

    Run this command and check if VS starts

    devenv.exe /safemode.

    Please also run your VS as the admin, check it.

    I found some threads about the similar issue, if possible, you could refer them, hope it could help.

    http://social.msdn.microsoft.com/Forums/vstudio/en-US/e8bff40b-55c3-4a09-8700-ad508fc56687/vs-2012-an-exception-has-been-encountered-this-may-be-caused-by-an-extension

    http://connect.microsoft.com/VisualStudio/feedback/details/783504/an-exception-has-been-encountered-this-may-be-caused-by-an-extension-visual-studio-you-can-get-more-information-by-examining-the-file-c-users-appdata-roaming-microsoft-visualstudio-11-0-acti

    Best Regards,


    Jack Zhai[MSFT]
    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support
    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    Friday, September 20, 2013 5:50 AM