我正在VisualStudio 2012 for SharePoint 2010中的单个解决方案中开发多个Silverlight-Webparts。 有时在{Project1}中会出现此错误:
Error occurred in deployment step 'Activate Features':
Failed to instantiate file "SiteAssets/{Project1Folder}/$SilverlightXapFile$"
from module "Designer": Source path "Features\{Project1Folder}\{otherProject}.xap" not found.
Elements.xml的
<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/" >
<Module Name="{Module}" List="113" Url="_catalogs/wp">
<File Path="{Module}\{Webpart}.webpart" Url="{ProjectWebpart}.webpart" Type="GhostableInLibrary">
<Property Name="Group" Value="{Company}" />
</File>
</Module>
<Module Name="{Project}">
<File Path="{Project}\{Project1}.xap" Url="SiteAssets/{Project1Folder}/{Project1}.xap" />
<File Path="{Project}\{otherProject}.xap" Url="SiteAssets/{Project1Folder}/$SilverlightXapFile$" />
</Module>
</Elements>
感谢Subversion:我知道Visual Studio在{Project1} Webpart的Elements.xml中添加了一行。
<File Path="{Project}\{otherProject}.xap" Url="SiteAssets/{Project1Folder}/$SilverlightXapFile$" />
当我删除这个新行时,它会再次起作用。
我的问题: 如何防止VisualStudio在Elements.xml中将“错误”引用添加到同一解决方案中的其他Silverlight项目中?