Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

添加对 WPF 的支持 #41

Merged
merged 2 commits into from
Jun 30, 2019
Merged

添加对 WPF 的支持 #41

merged 2 commits into from
Jun 30, 2019

Conversation

lindexi
Copy link
Member

@lindexi lindexi commented Jun 28, 2019

详细请看
从零开始制作 NuGet 源代码包(全面支持 .NET Core / .NET Framework / WPF 项目) - walterlv

#35

当前存在的一个问题是如果存在两个 xaml 文件的文件名相同,那么将会编译失败

解决方法是重命名

里面的更改请看博客

[从零开始制作 NuGet 源代码包(全面支持 .NET Core / .NET Framework / WPF 项目) - walterlv](https://blog.walterlv.com/post/build-source-code-package-for-wpf-projects.html )
@lindexi lindexi requested a review from walterlv June 28, 2019 13:19
@@ -1,5 +1,5 @@
<Project>
<Target Name="SourceYard" AfterTargets="Build"
<Target Name="SourceYard" AfterTargets="AfterBuild"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

如果目标项目使用 TargetFramework,那么 AfterBuild 可以生效,但如果是 TargetFrameworks,那么这个编译目标就不会执行了。可以考虑之后进行优化(目前还没有理清楚这两者之间的编译行为差别有多大)。

然而,我们可以通过欺骗的方式在主项目中通过 _GeneratedCodeFiles 集合将需要编译的文件传递到临时项目中以间接参与编译。
WPF 临时项目不会 Import NuGet 中的 props 和 targets 可能是 WPF 的 Bug,也可能是刻意如此。
所以我们通过一个属性开关 `ShouldFixNuGetImportingBugForWpfProjects` 来决定是否修复这个错误。-->
<ShouldFixNuGetImportingBugForWpfProjects Condition=" '$(ShouldFixNuGetImportingBugForWpfProjects)' == '' ">True</ShouldFixNuGetImportingBugForWpfProjects>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

可以附上链接了,因为这个问题据说在正式版可以解决掉,所以加到这里可以跟进这个属性的默认值:

@walterlv walterlv merged commit f88d98a into master Jun 30, 2019
@lindexi lindexi deleted the t/lindexi branch June 30, 2019 07:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants