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.

3
  • I have the same problem, restarting VS fixes it, but I would like a permanent solution
    – codemonkeh
    Sep 26, 2013 at 23:20
  • 1
    mine didn't work even after restarting VS
    – Ibad Baig
    Oct 1, 2013 at 4:10
  • devenv /resetuserdata worked great for me Jan 26, 2016 at 19:46

13 Answers 13

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.

4
  • Worked for me in VS 2013... whatever's causing the glitch, it's still present.
    – Liz
    Aug 11, 2015 at 13:37
  • 3
    Addins no longer exist in VS 2015, so this option is not present Oct 8, 2015 at 19:54
  • 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?
    – m_cheung
    Oct 9, 2015 at 10:38
  • 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.
    – jv_
    Dec 21, 2016 at 0:30
11

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

2
  • similar to the above only it was two of the same data-templates Jul 19, 2018 at 18:13
  • 2
    edit: two different data-templates templating the same type although the above happens to cause it too. Jul 19, 2018 at 18:27
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...

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.

2
  • 1
    I wish that was an option for me! Thanks for letting me know anyway
    – codemonkeh
    Oct 1, 2013 at 6:10
  • 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. Sep 1, 2017 at 10:15
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...

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).
    – Agat
    Dec 9, 2015 at 11:57
3

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

2
  • 2
    in my case it was the case :P
    – Moshiour
    Aug 12, 2016 at 17:45
  • Same for me. Thank you very much sir!
    – ˈvɔlə
    Jan 9, 2020 at 14:30
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...

0

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

0

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

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.

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.

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

0

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.