2012-12-15 28 views
1

當我在WMAppManifest.xml中添加用於快速應用恢復的屬性後嘗試編譯時,在我的計算機上嘗試的任何項目都會在VS2012中出現此錯誤: 「'ActivationPolicy屬性沒有聲明'Windows Phone 8快速應用恢復:未聲明'ActivationPolicy'屬性

我已經嘗試了3個不同的Windows Phone 8項目,其中包括來自Microsoft的一個示例,它們都在嘗試編譯時給出錯誤,它添加了此屬性, ActivationPolicy="Resume" 這一行: <DefaultTask Name="_default" NavigationPage="MainPage.xaml" />

我已經修好我的WP8安裝

+0

隨着這些項目你靶向WP8.0,而不是7.1,正確嗎? –

回答

2

好的,非常抱歉發佈此。我找到了自己的解決方案。

我剛完全卸載,然後重新安裝了Windows Phone 8 SDK。 (修復它沒有工作)

+1

我有同樣的問題。重新安裝爲我工作。 – djcouchycouch

+0

@SimzzDev回答你自己的問題是可取的,所以這是一件好事 - 事實上,你甚至可以看到你的解決方案幫助了我之上的人。 –

0

你會得到這個的另一個原因是因爲你有一箇舊的wp7項目尚未升級到WP8。

0

檢查文件YamanoteCommonTypes.xsd在C:\ Program Files文件(x86)的\微軟的Visual Studio 11.0 \ XML \架構

在該文件中,剪切粘貼&在現有的以下XML defitions:

<xs:simpleType name="ST_ActivationPolicyThirdParty"> 
<xs:annotation> 
    <xs:documentation> 
    The activation policy of a 3rd party task 
    </xs:documentation> 
</xs:annotation> 
<xs:restriction base="xs:string"> 
    <xs:enumeration value="Resume"/> 
    <xs:enumeration value="Replace"/> 
</xs:restriction> 
</xs:simpleType> 

<xs:complexType name="CT_ThirdPartyExtendedAppTask"> 
<xs:annotation> 
<xs:documentation> 
    Represents an entry point container 
</xs:documentation> 
</xs:annotation> 
<xs:sequence> 
    <xs:element name="BackgroundServiceAgent" type="CT_BackgroundServiceAgent" minOccurs="0" maxOccurs="unbounded"/> 
</xs:sequence> 
<xs:attribute name="Name" type="xs:ID" use="required"/> 
<!-- These attributes will only be parsed if the runtimetype is ST_RuntimeType::ModernNative --> 
<xs:attribute name="ImagePath" type="y:ST_String" use="optional" /> 
<xs:attribute name="ImageParams" type="y:ST_String" use="optional" /> 
</xs:complexType>