Visual Studio 2012 failed to create project

2019-01-27 19:02发布

I just upgraded to windows 8 from windows 7. Visual studio 2010 broke down completely. Oh well. I removed vs2012 and installed visual studio 2012, where the pain starts. I have been reinstalling vs 2012 a couple of times. However, the symptom remains the same. When I try to create a new project (FILE -> New -> Project or ctrl + N).
It pops up with an error message dialogbox saying
"Failed to create a ImageSource from the text '..\Images\Medium.png'.
" I am like @#*%&^@*#@#(. So can anyone please tell me what is going on with my Visual Studio2012? By the way, I can open and run the existing vs2010 projects with no problems.
I definitely neither want to do a fresh install on windows 8 nor rolling back to my windows 7. Cheers,

8条回答
贪生不怕死
2楼-- · 2019-01-27 19:42

To resolve that problem, I've change the permission of "modify" for "everybody" on the files

c:\windows\microsoft.net\framework\v2.0.50727\config\machine.config

and

c:\windows\microsoft.net\framework\v4.0.30319\config\machine.config

Don't know if it's the best way to do it, but at least it works.

查看更多
神经病院院长
3楼-- · 2019-01-27 19:49

Do you have any codec packs installed on your system? I had a WIC codec pack for viewing RAW files in Explorer, and it resulted in the same issue you are describing. Uninstalling the codecs fixed Visual Studio for me.

查看更多
走好不送
4楼-- · 2019-01-27 19:52

The trace of this issue leads to Windows Imaging Component (one solution proposed was to remove FastPictureViewer, which codec affects WIC, but it was not my case). I used procmon to log all file and registry calls and found that VS2012 stumbles at the following key:

HKLM\SOFTWARE\Classes\.png - REG_SZ Content Type

I was suprized to see that Content Type for .png was set application (for .jpg it was application as well). After correcting it to image/png, not only VS2012 started successfully, but VS2010 as well, that was showing "Provide value on System.Windows.Baml2006.TypeConverterMarkupExtension threw an exception" on Win8 and caused me to try VS2012.

查看更多
闹够了就滚
5楼-- · 2019-01-27 19:53

I was having various issues, including the above.

To resolve the problem on Windows 8 for VS 2012, setting it to run as administrator fixed the problem for me.

Launch icon properties->Advanced Properties->Run as administrator

I hope this helps.

Cheers, Sean

查看更多
Fickle 薄情
6楼-- · 2019-01-27 19:55

As I mentioned in that question ,

I tried almost every solution I found.

I would like to share, what I have tried and did not work and what did work and solved the problem.

Here are the "solutions" which did not work for me but claimed that they worked for some people.

1) Removing FastPictureViewer Codec Pack (which was already not installed)

2) Having a modify permission to everyone for

c:\windows\microsoft.net\framework\v2.0.50727\config\machine.config

and

c:\windows\microsoft.net\framework\v4.0.30319\config\machine.config

3) Using Procmon to see broken registries

4) Uninstalling/reinstalling VS13 and all shared packages

5) Renaming the machine.config.default to machine.config

6) Running Visual Studio as an administrator

And this what it solved it:

Simply installed all the updates for windows 8.1 (not only the important ones, also optional updates as well) and restart. It sounds crazy after spending hours and hours but that solved my problem.

Good luck!

查看更多
男人必须洒脱
7楼-- · 2019-01-27 19:58

Just happened to me. As Eric Aubry said check the machine.config file. In my case it wasn't permission error but the fact that the file was destroyed internally. By renaming the machine.config.default everything was fixed.

查看更多
登录 后发表回答