none
"Value does not fall within the expected range." Design View / Settings File Error RRS feed

  • Question

  • I'm using VS 2008 SP1 for a Winforms project targeting .NET Framework 3.5.  A particular form will compile and run just fine.  However, if you try to open it in the design view, you get the cryptic error: "Value does not fall within the expected range."  When I click to view the call stack, I get the even more cryptic:

    "at Microsoft.VisualStudio.Editors.SettingsDesigner.DesignTimeSettings.Add(DesignTimeSettingInstance Instance, Boolean MakeNameUnique)
    at Microsoft.VisualStudio.Editors.SettingsDesigner.AppConfigSerializer.Deserialize(DesignTimeSettings Settings, SettingsTypeCache typeCache, SettingsValueCache valueCache, String SectionName, DocData AppConfigDocData, MergeValueMode mergeMode, IUIService UIService)
    at Microsoft.VisualStudio.Editors.SettingsGlobalObjects.SettingsFileGlobalObject.LoadSettings(String fileName)
    at Microsoft.VisualStudio.Editors.SettingsGlobalObjects.SettingsFileGlobalObject.BuildType()
    at Microsoft.VisualStudio.Editors.SettingsGlobalObjects.SettingsFileGlobalObject.GetObjectType()
    at Microsoft.VisualStudio.Shell.Design.GlobalType.get_ObjectType()
    at Microsoft.VisualStudio.Shell.Design.GlobalObject.GetHashCode()
    at Microsoft.VisualStudio.Shell.Design.GlobalObjectService.GlobalKey.GetHashCode()
    at System.Collections.Generic.ObjectEqualityComparer`1.GetHashCode(T obj)
    at System.Collections.Generic.Dictionary`2.FindEntry(TKey key)
    at Microsoft.VisualStudio.Shell.Design.GlobalObjectService.GetGlobalObjects(Type baseType)
    at Microsoft.VisualStudio.Shell.Design.GlobalObjectService.GetGlobalObjects()
    at Microsoft.VisualStudio.Design.Serialization.CodeDom.AggregateTypeResolutionService.GetTypeFromGlobalObjects(String name, Boolean throwOnError, Boolean ignoreCase)
    at Microsoft.VisualStudio.Design.Serialization.CodeDom.AggregateTypeResolutionService.GetType(String name, Boolean throwOnError, Boolean ignoreCase)
    at Microsoft.VisualStudio.Design.Serialization.CodeDom.AggregateTypeResolutionService.GetType(String name, Boolean throwOnError)
    at System.ComponentModel.Design.Serialization.CodeDomSerializerBase.GetType(ITypeResolutionService trs, String name, Dictionary`2 names)
    at System.ComponentModel.Design.Serialization.CodeDomSerializerBase.FillStatementTable(IDesignerSerializationManager manager, IDictionary table, Dictionary`2 names, CodeStatementCollection statements, String className)
    at System.ComponentModel.Design.Serialization.TypeCodeDomSerializer.Deserialize(IDesignerSerializationManager manager, CodeTypeDeclaration declaration)
    at System.ComponentModel.Design.Serialization.CodeDomDesignerLoader.PerformLoad(IDesignerSerializationManager manager)
    at Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomDesignerLoader.PerformLoad(IDesignerSerializationManager serializationManager)
    at System.ComponentModel.Design.Serialization.BasicDesignerLoader.BeginLoad(IDesignerLoaderHost host)"

    I look at the Settings tab in the project's property page, and it only has a repeat stating "Value does not fall within the expected range."  The few "solutions" I've found don't help at all.  Restarting the IDE doesn't work.  Rebuilding the project doesn't work.  Deleting the bin and obj directories doesn't help.  Does anyone have a valid idea of how to fix this?  It's rather hard to develop a Windows form when you can't view it.


    Jason the Mason
    Monday, April 5, 2010 4:15 PM

Answers

  • Seeing that nobody "official" actually seemed to look, or care about this particular problem, I thought I'd post the solution I found.  It seems that the settings file had become "corrupted" (for lack of a better word).  I deleted the "Settings.settings" file from the project, and the error dissapeared.
    Jason the Mason
    Monday, April 5, 2010 6:02 PM

