使用MSIX发布WPF核心…多个问题
编辑#1开始 要复制这一点:使用MSIX发布WPF核心…多个问题,wpf,deployment,core,msix,Wpf,Deployment,Core,Msix,编辑#1开始 要复制这一点: 创建一个新的“普通”WPF应用程序寻址.Net Core 3.1 将Windows应用程序打包项目添加到解决方案中(按照中提到的步骤操作) 尝试“部署”到UNC路径 编辑#1结束 我正在将WPF.NETFramework应用程序转换为.NETCore3.1。此应用程序是一个“内部”工具,我们始终使用ClickOnce将创建设置放置在共享UNC路径上进行部署。这么简单 我现在已经在.NETCore中重新编写了它,需要部署它。发现“ClickOnce”不再可用,我明白
Windows应用程序打包项目添加到解决方案中(按照中提到的步骤操作)
我正在将WPF.NETFramework应用程序转换为.NETCore3.1。此应用程序是一个“内部”工具,我们始终使用ClickOnce将创建设置放置在共享UNC路径上进行部署。这么简单 我现在已经在.NETCore中重新编写了它,需要部署它。发现“ClickOnce”不再可用,我明白我必须走“MSIX”路线。文档看起来应该很简单,但我想我遗漏了一些东西 1-我不得不将开发人员设置从“侧栏”更改为“开发人员模式” 2-它在我的机器上构建良好,但在Azure DevOps上失败 3-我如何实际部署它 让我们依次看看每一个 1-侧栏=>开发者模式问题 我将一个新的Windows应用程序打包项目添加到我的解决方案中,为目标版本和最低版本选择Windows版本1909,并将我的WPF应用程序设置为入口点。我尝试运行它,它迫使我从“侧栏”更改为“开发人员模式” 这是否只会影响到我作为开发人员……如果是这样,那没关系。我怀疑最终用户是否愿意这样做 2-Azure DevOps构建管道失败 在本地,它编译得很好,即使在发布模式下,我将所有警告设置为Error,并运行FxCop。将其推到Azure,它会显示: [错误]C:\Program Files\dotnet\sdk\3.1.201\sdk\Microsoft.NET.sdk\targets\Microsoft.PackageDependencyResolution.targets(234,5): 错误NETSDK1047:资产文件 “d:\a\1\s\MyApp\MyApp\obj\project.assets.json”没有“.NETCoreApp,Version=v3.1/win-x86”的目标。
确保恢复已运行 并且您已将“netcoreapp3.1”包含在的TargetFramework中 您的项目。
您可能还需要将“win-x86”包含在 项目的运行时标识符 好的
- 我的YAML文件在构建之前有一个“Restore NuGet Packages”步骤 成功了李>
- 我在我的SKD项目文件中查找我的申请和
我看到
netcoreapp3.1
- 关于“RuntimeIdentifiers”,我发现这样添加的链接
紧靠win-x64;win-x86
(我是否应该更具体地使用netcoreapp3.1
?)win10-x64;win10-x86
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>netcoreapp3.1</TargetFramework>
<RuntimeIdentifiers>win-x64;win-x86</RuntimeIdentifiers>
<UseWPF>true</UseWPF>
</PropertyGroup>
温克斯
netcoreapp3.1
win-x64;win-x86
真的
一揽子计划是:
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Condition="'$(VisualStudioVersion)' == '' or '$(VisualStudioVersion)' < '15.0'">
<VisualStudioVersion>15.0</VisualStudioVersion>
</PropertyGroup>
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|x86">
<Configuration>Debug</Configuration>
<Platform>x86</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x86">
<Configuration>Release</Configuration>
<Platform>x86</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|ARM">
<Configuration>Debug</Configuration>
<Platform>ARM</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|ARM">
<Configuration>Release</Configuration>
<Platform>ARM</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|ARM64">
<Configuration>Debug</Configuration>
<Platform>ARM64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|ARM64">
<Configuration>Release</Configuration>
<Platform>ARM64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|AnyCPU">
<Configuration>Debug</Configuration>
<Platform>AnyCPU</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|AnyCPU">
<Configuration>Release</Configuration>
<Platform>AnyCPU</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup>
<WapProjPath Condition="'$(WapProjPath)'==''">$(MSBuildExtensionsPath)\Microsoft\DesktopBridge\</WapProjPath>
</PropertyGroup>
<Import Project="$(WapProjPath)\Microsoft.DesktopBridge.props" />
<PropertyGroup>
<ProjectGuid>08b169a2-6461-440b-afa1-ca35c7d98aa7</ProjectGuid>
<TargetPlatformVersion>10.0.18362.0</TargetPlatformVersion>
<TargetPlatformMinVersion>10.0.18362.0</TargetPlatformMinVersion>
<DefaultLanguage>en-US</DefaultLanguage>
<AppxPackageSigningEnabled>True</AppxPackageSigningEnabled>
<EntryPointProjectUniqueName>..\MyApp\MyApp.csproj</EntryPointProjectUniqueName>
<PackageCertificateThumbprint>01C08F1E21D5624A484DB362BE4F056504B825CC</PackageCertificateThumbprint>
</PropertyGroup>
<ItemGroup>
<AppxManifest Include="Package.appxmanifest">
<SubType>Designer</SubType>
</AppxManifest>
</ItemGroup>
<ItemGroup>
<Content Include="Images\SplashScreen.scale-200.png" />
<Content Include="Images\LockScreenLogo.scale-200.png" />
<Content Include="Images\Square150x150Logo.scale-200.png" />
<Content Include="Images\Square44x44Logo.scale-200.png" />
<Content Include="Images\Square44x44Logo.targetsize-24_altform-unplated.png" />
<Content Include="Images\StoreLogo.png" />
<Content Include="Images\Wide310x150Logo.scale-200.png" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\MyApp\MyApp.csproj">
<SkipGetTargetFrameworkProperties>True</SkipGetTargetFrameworkProperties>
</ProjectReference>
</ItemGroup>
<Import Project="$(WapProjPath)\Microsoft.DesktopBridge.targets" />
</Project>
15
调试
x86
释放
x86
调试
x64
释放
x64
调试
手臂
释放
手臂
调试
ARM64
释放
ARM64
调试
任意CPU
释放
任意CPU
$(MSBuildExtensionsPath)\Microsoft\DesktopBridge\
08b169a2-6461-440b-afa1-ca35c7d98aa7
10.0.18362.0
10.0.18362.0
恩美
真的
..\MyApp\MyApp.csproj
01C08F1E21D5624A484DB362BE4F056504B825CC
设计师
真的
(我是否可以/应该删除我认为不相关的对“调试”和“ARM”的引用??)
舱单是
<?xml version="1.0" encoding="utf-8"?>
<Package
xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10"
xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10"
xmlns:rescap="http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities"
IgnorableNamespaces="uap rescap">
<Identity
Name="46aebba6-d403-4412-89c0-05279b36e54e"
Publisher="CN=MyCompany"
Version="2020.5.0.0" />
<Properties>
<DisplayName>MyApp</DisplayName>
<PublisherDisplayName>MyCompany</PublisherDisplayName>
<Logo>Images\StoreLogo.png</Logo>
</Properties>
<Dependencies>
<TargetDeviceFamily Name="Windows.Desktop" MinVersion="10.0.14393.0" MaxVersionTested="10.0.14393.0" />
</Dependencies>
<Resources>
<Resource Language="x-generate"/>
</Resources>
<Applications>
<Application Id="App"
Executable="$targetnametoken$.exe"
EntryPoint="$targetentrypoint$">
<uap:VisualElements
DisplayName="MyApp.Package"
Description="MyApp.Package"
BackgroundColor="transparent"
Square150x150Logo="Images\Square150x150Logo.png"
Square44x44Logo="Images\Square44x44Logo.png">
<uap:DefaultTile Wide310x150Logo="Images\Wide310x150Logo.png" />
<uap:SplashScreen Image="Images\SplashScreen.png" />
</uap:VisualElements>
</Application>
</Applications>
<Capabilities>
<Capability Name="internetClient" />
<rescap:Capability Name="runFullTrust" />
</Capabilities>
</Package>
MyApp
我的公司
Images\StoreLogo.png
谢谢 请在.wapproj项目文件中添加
<PropertyGroup>
<ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>
None
</ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>
</PropertyGroup>
没有一个
在Visual Studio 2019中,如果右键单击Windows应用程序打包项目,应该会有一个“发布|创建应用程序包”选项。@mm8-啊,谢谢你…我怎么没发现?我想我不是在“发布”下找的。尽管如此,我还是得到了一个似乎足够清晰的错误(见下一条评论)。我只是不确定如何修复:错误:正在构建的项目的处理器体系结构“MSIL”与参考“C:\MyApp\MyApp\bin\x86\Release\netcoreapp3.1\win-x86\MyApp.dll”、“x86”的处理器体系结构之间存在不匹配。这种不匹配可能会导致运行时失败。请考虑通过配置管理器更改项目的目标处理器体系结构,以便在项目和引用之间对齐处理器体系结构,或者依赖于与TARG相匹配的处理器体系结构对引用的依赖性。