Can't view my user control in the designer (An Unhandled Exception has occurred)

I'm using VS 2012, looking at some code I wrote some time ago. For some reason I cannot view the XAML in the design view, only the XAML view. I'm getting an error that says, "An Unhandled Exception has occurred". I can compile the solution fine,
but it won't let me view it. I don't know why I can't view it in the designer. Here's the error details:
Microsoft.Expression.DesignHost.Isolation.Remoting.RemoteException
Object reference not set to an instance of an object.
   at System.Windows.StyleHelper.FindNameInTemplateContent(DependencyObject container, String childName, FrameworkTemplate frameworkTemplate)
   at System.Windows.TemplateNameScope.System.Windows.Markup.INameScope.FindName(String name)
   at MS.Internal.Data.ElementObjectRef.GetObject(DependencyObject d, ObjectRefArgs args)
   at MS.Internal.Data.ObjectRef.GetDataObject(DependencyObject d, ObjectRefArgs args)
   at System.Windows.Data.BindingExpression.MS.Internal.Data.IDataBindEngineClient.VerifySourceReference(Boolean lastChance)
   at MS.Internal.Data.DataBindEngine.Task.Run(Boolean lastChance)
   at MS.Internal.Data.DataBindEngine.Run(Object arg)
   at MS.Internal.Data.DataBindEngine.OnLayoutUpdated(Object sender, EventArgs e)
   at System.Windows.ContextLayoutManager.fireLayoutUpdateEvent()
   at System.Windows.ContextLayoutManager.UpdateLayout()
   at System.Windows.UIElement.UpdateLayout()
   at System.Windows.Interop.HwndSource.SetLayoutSize()
   at System.Windows.Interop.HwndSource.set_RootVisualInternal(Visual value)
   at System.Windows.Interop.HwndSource.set_RootVisual(Visual value)
   at Microsoft.Expression.DesignHost.Isolation.Remoting.RemoteUIElement.<>c__DisplayClass12.<Microsoft.Expression.DesignHost.Isolation.Remoting.IRemoteUIElement.CreateContent>b__11()
   at Microsoft.Expression.DesignHost.Isolation.Remoting.ThreadMarshaler.<>c__DisplayClass16`1.<MarshalIn>b__15()
   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.ProcessQueue(CallQueue queue)
   at Microsoft.Expression.DesignHost.Isolation.Remoting.STAMarshaler.ProcessInboundAsyncQueue(Int32 identity)
   at Microsoft.Expression.DesignHost.Isolation.Remoting.STAMarshaler.ProcessMessage(Int32 msg, IntPtr wParam, Boolean elevatedQuery, Boolean& handled)
   at Microsoft.Expression.DesignHost.Isolation.Remoting.STAMarshaler.OnWindowMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at Microsoft.Expression.DesignHost.Isolation.Remoting.MessageOnlyHwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
   at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
   at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
   at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
   at System.Windows.Threading.Dispatcher.Run()
   at System.Windows.Application.RunDispatcher(Object ignore)
   at System.Windows.Application.RunInternal(Window window)
   at System.Windows.Application.Run(Window window)
   at Microsoft.Expression.DesignHost.Isolation.IsolationProcess.RunApplication()
   at Microsoft.Expression.DesignHost.Isolation.IsolationProcess.<>c__DisplayClass2.<Main>b__0()
   at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.ThreadHelper.ThreadStart()
Rod

I stopped when I saw stuff about databinding.
I guess your problem is you have code in your constructor.
A prameterless constructor of a view will be called by the designer.
This is probably trying to use things which aren't there at design time.
You can mock them or just exit out the constructor if you're in the designer.
public YourUserControlConstructor()
InitializeComponent();
if (DesignerProperties.GetIsInDesignMode(this)
return;
// Dependent code which produces errors
http://social.technet.microsoft.com/wiki/contents/articles/29874.wpf-tips-designer-detection.aspx
Hope that helps.
Recent Technet articles: Property List Editing;
Dynamic XAML

Similar Messages

  • Powerpivot - Can't insert formula that combines two or more different columns and keep getting message "unhandled exception has occurred in a component in your application...

    I am using powerpivot v2 with excel 2010.
    When I go to my excel file's powerpivot and I try to insert a formula in any column, I constantly get the following message:
    "unhandled exception has occurred in a component in your application. If you click continue, the application will ignore this error and attempt to continue".
    ************** Exception Text **************
    System.InvalidCastException: Return argument has an invalid type.
       at System.Runtime.Remoting.Proxies.RealProxy.ValidateReturnArg(Object arg, Type paramType)
       at System.Runtime.Remoting.Proxies.RealProxy.PropagateOutParameters(IMessage msg, Object[] outArgs, Object returnValue)
       at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
       at Microsoft.Office.Interop.Excel._Application.get_ActiveWorkbook()
       at Microsoft.AnalysisServices.XLHost.Addin.GeminiRibbon.currentClientWindow_InFormulaBarChanged(Object sender, EventArgs e)
       at Microsoft.AnalysisServices.Common.SandboxEditor.formulaBar_Leave(Object sender, EventArgs e)
       at System.EventHandler.Invoke(Object sender, EventArgs e)
       at System.Windows.Forms.ContainerControl.UpdateFocusedControl()
    Does anybody know how to fix this ?

    Mark,
    I used the Fix It found here:
    http://support.microsoft.com/kb/2739501
    I would have to ask my IT support person for more specifics, but as I understand the scenario with my particular laptop: the laptop came preloaded with RTM build of 2013.  We used Control Panel to uninstall Office 2013, in order to install Office
    2010.  I installed PowerPivot add-in and used it successfully with no issues for several months.  After attempting to install another program and encountering issues with apparent traces left behind of Office 2013 uninstall, I found the link above
    and used the Fix It to attempt to remove all remaining traces of Office 2013.  While it did appear to find and clean-up quite a bit left behind from the Office 2013 install, I was surprised to find an error upon entering my existing installation
    of PowerPivot for 2010 and attempting to type new formulas into the formula bar.
    My experience to-date is that an error message stating ""Return Argument Has an Invalid Type" appears anytime I select or modify a formula in the formula bar that would cause the intellisense to appear.  For example, when I first click into the formula
    bar, I do not get an error...but as soon as I type the first letter, before the intellisense appears, I get the error message.  Throughout the remainder of the formula as I type, just prior to any time when the intellisense drop-down will appear
    again, I get the same error message again (see details below).
    At one time, although I can't reproduce it now, the error message did state ".Net Framework" in the menu bar of the error pop-up window.  I can't get that to appear again, as it now only says "PowerPivot for Excel".  Based on this, I had attempted
    to see if I could repair my .NET framework install using the following tool:
    http://www.microsoft.com/en-us/download/details.aspx?id=30135
    I learned, however, that since I am running Windows 8 which comes with .NET 4.5 built-in to the OS, this tool does not yet cover that version for repair.
    While the overall end-result of my PowerPivot models appear to be just the same, having to click through "Continue" on the error message multiple times each time I enter a new formula is a huge drain on productivity.
    Let me know if you have any additional questions.
    David
    System.InvalidCastException: Return argument has an invalid type.
       at System.Runtime.Remoting.Proxies.RealProxy.ValidateReturnArg(Object arg, Type paramType)
       at System.Runtime.Remoting.Proxies.RealProxy.PropagateOutParameters(IMessage msg, Object[] outArgs, Object returnValue)
       at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
       at Microsoft.Office.Interop.Excel._Application.get_ActiveWorkbook()
       at Microsoft.AnalysisServices.XLHost.Addin.GeminiRibbon.currentClientWindow_InFormulaBarChanged(Object sender, EventArgs e)
       at Microsoft.AnalysisServices.Common.SandboxEditor.formulaBar_Leave(Object sender, EventArgs e)
       at System.EventHandler.Invoke(Object sender, EventArgs e)
       at System.Windows.Forms.ContainerControl.UpdateFocusedControl()
    David Duncan Consultant I.B.I.S., Inc.

  • I can not sighn in. I get the message A network error has occurred while attempting to sign in.

    I can not sighn in. I get the message A network error has occurred while attempting to sign in.

    Hi rebjrbaker,
    I'm guessing that you're trying to log in to the service from within Reader. If that's the case, you may need to update the version of Reader you're using. Choose Help > Check for Updates. You should be using version 11.0.9 (this update was just released on Tuesday, 9/16).
    Best,
    Sara

  • How to create a new user in OWB that can only view other user's mappings

    Hello Everyone,
    I am new to OWB and want to know if possible to create different users that can only view other user's mappings without making any changes. Do you know if possible each user can have his own password?
    Thank you for your help!
    Jennifer

    A good starting point would be this blog posting:
    https://blogs.oracle.com/warehousebuilder/entry/build_up_multi-role_development_environment_in_owb
    I seem to recall as well from the OWB Admin class that existing objects in the repository would need to have the security updated if the additional restricted roles are created after tables/mappings/etc. so that they reflect the new security model.
    Also, for individual logins to OWB, each developer would require a separate database login.

  • Is there any user control on the iphone anymore?

    Ok so I hate the new OS 7 but before you write me off as just complaining please read further:
    I have a very hard time reading the phone because of the white backgrounds on everything , I understand some like this. Is there any way to change this?
    I also can't read my text very well because of the white on green text bubbles ... Any way to change this?
    Can someone please tell me what apple really did to enhance the user experience? And what is an important feature they have added to the new OS that really stands out over the 6 aside from the horrible layout change? I read what they said the new features were and I didn't see anything that wasn't just a cheap trick. Maybe someone can show me something that will revive some bit of like into the phone again?
    But back to the settings change. I went to accessibility and upped the contrast and bolt text but that only helps slightly . I inverted the colors and thought awesome but then realized it inverts everything so that won't work. I could deal with black back grounds on everything .
    Any help please ? I'm not made of money so I'm stuck with the 5 for a few weeks at least. Every time I use the phone it angers me so it's not a very pleasant experience !!!
    Some people really have issues with the eyes and I just want to have a little control over the look of the phone. Really not digging the way it's swiped to delete now and the way they have the search and control panel I can't get a good swipe on those to save my life. Hate is a good word right now.

    Those minimal changes do nothing that I asked. I'm not sure why you linked that. I have read the very simplistic, almost null, options of the ios7 . I appreciate the attempt to help. It seems that the answer is NO, there is no user control over the new layout.
    My ultimate answer to gaining user control over their phone is to sell the iPhone and buy a galaxy .
    <Edited By Host>

  • How can i view all users?

    Hi all.
    i am using Oracle 10g.
    How can i view all users?
    Tanx
    Alam

    So if you can not get complete set of data you will take a subset (which can be empty, BTW) and say this is a complete list?In a 10.2.0.4 database a user with CONNECT role only can see every username. Can't see all the details but that's the intent of the view. I don't know if this is a doc bug or what.
    And, it is, BTW, a very good thing DBA_USERS is not available to everyone. List of users is part of security and is at least confidential.Agree 100%. I just thought it was a bit odd for you to suggest that I RTFM the ALL_USERS definition, and point out that the docs state it's a list of users visible to the current user, when your suggestion to the OP was to use DBA_USERS. It's likely that a user with the ability to query DBA_USERS would have all users visible to them anyway. I just didn't understand your rather rude followup directed at me. I'm just trying to help, just like everyone else here.

  • HT1390 how can i view a list of only the rentable movies in itunes?

    how can i view a list of only the rentable movies in itunes?

    you mean using itunes for windows or from the ipad

  • In VIEWING (to print) my iTunes music (in finder), how can i view subfolders without clicking on the  triangle of each main folder?

    In VIEWING (to print) my iTunes music (in finder), how can i view subfolders without clicking on the  triangle of each main folder?
    I am trying to print a list of all my music. For example, main folder is BEATLES.  Subfolders are Magical Mystery Tour, Yellow Submarine, Abbey Road, etc...
    and I want to view and print all the subfolders. This is a recovery project after my hard drive failed. I know this is truly a "finder" question and will double post there.
    Thanks.
    Amy

    amy lynn wrote:
    way too much ink.
    Don't know what this means but okay.

  • How can i obtain a user guide for the ipod nano 16GB 5th gen. with out printing it off the computor

    How can i obtain a user guide for the ipod nano 16GB 5th gen. without printing it off the computor.

    You can't, at least not the one provided by Apple.
    B-rock

  • Where can I download a user manual for the BG-ED3 grip that is on my Canon EOS 10D

    I have a canon bg-ed3 grip on my canon EOS 10D. From where can I download a user manual for the grip

    This help?  Scroll down.
    http://www.canon.com/camera-museum/tech/report/200009/report.html

  • How can I view a recto page on the right?

    This used to be automatic in old versions of Acrobat. Now that I am using Acrobat X I cannot get the view I want.  In a 2-page view, how can I view a recto page on the right and a verso page on the left? Now all I get is a recto on the left and a verso on the right! Is there a setting to view, say, a book? or some other way to get the first page to be alone on the right and the rest to be a 2-page view with pages side by side correctly?

    View > Page Display > Show Cover Page During 2-Up

  • Can i view customer report as per the business area wise , region-wise how?

    can i view customer report as per the business area wise , region-wise how?

    Hi,
    You can view the report business area wise, extract the report and go to dynamic selection and selection business area. When the report is display just sub total on business area. System is showing report as per your requirement.
    Regards,
    Pankaj

  • How can I view a completed form as the person filling it out sees it

    How can I view a completed form as the person filling it out sees it. The text that is a part of the form does not print when the record(from) is printed.

    We now support saving a response from the View Responses tab to PDF (that retains the form design shown on the Design tab). The PDF can be shared, archived or printed using Adobe Reader.
    You can read more about it here: http://forums.adobe.com/thread/1085672
    Please try it out and give us your feedback.
    Randy

  • Can't view about sixty percent of the internet please help.

    Very frustrated that I have just spent over 900 dollars on my new iPad and I can't view more than half of the web sites due too my iPad not being compatible with flash. Common sites like herald sun or afl.com.au. Can't view any flash videos at all. A warning label should be placed on the box that ipads aren't internet compatible for at least half the sites on the net. I feel ripped off and cheated is their anyway I can use this thing to view everyday websites. Any help would be appreciated.

    The iPad is not a desktop or laptop replacement.
    It is an intermediate device for when a desktop / laptop is not needed or convenient.
    Apple is not stopping you from looking at anything you want on your iPad.
    Flash and other adobe junk is available for OS X on apple computers.
    Adobe had no modern mobile flash player available when the original iPhone or the iPad came out, they had abandoned development of it.
    All they had to offer was an old piece of software based on flashplayer 6(we are at 10 now). It was garbage.
    Adobe just now is releasing there mobile flashplayer as a non-beta.
    From what I am hearing it is not very good.
    Apple will not accept it until it is not garbage, by then HTML 5 will be dominate and adobe will be out of luck.
    http://www.macobserver.com/tmo/article/mobileflash_a_lesson_indisappointment/

  • HT3965 Can you add multiple user profile to the iPad

    Can you add multiple user profile to the iPad

    Hi Friend,
    Apple devices are developed for single users.
    Hope it helps

Maybe you are looking for

  • [HELP!!!]iCloud, Mac appstore not connecting, ever since I  move to china bot in ipad and macbook pro

    since I move to china a week ago i realize base on my personal experience that the country is definitely no mac friendly, which is unfortunate for me since i own a macbook pro, iphone and ipad, and i tell you why. ever since i move to china it seems

  • Grep expression question

    So, I'm new to this.... I'm trying to write an expression that will look for any digits or words that appear in parenthesis at the end of a paragraph and then change it to... deleted. Don't laugh but this is what I came up with and it's not working \

  • How to append html formatted text to JPaneText?

    Hi, I'm trying to append html to JPaneText and I can't do it. My code is below: import java.awt.*; import javax.swing.*; import javax.swing.text.html.HTMLEditorKit; import javax.swing.text.html.*; import javax.swing.text.*; public class GUI extends J

  • Web Dynpro ABAP - ALV: Export to Excel | Export to PDF

    Hello, I was wondering which settings I need to configure and where to configure these, for the "Print Version" and "Export to Microsoft Excel" to work. Print version Communication Failure: RFC destination SALV_WD_EXPORT_PDF does not exist Thanks in

  • HOW TO  CAST NVARCHAR2 TO BLOB

    Hello i must stock my data to a nvarchar2 data (unicode) and i must also make full text search on this column, oracle does not support full text search on unicode data, so i have decided to stock my unicode data to a blob clomun, after i can create a