none
VS 2012 WPF Designer gives errormessage: ArgumentException: Value does not fall within the expected range. RRS feed

  • Question

  • We have Visual Studio 2012 update 1 installed on our Windows Server 2008 R2 virtual devmachines.

    We have a C# client(wpf)/server (wcf) solution with devepress and k2 as additional tools. When I open a wpf-file I can see the form for a few seconds in the designer, but when I click on it, it gives an exception. I have also tried to add a new WPF project to our solution with the same result (trying to see if there was a circular reference issue). I have also tried to create a completely new solution with just a WPF project. The same issue occurs. The exception I get is the following:

    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.Shell.Settings.ShellSettingsStore.GetString(String collectionPath, String propertyName)
       at Microsoft.VisualStudio.ExpressionHost.HostServices.HostProject.<>c__DisplayClassd.<get_PreferredFileExtensions>b__c()
       at Microsoft.Expression.DesignHost.Isolation.Remoting.STAMarshaler.Call.InvokeWorker()
       at Microsoft.Expression.DesignHost.Isolation.Remoting.STAMarshaler.Call.Invoke(Boolean waitingInExternalCall)
       at Microsoft.Expression.DesignHost.Isolation.Remoting.STAMarshaler.InvokeCall(Call call)
       at Microsoft.Expression.DesignHost.Isolation.Remoting.STAMarshaler.DirectInvoke(Action action, Int32 sourceApartmentId, Int32 targetApartmentId, Int32 originId, WaitHandle aborted)
       at Microsoft.Expression.DesignHost.Isolation.Remoting.STAMarshaler.DirectInvokeInbound(Action action, Int32 targetApartmentId)
       at Microsoft.Expression.DesignHost.Isolation.Remoting.STAMarshaler.MarshalIn(Action action, Int32 targetApartmentId)
       at Microsoft.Expression.DesignHost.Isolation.Remoting.ThreadMarshaler.MarshalIn(IRemoteObject targetObject, Action action)
       at Microsoft.VisualStudio.ExpressionHost.HostServices.HostProject.get_PreferredFileExtensions()
       at Microsoft.VisualStudio.ExpressionHost.Platform.DefaultCodeBehindResolver.GetCodeBehindInfo(IHostSourceItem documentItem)
       at Microsoft.VisualStudio.ExpressionHost.HostServices.HostCodeService.GetCodeBehindItem(IHostSourceItem item, String typeName)
       at Microsoft.Expression.DesignHost.Isolation.Remoting.RemoteHostCodeService.<>c__DisplayClass5.<Microsoft.Expression.DesignHost.Isolation.Remoting.IRemoteHostCodeService.GetCodeBehindItem>b__4()
       at Microsoft.Expression.DesignHost.Isolation.Remoting.ThreadMarshaler.<>c__DisplayClass16`1.<MarshalIn>b__15()
       at Microsoft.Expression.DesignHost.Isolation.Remoting.STAMarshaler.Call.InvokeWorker()
    In visual studio it looks like this:


    Kjaps


    • Edited by Kjaps Tuesday, January 22, 2013 2:22 PM spelling failures etc.
    Wednesday, December 5, 2012 3:19 PM

Answers

  • We have now located the cause of the issue in our environment. The component that caused the issue is

    K2 for Visual Studio 2012 1.0 (4.12070.1.0)

    When uninstalling this add-on, the exception went away, and we are able to use our designer again. We will pursue this further with K2.


    Kjaps

    • Marked as answer by Kjaps Monday, March 11, 2013 11:22 AM
    Monday, March 11, 2013 11:22 AM
  • I created a support ticket at K2 and after a few days they came up with this solution:

    After the installation of K2 for Visual Studio 2012, use regedit to delete the following keys:

    [HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\11.0_Config\Languages\File Extensions\.kprx]
    [HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\11.0_Config\Languages\File Extensions\.sodx]

    I have tested this a while and XAML designer works as expected with no errors.

    Thank's to K2 for good support!

    MagsForTags

    • Marked as answer by Kjaps Friday, August 2, 2013 9:56 AM
    Thursday, March 21, 2013 1:29 PM

All replies

  • Hi Kjaps,

    Thanks for your post.

    I'm trying to reproduce this issue.

    Can you reproduce this issue after building a new solution and add a new project to that solution?

    Regards,


    Barry Wang
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Thursday, December 6, 2012 5:47 AM
    Moderator
  • Hi Kjaps,

    How is your issue now? Can you provide some details here?

    If you failed again, can you try repair Visual Studio from control panel first?

    Or you can just try uninstall and install VS to see the result.

    Regards,


    Barry Wang
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Wednesday, December 12, 2012 9:39 AM
    Moderator
  • Sorry for not replying, and thank you for checking up on the issue.

    I can reproduse the issue when creating a completely new solution and a new WPF project.

    I have tried repairing Visual Studio, no change. The same issue is for most of the users in our team. I would think that uninstalling and reinstalling will not change anything.

    I begin to believe that this has to be a combination of programs installed that makes Visual Studio misbehave.

    The only issue we had during installation was that we do not have internet connection in our development network, and we got an error when installing (something about web deploy 3.0). I found a KB article where we downloaded a fix that made that error go away.

    From the top of my head, we have the following programs installed on our development machines:

    Window Server 2008 R2 x64 (on vmware image)

    SQL Server 2008 R2 SP3

    Visual Studio 2010 SP1

    Visual Studio 2012 Update 1

    Latest K2 blackpearl client tools

    DevExpress 12.1.8

    MS Office 2010


    Kjaps


    • Edited by Kjaps Wednesday, December 12, 2012 8:01 PM
    Wednesday, December 12, 2012 8:00 PM
  • Hi Kjaps,

    I'm trying to involve some experts on this issue.

    Regards,


    Barry Wang
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Thursday, December 13, 2012 7:47 AM
    Moderator
  • Great. Thank you Barry

    Kjaps


    • Edited by Kjaps Thursday, December 13, 2012 8:14 AM mispelling
    Thursday, December 13, 2012 8:14 AM
  • Hi Kjaps,

    I searched internally to see if there are any known issues at this failure point, but find none reported.  It may be uninstalling Visual Studio and reinstalling will correct the problem, particularly if some components have gotten overwritten by subsequent installs of other software.  If the issue persists, please open a support case with Microsoft so we can proceed to the next steps which may involve collecting a dump of memory from the crash point by attaching another instance of Visual Studio (or any other debugger in fact) to the first instance and then catching the crash in the second debugger when it occurs, and saving the memory dump.  This will require some significant additional investigation though.

    Thank you.

    Jon Burchel

    Thursday, December 13, 2012 6:47 PM
  • Hi Jon,

    I have uninstalled and installed VS 2012 again, but with the same issue. I will try to open a support case with Microsoft on this.


    Kjaps

    Tuesday, January 15, 2013 8:59 AM
  • I have the same problem here. Reinstalled with all the latest updates etc...the problem still persists.

    The Error I am getting

    Tuesday, January 22, 2013 1:43 PM
  • This issue is a pain. We are opening an ticket with microsoft in the coming days.. I will update this post with the progress.

    Kjaps

    Tuesday, January 22, 2013 2:18 PM
  • I hope you do find an answer to this. If you do I would be grateful if you could post it here as I too have suffered from this problem for at least 2 years. first with VS2010 & now with VS2012.

    I use Winforms but get exactly the same error when opening a form in the designer. The error is random, sometimes the form opens fine others it crashes & the error is always the same, "Value does not fall within expected range". If I close VS2012 & restart it the form always opens correctly as soon as VS2012 restarts. The next time you open the form it might be Ok or it might not be. However the form runs Ok in the application. Quite often if the form is open when I start debugging the designer will crash with the usual message but the program goes on to run correctly. It is not specific to any form just happens at random so I spend a lot of time restarting VS2012.

    I've reinstalled VS2012, also deleted the project .suo file & tried a few other things I've seen on Google but nothing will solve it. The other disconcerting thing is that sometimes VS2012 will move the body of the 'InitializeComponent()' function from the designer.cs file to the source code .cs file! 

    I've just looked at your original post again & I see you use DevExpress controls as I do, so maybe there is some conflict here.

    • Edited by RodGMatthews Wednesday, February 6, 2013 12:49 PM
    Wednesday, February 6, 2013 10:28 AM
  • Hi Guys...

    I'd like to jump on this same bandwagon as I have now wasted two weeks trying to resolve the same thing.  We have 5 Win7 machines (32 bit) and they ALL crash anytime anyone tries to create a new WPF project.  Oddly, we also have 2 Server 2008 machines, but these are not having the same issue.  Worse (for me) is that I have hit just about every web link I could find that was even remotely related and NONE of them work to resolve the issue - however, it is clear that many developers are dealing with the same problem and yet on Microsoft Connect, MS states they will not be addressing this problem and THAT is just plain wrong.  You buy a product and expect it to work and I cant express how frustrating it is to hear MS respond as though its "okay" to ship unfinished, untested junk, and then say they wont be addressing the problem that I just paid to have...

    I really dont want to be doing the install/uninstall route - we did this on one machine and it didnt change anything, same bug, same crash and it just seems so lame to say "reinstall".  Especially when you know the next thing coming is "reformat". 

    I will keep my eye on this post - please update it if you find the magical solution to this. 

    Thursday, February 7, 2013 3:55 PM
  • I have now tried installing Visual Studio 2012 update 2 ctp4. Visual Studio seems a lot slower with this update, and the issue is still there!


    Kjaps

    Tuesday, March 5, 2013 1:12 PM
  • We have now located the cause of the issue in our environment. The component that caused the issue is

    K2 for Visual Studio 2012 1.0 (4.12070.1.0)

    When uninstalling this add-on, the exception went away, and we are able to use our designer again. We will pursue this further with K2.


    Kjaps

    • Marked as answer by Kjaps Monday, March 11, 2013 11:22 AM
    Monday, March 11, 2013 11:22 AM
  • I created a support ticket at K2 and after a few days they came up with this solution:

    After the installation of K2 for Visual Studio 2012, use regedit to delete the following keys:

    [HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\11.0_Config\Languages\File Extensions\.kprx]
    [HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\11.0_Config\Languages\File Extensions\.sodx]

    I have tested this a while and XAML designer works as expected with no errors.

    Thank's to K2 for good support!

    MagsForTags

    • Marked as answer by Kjaps Friday, August 2, 2013 9:56 AM
    Thursday, March 21, 2013 1:29 PM