我已经被困了一段时间了,并且无法弄清楚还有什么可以尝试。
基本上我们已经创建了一个SDK和一个安装程序,可以为visual studio创建项目模板,以便轻松创建产品。此项目模板包含两个自定义项目类型,例如.xxProj和.yyProj,它们都与我们的特定编译器和SDK附带的目标文件相关联。
项目在安装并正常工作时在Visual Studio中显示正常,但由于某种原因,即使我相信我已正确实现了两者的各个属性页,属性窗口/页面也不包含任何内容。
在ProjectPackage中,我提供了以下对象和属性标记:
[ProvideObject(typeof(xxPropertyPage))]
[ProvideObject(typeof(yyPropertyPage))]
[ProvideProjectFactory(typeof(yyProjectFactory), null, "yy Project Files (*.yyproj);*.yyproj", "yyproj", "yyproj", ".\\NullPath", LanguageVsTemplate = yyProjectFactory.PROJECT_TYPE)]
[ProvideProjectFactory(typeof(xxProjectFactory), null, "xx Project Files (*.xxproj);*.xxproj", "xxproj", "xxproj", ".\\NullPath", LanguageVsTemplate = xxProjectFactory.PROJECT_TYPE)]
其他两个属性页都是COM可见并实现SettingsPage。我还将get属性页面方法添加到项目节点中。
protected override Guid[] GetConfigurationIndependentPropertyPages()
{
Guid[] result = new Guid[1];
result[0] = typeof(xxPropertyPage).GUID;
return result;
}
/// <summary>
/// Overriding to provide project general property page.
/// </summary>
/// <returns>Returns the GeneralPropertyPage GUID value.</returns>
protected override Guid[] GetPriorityProjectDesignerPages()
{
Guid[] result = new Guid[1];
result[0] = typeof(xxPropertyPage).GUID;
return result;
}
是否需要在.xxProj / .yyProj文件中生成属性页面或可能忽略的内容?
.yyProj文件的示例:
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{F4A26EF6-E6CF-4486-A948-8498EE475EFF}</ProjectGuid>
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
</PropertyGroup>
<PropertyGroup>
<TargetName>$productvendor$.$productname$.Product</TargetName>
<OutputType>xxProject</OutputType>
<SDKVersion>v3.1</SDKVersion>
<VendorName>$productvendor$</VendorName>
<ProductName>$productname$</ProductName>
<ProductCategory>$productcategory$</ProductCategory>
<ProductGuid>$productguid$</ProductGuid>
</PropertyGroup>
<ItemGroup>
<Compile Include="xx.pxs" /> <--pxs is used by the xxProj-->
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath)\SDKCompany\Exchange\$(SDKVersion)\SDKCompany.Xchng.Product.xx.Settings.targets" />
<Import Project="$(MSBuildExtensionsPath)\SDKCompany\Exchange\$(SDKVersion)\SDKCompany.Xchng.Product.xx.targets" />
</Project>