Pin*_*ing 4 .net c# .net-core uwp
是否有人成功.csproj为使用新的SDK样式.csproj格式的UWP项目创建了文件?我从有关WPF的问题中汲取了灵感,这使我90%地了解了WPF。
之后,我开始使用MSBuild.Sdk.Extras程序包,该程序包使我可以uap10.0作为进行访问<TargetFramework>,经过一些调整后,我实际上使用以下程序进行编译.csproj:
<Project Sdk="MSBuild.Sdk.Extras">
<PropertyGroup>
<!--UWP-specific properties-->
<TargetPlatformVersion Condition=" '$(TargetPlatformVersion)' == '' ">10.0.17134.0</TargetPlatformVersion>
<TargetPlatformMinVersion>10.0.17134.0</TargetPlatformMinVersion>
<TargetFrameworks>uap10.0</TargetFrameworks>
<OutputType>AppContainerExe</OutputType>
<LanguageTargets>$(MSBuildExtensionsPath)\Microsoft\WindowsXaml\v$(VisualStudioVersion)\Microsoft.Windows.UI.Xaml.CSharp.targets</LanguageTargets>
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
<PackageCertificateKeyFile>Test.UWP_TemporaryKey.pfx</PackageCertificateKeyFile>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)'=='Debug'">
<OutputPath>bin\x86\Debug\</OutputPath>
<DebugType>full</DebugType>
<PlatformTarget>x86</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)'=='Release'">
<OutputPath>bin\x86\Release\</OutputPath>
<DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
<Optimize>true</Optimize>
<PlatformTarget>x86</PlatformTarget>
<UseDotNetNativeToolchain>true</UseDotNetNativeToolchain>
</PropertyGroup>
<ItemGroup>
<!--XAML stuff-->
<ApplicationDefinition Include="App.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</ApplicationDefinition>
<Page Include="**\*.xaml" Exclude="App.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Compile Update="**\*.xaml.cs" SubType="Code" DependentUpon="%(Filename)" />
<AppxManifest Include="Package.appxmanifest">
<SubType>Designer</SubType>
</AppxManifest>
<!--Local projects-->
<!--Nuget references-->
</ItemGroup>
</Project>
Run Code Online (Sandbox Code Playgroud)
但是,仍然存在一些问题:
/bin目录似乎不包含依赖项.dll。(/ bin目录位于左侧的自定义项目,/ stock UWP项目在右侧。)...这导致生成的.exe在启动时立即崩溃。
有没有人建议如何使这件事到达终点?
〜编辑标记II:〜看起来当前的目标是通过WinUI 3.0的发布来支持.NET Core 3(这意味着新的.csproj样式),该发布的目标是“在2020年的某个时候”发布。
而且,万一这些链接消失了,第一个是指向WinUI GitHub问题的链接,其中WinUI项目的项目经理说
我们当前的计划是托管WinUI 3应用程序在发布时使用.NET Core 3而不是.NET Native。
第二个链接是WinUI项目的路线图,其中指出:
我们计划在2020年发布WinUI 3.0。
和
2.预览版本:我们计划在2020年上半年发布更完整的预览
〜编辑:〜在Build 2019上有一些安静的公告,即UWP将随着.NET Core 3的发布而开始在.NET Core运行时上运行。看来,这将涉及向UWP项目过渡到新的.csproj样式。好。
原始帖子:
现在看来答案是否定的。Per Oren Novotny,做出MS Build SDK Extras的聪明人:
当前,您不能将SDK样式的项目仅用于UWP类库用于应用程序本身。项目系统还需要支持以正确的方式部署和启动它。
| 归档时间: |
|
| 查看次数: |
703 次 |
| 最近记录: |