我的UWP应用有这些package.manifest扩展内容:
<Extensions>
<Extension Category="windows.activatableClass.inProcessServer">
<InProcessServer>
<Path>MobilePos.Win10.exe</Path>
<ActivatableClass ActivatableClassId="PclUtilitiesUniversel.CompanionInfo" ThreadingModel="both" />
<ActivatableClass ActivatableClassId="PclUtilitiesUniversel.DeviceManager" ThreadingModel="both" />
</InProcessServer>
</Extension>
<Extension Category="windows.activatableClass.inProcessServer">
<InProcessServer>
<Path>PCLServiceUniversel.dll</Path>
<ActivatableClass ActivatableClassId="PCLServiceUniversel.TransOut" ThreadingModel="both" />
<ActivatableClass ActivatableClassId="PCLServiceUniversel.PCLService" ThreadingModel="both" />
<ActivatableClass ActivatableClassId="PCLServiceUniversel.TransIn" ThreadingModel="both" />
</InProcessServer>
</Extension>
</Extensions>
但是当我编译(尝试在调试/发布模式下重建)项目时,生成的appxmanifest.xml会自动添加一个新的“CLRHost.dll”标记,这会生成错误(在Visual Studio 2015中):
错误C00CE012:应用清单验证错误:应用清单必须 根据架构有效:第63行,第8列,原因:基于量子 definito nella DTD o nello schema,il contenuto dell'elemento “{http://schemas.microsoft.com/appx/manifest/foundation/windows10} InProcessServer” è不完整。 Previsto: {http://schemas.microsoft.com/appx/manifest/foundation/windows10} ActivatableClass。
<Extensions>
<Extension Category="windows.activatableClass.inProcessServer">
<InProcessServer>
<Path>MobilePos.exe</Path>
<ActivatableClass ActivatableClassId="PclUtilitiesUniversel.CompanionInfo" ThreadingModel="both" />
<ActivatableClass ActivatableClassId="PclUtilitiesUniversel.DeviceManager" ThreadingModel="both" />
</InProcessServer>
</Extension>
<Extension Category="windows.activatableClass.inProcessServer">
<InProcessServer>
<Path>PCLServiceUniversel.dll</Path>
<ActivatableClass ActivatableClassId="PCLServiceUniversel.TransOut" ThreadingModel="both" />
<ActivatableClass ActivatableClassId="PCLServiceUniversel.PCLService" ThreadingModel="both" />
<ActivatableClass ActivatableClassId="PCLServiceUniversel.TransIn" ThreadingModel="both" />
</InProcessServer>
</Extension>
<Extension Category="windows.activatableClass.inProcessServer">
<InProcessServer>
<Path>CLRHost.dll</Path>
</InProcessServer>
</Extension>
</Extensions>
为什么在构建标记时会添加“ CLRHost.dll ”? 清单数据中哪里错了?
感谢您的任何建议, Lewix
更新 似乎只添加了这些标签(只有一个dll)项目构建成功
<Extensions>
<Extension Category="windows.activatableClass.inProcessServer">
<InProcessServer>
<Path>PCLServiceUniversel.dll</Path>
<ActivatableClass ActivatableClassId="PCLServiceUniversel.TransOut" ThreadingModel="both" />
<ActivatableClass ActivatableClassId="PCLServiceUniversel.PCLService" ThreadingModel="both" />
<ActivatableClass ActivatableClassId="PCLServiceUniversel.TransIn" ThreadingModel="both" />
</InProcessServer>
</Extension>
</Extensions>
答案 0 :(得分:1)
为什么在构建标签时会添加“CLRHost.dll”?清单数据中哪里错了?
您可以参考官方文件:Side-loaded applications in detail。据说:还有一个细节:在侧载应用程序的清单中声明RuntimeClass的可用性。
您可以按照VS2015TemplateBrokeredComponents指令配置清单文件。
No.9步骤:更新AppxManifest以指定Brokered组件的定义使用此XML的位置:
<Extensions>
< Extension Category="windows.activatableClass.inProcessServer">
<InProcessServer>
<Path>clrhost.dll</Path>
<ActivatableClass ActivatableClassId="[Fully Qualified Name of Brokered Component]" ThreadingModel="MTA">
<ActivatableClassAttribute Name="DesktopApplicationPath" Type="string" Value="[Path to location of Brokered Components and ProxyStub]" />
</ActivatableClass>
</InProcessServer >
</Extension>
</Extensions>