Value does not fall within the expected range. RRS feed

  • Question

  • I have the following exception after installing a VSTO add-in

    From: file:///C:/xxx/xxxxxx.vsto

    ************** Exception Text **************
    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.Tools.Office.Runtime.Interop.VSTOEENativeMethods.GetValidCompatibleFramework(String compatibleFrameworkXml)
       at Microsoft.VisualStudio.Tools.Office.Runtime.CompatibleFrameworksValidation.ParseFirstValidFramework(String compatibleFrameworksXml)
       at Microsoft.VisualStudio.Tools.Office.Runtime.OfficeAddInDeploymentManager.OnAddInManifestsDownloaded(AddInManifestsDownloadedArgs args)
       at Microsoft.VisualStudio.Tools.Applications.Deployment.ClickOnceAddInDeploymentManager.RaiseOnAddInManifestsDownloadedEvent(IClickOnceAddInInstaller addInInstaller, Uri deploymentManifestUri, AddInInstallationStatus addinSolutionState, String productName, String deploymentManifestXml, String applicationManifestXml, String hostManifestXml, String logFilePath, String version, Uri supportUri)
       at Microsoft.VisualStudio.Tools.Applications.Deployment.ClickOnceAddInDeploymentManager.InstallAddIn()

    The problem appear only in this kind of situation:

    1. have the Microsoft Visual Studio 2010 Tools for Office Runtime (x64) installed on the machine

    2. install the Microsoft .NET Framework 4.5

    3. install the add-in

    If the step2 and 1 are reversed than the add-in works correctly.

    What could be the problem and how can we avoid it (we can't unistall the VSTO Runtime and installed it again)

    Monday, October 28, 2013 6:35 AM

All replies

  • Hi Dan_1981,

    Thank you for posting in the MSDN Forum.

    I'm trying to involve some senior engineers into this issue and it will take some time.
    Your patience will be greatly appreciated.

    Sorry for any inconvenience and have a nice day!

    Best regards


    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, October 29, 2013 8:33 AM
  • Thank you for taking an interest into this matter. I will wait patiently for an answer.

    Tuesday, October 29, 2013 11:23 AM
  • Hi Dan_1981,

    From the stack trace the issue looks to be of ClickOnce Installation issue.

    - If yes let's Clear ClickOnce Cache through command below 

    Mage.exe –cc (

    I also understand that you are unable to uninstall VSTO runtime.

    - Suggest Uninstalling All .Net Frameworks and install them in the same order as their versions [or Uncheck from 'Turn Windows Features On or Off' and Check the feature back to Install Frameworks]
         - Uninstall VSTO runtime
         - Install latest VSTO Runtime from




    Tuesday, October 29, 2013 6:50 PM
  • The addin was not installed using clickonce so that i don't think that is the problem. Any way we already tried it.

    I did not meant that we can not uninstall the vsto i meant that it is not a solution to uninstall vsto before installing our addin.

    • Edited by Dan_1981 Tuesday, October 29, 2013 7:07 PM
    Tuesday, October 29, 2013 7:06 PM
  • Hi Dan,

    Because of its complexity your question falls into the paid support category which requires a more in-depth level of support.  If the support engineer determines that the issue is the result of a bug the service request will be a no-charge case and you won't be charged. Please visit the below link to see the various paid support options that are available to better meet your needs.;en-us;offerprophone




    Friday, November 15, 2013 10:31 PM