在VS里新建的类库项目,在添加新建项时往往找不到模板。比如想新建一个WPF的资源词典文件,VS认为该类库项目不是WPF类型,就没有列出新建资源词典的模板。解决办法是在csproj文件的<PropertyGroup>标签下添加如下内容:
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids> <WarningLevel>4</WarningLevel> <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
部分VS项目GUID罗列如下:
Windows (C#) {FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} Windows (VB.NET) {F184B08F-C81C-45F6-A57F-5ABD9991F28F} Windows (Visual C++) {8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942} Web Application {349C5851-65DF-11DA-9384-00065B846F21} Web Site {E24C65DC-7377-472B-9ABA-BC803B73C61A} WCF {3D9AD99F-2412-4246-B90B-4EAA41C64699} WPF {60DC8134-EBA5-43B8-BCC9-BB4BC16C2548} XNA (Windows) {6D335F3A-9D43-41b4-9D22-F6F17C4BE596} XNA (XBox) {2DF5C3F4-5A5F-47a9-8E94-23B4456F55E2} XNA (Zune) {D399B71A-8929-442a-A9AC-8BEC78BB2433} Silverlight {A1591282-1198-4647-A2B1-27E5FF5F6F3B} ASP.NET MVC {F85E285D-A4E0-4152-9332-AB1D724D3325} ASP.NET MVC 4 {E3E379DF-F4C6-4180-9B81-6769533ABE47} Test {3AC096D0-A1C2-E12C-1390-A8335801FDAB} Solution Folder {2150E333-8FDC-42A3-9474-1A3956D46DE8}