Elements.xml文件中是否缺少“模块”部分会导致“在部署步骤中出现错误392错误'激活特征':由于对象的当前状态,操作无效”。为什么我会收到“部署步骤中出现错误392错误'激活功能':由于对象的当前状态,操作无效”。
突然间,我试图重建Sharepoint Web部件时出现此错误。 One thing I researched表示可能Elements.xml存在问题。我没有在很长一段时间在这个改变anythying,我也没有改变任何东西明确的,我不觉得,但在这里它是目前的情况是:
<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<Receivers ListTemplateId="104">
<Receiver>
<Name>PostTravelItemEventReceiverItemAdded</Name>
<Type>ItemAdded</Type>
<Assembly>$SharePoint.Project.AssemblyFullName$</Assembly>
<Class>PostTravelWizard.PostTravelItemEventReceiver.PostTravelItemEventReceiver</Class>
<SequenceNumber>10000</SequenceNumber>
</Receiver>
<Receiver>
<Name>PostTravelItemEventReceiverContextEvent</Name>
<Type>ContextEvent</Type>
<Assembly>$SharePoint.Project.AssemblyFullName$</Assembly>
<Class>PostTravelWizard.PostTravelItemEventReceiver.PostTravelItemEventReceiver</Class>
<SequenceNumber>10000</SequenceNumber>
</Receiver>
</Receivers>
</Elements>
因此,所有它现在是一个参考我添加的两个“事件接收器”处理程序;我将这个非工作项目的Elements.xml文件与我有的其他Elements.xml文件(来自可以工作的Web部件)进行了比较;其中之一是这样的:
<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/" >
<Module Name="TravelFormHelpWebPart" List="113" Url="_catalogs/wp">
<File Path="TravelFormHelpWebPart\TravelFormHelpWebPart.webpart" Url="TravelFormHelpWebPart.webpart" Type="GhostableInLibrary" >
<Property Name="Group" Value="Financial Affairs Forms" />
</File>
</Module>
</Elements>
...另一种是非常相似的,就像这样:
<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/" >
<Module Name="DPSVisualWebPart" List="113" Url="_catalogs/wp">
<File Path="DPSVisualWebPart\DPSVisualWebPart.webpart" Url="DPSVisualWebPart.webpart" Type="GhostableInLibrary" >
<Property Name="Group" Value="Financial Affairs Forms" />
</File>
</Module>
</Elements>
的差异似乎是工作Web应用程序有一个“模块”在他们的Elements.xml部分文件
还有另外一个线索,也从上面的链接,即:
如果步骤2无法解决错误,请检查您deplo yment目标被设置为“WebApplication”。它需要被设置为“Global AssemblyCache”。
......这里也是这样,这个非工作的WebPart被设置为“WebApplication”,而其他设置为“GAC”)。然而,改变并没有帮助 - 我仍然得到了与上面报告的相同的错误信息。因此,如果缺少“模块”部分是问题,那显然是早些时候(当它工作时),并以某种方式得到了86'd(随着项目的“Assembly Deployment Target”属性的改变,显然) 。为什么会这样/怎么会发生?