Silverlight designer error - silverlight

Whenever I open my Visual Studio 2010 Silverlight designer for xaml I am getting this error.
System.NullReferenceException Object reference not set to an instance of an object. at Microsoft.Expression.Platform.Silverlight.SilverlightDomainManager.CreateDomainCore() at Microsoft.Expression.Platform.Silverlight.SilverlightDomainManager.CreateDomainInitial() at Microsoft.Expression.Platform.Silverlight.SilverlightPlatformCreator.Initialize() at MS.Internal.Platform.SilverlightPlatformImpl.Initialize() at MS.Internal.Package.VSIsolationProviderService.RemoteReferenceProxy.EnsurePlatformInitialized() at MS.Internal.Package.VSIsolationProviderService.RemoteReferenceProxy.EnsurePlatformInitialized() at MS.Internal.Package.VSIsolationProviderService.CreateIsolationProvider(String originalIdentifier, Boolean isGlobal, String identity, FrameworkName frameworkName, AssemblyName appAssemblyName, IVsHierarchy hierarchy) at MS.Internal.Package.VSIsolationProviderService.CreateIsolationProviderWorker(String identifier, IServiceProvider provider) at MS.Internal.Package.VSIsolationProviderService.CreateIsolationProvider(String identifier, IServiceProvider provider) at MS.Internal.Providers.VSDesignerContext.CreateIsolationProvider(IServiceProvider provider, IVsHierarchy hierarchy) at MS.Internal.Providers.VSDesignerContext.<>c_DisplayClass1.b_0(IsolationProviderProxy i) at MS.Internal.Providers.IsolationProviderProxy.get_RealProvider() at MS.Internal.Providers.IsolationProviderProxy.add_UnhandledException(UnhandledExceptionEventHandler value) at MS.Internal.Designer.DesignerPane.LoadDesignerView()
Note:- I saw lot of references in online & in stackoverflow. Nothings works for me.

In this forum
http://forums.silverlight.net/t/168508.aspx kakone says "There were some old versions of Silverlight assemblies into the GAC.I used gacutil to remove all Version=2.0.5.0 silverlight assemblies. "
So maybe old assemblies cause conflicts.
See also
http://connect.microsoft.com/VisualStudio/feedback/details/543205/silverlight-rc-4-designer-dontwork

i dont know if you got the answer or not, but i had a similar issue a while back and here is what i did
Goto add/remove programs.
unistall both silverlight components. i.e. Silverlight and its SDK
Download this file and install it.
Restart Visual Studio, and now it should work fine

Related

Could not load file or assembly 'Windows, Version=255.255.255.255, Culture=neutral, PublicKeyToken=null, ContentType=WindowsRuntime'

After installing vs2012 and updating my vs2010 WPF project I get the following error in WPF designer:
Could not load file or assembly 'Windows, Version=255.255.255.255, Culture=neutral, PublicKeyToken=null, ContentType=WindowsRuntime' or one of its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515)
This happens for every xaml page in the project.
<dx:DXWindow.DataContext>
<vm:MyViewModel/>
</dx:DXWindow.DataContext>
VS marks vm:MyViewModel as the problem line. If I comment it out the designer windows shows a blank page. This same projects works fine in VS2010. The target framework is set to 4 in both versions of visual studio.
This is a bug in Entity Framework (EF5) when used with Visual Studio 2012 or in a project that references a winmd assembly.
EF tries to load all referenced assemblies to check if they contain pre-compiled views. During this process EF5 fails when it tries to load a winmd assembly. Trying to load winmd assemblies with Assembly.Load causes a System.IO.FileLoadException which is not handled in EF5.
NOTE: Although your application might not have a reference to any .winmd assembly, VS2012 WPF Designer's host process (xdesproc.exe) has a reference to the Windows.winmd assembly. This explains why the projects work fine in VS2010 and during runtime. You can use .NET Reflector to confirm this.
This issue has been fixed in EF6.
A bug was filed for this http://entityframework.codeplex.com/workitem/609
and fixed in changeset 50c1e5a2c46d http://entityframework.codeplex.com/SourceControl/changeset/50c1e5a2c46d

Silverlight Designer not finding custom controls

I'm having an issue where silverlight doesn't recognise custom controls or resources.
I include the namespace and intelisense recognises the item, the application builds fine and runs fine however the designer throws the following error.
The type 'x' was not found. Verify that you are not missing an assembly reference
and that all referenced assemblies have been built.
Usually I'm able to sort out the issue by performing a clean/rebuild of the project. however recently this route has been unable to resolve the issue.
Is this a known issue with the Visual Studio designer? are there any fixes/work arounds out there?
Thanks
EDIT:
I'm using the following declaration:
xmlns:converters="clr-namespace:x.Classes.Converters"
and referencing the control using the following:
<converters:ReportTypeImageConverter x:Name="ReportTypeImage"/>
Restarted visual studio this morning when I logged in and now its recognising the controls, which means I can use the designer again.
Try to go to your Project Properties and put some Reference Paths(folders where you .dll are)
Hope it Helps

The tag "xxx" does not exist in XML namespace"yyy" / Reference could not be found

