Why can't I add certain file types to VS2010 projects?

前端 未结 3 1414
被撕碎了的回忆
被撕碎了的回忆 2020-12-28 14:51

I\'m trying to add a WPF ResourceDictionary to a C# project that was created a while ago. The project was not originally a WPF project, but now I need to include some WPF re

3条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-28 15:30

    Close the project. Create a new project that is of the type of WPF project you would have used. Then open the new .csproj file in notepad. Find the ProjectTypeGuids element. Copy those GUIDs to clipboard. Open your existing .csproj file in notepad. Append those GUIDs into this file's ProjectTypeGuids element. (Check for dupes.) Reload your project in Visual Studio. You should be able to add all the WPF file types now.

    PS: I haven't done this with WPF specifically, but I have with other project types and it has worked without issue.

    I believe the GUIDS are the same for everyone so the values you need should be: {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} ... this should save you the step of creating a new project.

提交回复
热议问题