Reputation: 1098
I'm attempting to follow the instructions to create a reusable modal window in LightSwitch from Jan Van der Haegen's blog. However after I click to add a new Silverlight User Control to the Client, and input the xaml I'm met with errors. I reduced the code to the shortest section that gives me an error:
HRESULT E_FAIL has been returned from a call to a COM component.
From the following xaml:
<shellUtils:ScreenChildWindow
xmlns:shellUtils="clr-namespace:Microsoft.LightSwitch.Runtime.Shell.Framework;assembly=Microsoft.LightSwitch.Client">
</shellUtils:ScreenChildWindow>
I just installed Visual Studio 2012 in a virtual machine, created a new project, new Client Silverlight User Control, and tried the same code and received the same error.
I also receive it with this code and others referencing Microsoft.LightSwitch.Client:
<Framework:GroupBox
xmlns:Framework="clr-namespace:Microsoft.LightSwitch.Presentation.Framework;assembly=Microsoft.LightSwitch.Client">
</Framework:GroupBox>
Comments on the blog seem to indicate others have this error but I haven't found a solution anywhere yet. I also see the same/similar on Stackoverflow here, but unanswered.
Upvotes: 0
Views: 720
Reputation: 81
Yes that's correct, just close the preview window. The XAML designer has a hard time rendering the control when referencing the LS assemblies. You can ignore these errors.
If you're seeing these errors elsewhwere please let me know and we can investigate.
Upvotes: 2
Reputation: 1098
After scouring the internet for the slightest related issue, I discovered at least in my case the design view errors can be entirely ignored.
Even with the other errors I didn't mention:
Undefined CLR namespace. The 'clr-namespace' URI refers to a namespace Microsoft.LightSwitch.Cosmopolitan.Presentation.Controls' that could not be found.
The type 'ctls:OverflowControl' was not found. Verify that you are not missing an assembly reference and that all referenced assemblies have been built.
An error occurred while finding the resource dictionary /Microsoft.LightSwitch.Cosmopolitan.Client;component/Presentation/Shells/BasicStyles.xaml"
The control works perfectly. All the assembly preferences are present, so I'm not sure why the designer claims otherwise.
Upvotes: 1