set property 'system.windows.resourcedictionary.deferrablecontent' threw an exception
Asked Answered
M

13

24

I'm running Visual Studio 2012, when I add a new File/Reference to a project the message box appears showing the error message

set property 'system.windows.resourcedictionary.deferrablecontent' threw an exception

I read an MSDN article suggesting to run the command devenv /resetuserdata on visual studio command prompt to resolve this problem, tried it but didn't work for me. In fact the command prompt shows the Unknown Error message.

Mahoney answered 25/9, 2013 at 9:32 Comment(3)
I have the same problem, restarting VS fixes it, but I would like a permanent solutionLaynelayney
mine didn't work even after restarting VSMahoney
devenv /resetuserdata worked great for meLightfingered
M
4

I fixed it. The resolution was to remove the Windows Azure Tools for Visual Studio 2012 which I was not actually using, and the error went straight away.

Mahoney answered 27/9, 2013 at 13:22 Comment(2)
I wish that was an option for me! Thanks for letting me know anywayLaynelayney
I am getting the same error after installing Windows Azure Tools for Visual Studio 2012. But in my case I need it, because I want to work on "WorkerRole" to replace the windows service functionality.Commonality
C
12

Some addins cause this issue for me so have had to workaround it whenever it occurs:

In Vis studio -

Tools > Options > Environment > Add-in Security, uncheck 'Allow Add-in components to load', OK

Restart vis studio

The error shouldn't occur anymore, so go back to

Tools > Options > Environment > Add-in Security and re-check Allow Add-in components to load, OK

To be specific, I get this error when trying to add files to projects and manage Nuget Packages.

Update

I now make a point of opening 'Tools > Nuget package manager > Manage nuget packages for solution' whenever I open up a new instance of Vis studio, before loading a solution, just to make sure the window loads properly

That way I know I won't get this issue.

Cher answered 18/3, 2014 at 14:4 Comment(4)
Worked for me in VS 2013... whatever's causing the glitch, it's still present.Grog
Addins no longer exist in VS 2015, so this option is not presentTolley
Still haven't the foggiest what's causing this, but I now habitually open one of the tools dialog windows before loading a solution, such as 'Extensions' or 'Nuget package manager'. Is it possible to do that in VS 2015?Cher
Looks like this is still broken in VisualStudio2017. The path "Environment > Add-in Security" no longer exists. I was able to recover by turning off everything in 'Options > Nuget Package Manager (General & Package Sources)' AND turned off everything in 'Options > Environment > Extensions and Updates' then restarting, loading a solution, restarting, turning it all back on.Salcedo
C
11

In my case it was a style with the same key defined twice in a ResourceDictionary (WPF)

Causey answered 2/12, 2017 at 6:31 Comment(2)
similar to the above only it was two of the same data-templatesBrumfield
edit: two different data-templates templating the same type although the above happens to cause it too.Brumfield
S
5

I have Windows azure tools for Microsoft VisulStudio 2013- v2.2 and Windows azure tools for Microsoft lightswitch VisulStudio 2013- v2.2.

I uninstall only Windows azure tools for microsoft lightswitch vs 2013 .

It's working fine...

Snicker answered 7/3, 2014 at 11:7 Comment(0)
M
4

I fixed it. The resolution was to remove the Windows Azure Tools for Visual Studio 2012 which I was not actually using, and the error went straight away.

Mahoney answered 27/9, 2013 at 13:22 Comment(2)
I wish that was an option for me! Thanks for letting me know anywayLaynelayney
I am getting the same error after installing Windows Azure Tools for Visual Studio 2012. But in my case I need it, because I want to work on "WorkerRole" to replace the windows service functionality.Commonality
S
3

The mentioned issue can be resolved by simply restart the Visual Studio. :P

Salsala answered 10/9, 2014 at 5:17 Comment(2)
in my case it was the case :PCamembert
Same for me. Thank you very much sir!Sunless
C
3

In my case it was to first launch Visual Studio in safe mode. You can create a shortcut for visual studio with a target like this:

'"F:\Program Files\Visual Studio\VS2013\Common7\IDE\devenv.exe" -safemode'

Once launched in safe mode, you can remove the problematic extension via the Addin Manager. However, this wont work for some extensions, as the uninstall option might be disabled for certain extensions when running in safe mode, particularly if you have already uninstalled another extension in the same session.

In My case the problem was caused by Paradox Game engine, in which I had uninstalled it via 'Programs and Features' - which in return did not remove the extension which was originally installed via Nuget package. Uninstalling Paradox via "Programs And Features" left the extension itself still registered in Visual Studio, presumably causing a hidden NullReferenceException.

This issue can be caused by any extension that may have an error in it, or by extensions that were not properly uninstalled.

Also, see this article...

Credit answered 23/1, 2015 at 9:13 Comment(1)
Confirm. That's more common resolving of the issue. (However, seems the actual problem is still in Azure Tools which need to be updated/removed).Andriette
C
0

Also seem to be able to get around this by closing the project and vis studio instance, re-opening, then when the start page/open project screen appears selecting Tools > Extensions and Updates..., then pressing Close

Now open the project and the error doesn't get thrown when trying add files or manage nuget packages, weird.

Just annoying you have to remember to open Extensions and Updates each time...

Cher answered 24/7, 2014 at 22:47 Comment(0)
I
0

Other wise make sure given Resourcedictionary.xaml path is correct or not

Iata answered 20/4, 2015 at 9:58 Comment(0)
T
0

I had to remove Xamarin from Add/Remove Programs in Control panel and restart Visual studio to fix this.

Tolley answered 9/10, 2015 at 8:23 Comment(0)
P
0

I had this problem with My Devexpress Project in VS 2015 What finally worked for me was. Close my solution, Close Visual Studio, Open Visual Studio, Create a New dummy project, Add a form to it, Close and save the new project, Reopen original project and all was ok.

Payday answered 5/5, 2016 at 15:9 Comment(0)
M
0

for everyone else who are working in silverlight sdk environment with windows phone8 sdk.

The versions of sliverlight which are compatible with visual studio versions -

vs2012- sliverlight sdk 4

vs2013- silverlight sdk 5

I was integrating in vs2013 and as soon as I updated it with silverlight sdk 5, The errors went away.

Mongoloid answered 25/10, 2016 at 6:2 Comment(0)
B
0

In my case it was the Line Endings: you can have different formatting and by copy pasting some code one file got a different Line Ending. It was enough to File > Save As and then click the little arrow next to the save button.

Then click on save with encoding and choose the one you are using in all other files.

See Andrew Truckle's answer.

I hope this helps

Bills answered 17/5, 2018 at 15:14 Comment(0)
M
0

I solved it by setting the project platform to x64 instead of anycpu

Mendel answered 4/3, 2024 at 13:21 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.