I have a winform usercontrol than I want to add to wpf project.
I added the relevant references (WindowsFormsIntegration, SystemWindowsForms and my user control dll) and added this row in my XAML:
xmlns:MyControl="clr-namespace:xx.xx.xx;assembly=xx.xx"
And then this:
<WindowsFormsHost><MyControl:control></MyControl:control></WindowsFormsHost>
When I write "MyControl:" the "control" is automated show up that mean VS recognize the control and all references added ok... but when I compile the project this give me the error in the title.
Edit
Its very strange when I'm compile the all project i've got error "The type or namespace name "xx' could not be found..."
but I added all the refernces and the VS recognize the namespace so why the compiler don't found them? If this problem will be solved I beleive the other problem also will disappear.
The solution is: Go to your project properties and change the Target Framework from Client Profile to the full version of the .Net you are using, see the image below. This problem happens if your DLL targets the full .NET Framework, and your WPF Application (main project) targets .Net Client Profile.
This happened to me when I included the assembly name in the namespace definition, but both controls were in the same assembly. Just removing the assembly part of the namespace declaration solved it.
Visual Studio will load the reference only for reflection so it will show correct intellisense correctly. But in order to compile, compiler will need all the dlls that your referenced dll is dependent on. So visual studio will show intellisense for mycontrol as it can find it in reference. But your myontrol may reference other dlls which you may not have added. You will have to add dependent references of mycontrol in your project too.
It could also be that the target framework is different between your projects. We host a class library dll with the WPF pages, and it was targeted to 'Any CPU', but the host application was targeted to 'x86'. Once they matched, the problem went away.
I ran into the same "The type or namespace name 'xx' could not be found..." issue.
It disappears when I moved my Visual Studio files on a local drive. They were stored on a shared network directory before. I dont know the root cause of this, but at least I can have my designer running now.
I've encountered this problem before and replacing <MyControl:control></MyControl:control> with just <MyControl:control/> fixed it for me.
No idea why though. It seems like the first form is only for controls which can contain other controls.

Visual Studio 2010 WPF Designer issues

I am using:
Visual Studio 2010 Professional,
Silverlight 4 Toolkit
The WPF Designer don't show (invisible) - while the Component Toolbox is showing the relevant controls, and the Windows->Windows option shows the designer to be active. It does this with ALL XAML for me, regardless of its complexity. I have already tried the /ResetSkipPkgs to no avail. I had CodeRush and DevExpress installed (demo) version but removed both since. I can get along with XAML by switching to Source Code /Text Editor, but this really boils my chops to run the app to find out that I have made a silly mistake in my XAML (while a preview would sort it out quicker, and no, please don't suggest Expression Blend for it is non-nonsensical for me to switch continuously between these applications).
When I however switch the WPF Designer to open with Encoding I get the following error - which I assume is related to the issue for not showing the XAML Editor/Designer in non-encoding:
An Unhandled Exception has occurred
Click to reload the designer
System.NullReferenceException
Object Reference not set to an instance of an object.
at MS.Internal.Providers.VSDesignerContext.VSDesignerContextHolder..ctor(IServiceProvider services, VSDesignerContext context, Object docData)
at MS.Internal.Providers.VSDesignerContext.GetContext(IServiceProvider services, IVsWindowFrame frame, Boolean createIfNotExist)
at MS.Internal.Designer.TabbedEditorPane.MS.Internal.Designer.ITabbedEditorService.get_DesignerContext()
at MS.Internal.Designer.DesignerPane.InitializeDesigner()
I have googled it silly, to no avail. I am thinking about reinstalling Visual Studio - but this REALLY is a last resort. I hate fixing things by reinstalling, rebooting etc.
Any guru with the magical answer?
I got the exact same exception today and solved it by killing a few GDI hungry apps. You can see the number of GDI objects a process is using in the Processes tab of Task manager (you will probably need to add the column using View -> Select Columns).
Hmm, I know this is old, but you should try installing SP1 for your Visual Studio if you haven't yet.

WPF VS2010 Upgrade - Now WPF designer throws exception when projects targets .NET framework 3.5

I recently upgraded a number of projects from VS2008 to VS2010. Now I'm having an issue at design time w/ the WPF designer in Visual Studio. It throws an exception for every XAML page I open in design mode. Exceptions also throw for new brand new XAML pages.
Projects currently target .NET 3.5. If I switch to target .NET 4.0, designer opens correctly.
Do note that projects build and run successfully.
The exception Details displayed in the WPF designer vary but scrolling to the bottom of the Details of all the exceptions do show something similar to:
The component 'MS.Internal.Interaction.AdornerFontResourceDictionary' does not have a resource identified by the URI '/Microsoft.Windows.Design.Interaction;component/ms/internal/interaction/adornerfontresourcedictionary.xaml'.
at System.Windows.Application.LoadComponent(Object component, Uri resourceLocator)
at MS.Internal.Interaction.AdornerFontResourceDictionary.InitializeComponent()
at MS.Internal.Interaction.AdornerFontResourceDictionary..ctor()
at Microsoft.Windows.Design.Interaction.AdornerFonts.<.cctor>b__0()
at Microsoft.Windows.Design.Interaction.AdornerResources.EnsureResources(Boolean forceUpdate)
at Microsoft.Windows.Design.Interaction.AdornerResources.get_ThemeResources()
at MS.Internal.Themes.GenericTheme..ctor()
I'm guessing switching the framework targets is is causing the project to point to some older DLL. Any thoughts?
Following the upgrade, look through all the projects in the solution looking for references to any DLL named "Microsoft.Windows.Design*". Removing these references and recompiling will fix the issue.

Resources