All replies

  • Seeing that nobody "official" actually seemed to look, or care about this particular problem, I thought I'd post the solution I found.  It seems that the settings file had become "corrupted" (for lack of a better word).  I deleted the "Settings.settings" file from the project, and the error dissapeared.
    Jason the Mason
    Monday, April 5, 2010 6:02 PM
  • Hi Jason.  I ran into the same problem today - different call stack, but identical error message.  I was able to see the form a couple of days ago, but no longer.  I am running the same software/service pack, but I don't seem to have a Settings.settings file anywhere, nor do I have any file containing the string "settings" in my working directories, or in the software installation directory under Program Files.  It seems that you have the right idea here; maybe I just need to find the right file to delete.

    Thanks for posting your answer.  It was helpful.

     - Barry Reich

    • Proposed as answer by Imp314 Thursday, May 13, 2010 9:18 PM
    • Unproposed as answer by Jasonthemasonkcch Monday, June 14, 2010 6:35 PM
    Thursday, May 13, 2010 9:02 PM
  • Oops, I didn't mean to propose that as an answer, and I don't see a way to undo that action.

    Here is my answer:  I had to do the same thing that Jason did to solve the problem, except that where he deleted "Settings.settings", I had to delete "<Project Name>.suo" (Visual Studio Solution User Options file).  Visual Studio will recreate this file, but will do so correctly, thus eliminating the error.

    Thursday, May 13, 2010 9:23 PM
  • Hi Imp314,

    That pointed me in the right direction.

    I deleted the projects user options file ("myproject.csproj.user" ) rather than the solutions user options file and all was well.

    Thanks for the info

    Stu.

    • Proposed as answer by nikka9 Monday, December 27, 2010 3:34 PM
    Wednesday, July 28, 2010 7:42 AM
  • Thanks everybody, OnlyStu's suggestion solved my problem too (I also had different call stack, but identical error message)

    So try deleting user options file ("myproject.csproj.user") if you have this problem

    thanks!

    Monday, December 27, 2010 3:35 PM
  • So simple, but worked great. Thanks!

    Afterwards a new settings file can easily be added in the project properties.

    Sunday, January 30, 2011 8:26 PM
  • great! I deleted .suo, and it worked for me.
    Friday, September 23, 2011 3:37 AM
  • Deleting the .suo file did the trick... thanks m8!
    • Proposed as answer by spencepk Saturday, September 27, 2014 10:08 PM
    • Unproposed as answer by spencepk Saturday, September 27, 2014 10:09 PM
    Saturday, September 27, 2014 10:08 PM
  • Closing and reopening the solution did the trick for me.

    (Visual Studio Professional 2013)


    Andrea Antonangeli --- Octet - Ingegneria dei Sistemi - S.r.l. --- Milano (Italy) --- octet.it

    Tuesday, October 14, 2014 5:13 PM
  • I think most of the previous answers work because I had a similar challenge today after editing the ConnectionString of my DataSet and could not open it in design view. I only deleted the .vbproj.user file and restarted the application and it now working fine.
    Saturday, November 15, 2014 11:27 PM
  • Deleting the project user options file worked for me, thanks
    • Edited by Paul Hulley Monday, December 19, 2016 10:02 AM
    Monday, December 19, 2016 10:02 AM
  • I ran into this as well. I was able to fix it by closing all my open tabs (30-40) except for Source Control Explorer, restart, clean/rebuild and then open the UI file again without error. 

    Alex

    Wednesday, April 26, 2017 12:28 AM
  • Everybody seems to be deleting something. Well, I couldn't find any of the files being referenced. On the other hand, I did close the Solution Explorer, re-opened it, and the error disappeared.
    Monday, July 10, 2017 6:44 PM
  • where is the project user options file located?

    Tuesday, July 11, 2017 4:11 PM
  • Deleting the .suo file solved it for me.  Thank you.

    dms

    Thursday, October 19, 2017 9:33 PM
  • Thank you very much.That worked :p

    Saturday, March 24, 2018 8:15 AM
  • Yes, deleting the file "myproj.vbproj.user" (or csproj.user" if you are compiling in C#) is the way to go.
    The "myproj" component of course may be the name of your project if you ahe actually given the project
    a name rather than using the default "MyProj".

    I found I had to force the DevEnv.exe program (the programming interface) to close. When I restarted
    the VStudio program, and opened the project, the system rebuilt the project file and the problem was fixed.

    Sunday, July 15, 2018 4:10 PM
  • I deleted the same file and it now works, thanks!

    Derek Geldart

    Wednesday, June 26, 2019 11:32 AM
  • Thanks for the help this fixed my problem

    Wednesday, January 22, 2020 6:14 PM