SDK里是这样描述发布步骤的:
要编辑 ISV.Config,请执行下列步骤:
- 使用“导出自定义项”导出 ISV.Config。
- 在导航窗格中,依次单击“设置”、“自定义”和“导出自定义项”。
- 选择 ISV.Config,然后在“操作”工具栏上单击“导出所选自定义项”。
- 创建导出的 XML 文件的备份副本。您可以使用此文件从错误中恢复。
- 对导出的 XML 文件进行更改。
- 使用“导入自定义项”工具导入更新的 XML 文件。
- 在导航窗格中,依次单击“设置”、“自定义”和“导入自定义项”。
- 找到修改后的 XML 文件,然后单击“上载”。
- 在“操作”工具栏上,单击“导入所有自定义项”。
其中第3步中只提到对XML文件进行更改,并没有明确更改方法,如果按照那样的步骤手动进行更改,在实际的项目部署中,明显是不可行的,找了许多资料,终于在一篇博客里提及代码实现的方法。
转自:http://krishchandrababu.spaces.live.com/blog/cns!F8384073BDA66530!423.entry
Use CRM webservice to change the Sitemap.xml or ISV.config, programatically.
To run this code you have to reference all the helper classes found in the new SDK 3.0.4 in the sdk samples/isvreadiness sub folder.
CrmService service=new CrmService();
service.Url="http://localhost/mscrmservices/2006/crmservice.asmx";
service.Credentials=System.Net.CredentialCache.DefaultCredentials;
ExportXmlRequest export=new ExportXmlRequest();
export.ParameterXml="<export><entities></entities><nodes><node>sitemap</node></nodes></export>";
ExportXmlResponse entities = (ExportXmlResponse)service.Execute(export);
XmlDocument siteMapXml=new XmlDocument();
siteMapXml.PreserveWhitespace=true;
siteMapXml.LoadXml(entities.ExportXml);
Microsoft.Crm.Sdk.IsvReadiness.SiteMapCustomizer siteMapEditor=
new Microsoft.Crm.Sdk.IsvReadiness.SiteMapCustomizer(siteMapXml);
Microsoft.Crm.Sdk.IsvReadiness.SupportingItems.SiteMap.SubArea subArea=
new Microsoft.Crm.Sdk.IsvReadiness.SupportingItems.SiteMap.SubArea();
subArea.Id="nav_sometest";
subArea.Title="Click me for happiness";
subArea.Icon="some.gif";
subArea.Url="/someurl.aspx";
siteMapEditor.AddSubArea("Settings", "Settings", subArea);
ImportXmlRequest import=new ImportXmlRequest();
import.ParameterXml="<import><entities></entities><nodes><node>sitemap</node></nodes></import>";
import.CustomizationXml=siteMapXml.OuterXml;
service.Execute(import);
Note: Please make sure you also add the correct using statements for the web service.
-That's all for now.
参考:http://community.dynamics.com/blogs/crmjimwangchinese/default.aspx?PageIndex=2