-
Notifications
You must be signed in to change notification settings - Fork 12
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源码包引用出错 #114
Comments
感觉可能有某个flag需要设置? @lindexi |
@Zhuangkh 也是已知问题之一,原因是缺少 .g 文件,没有此 InitializeComponent 方法。我也在寻找解决方法中 |
但是 WPF 的控件作为源代码包有一些锅,例如 XAML 资源获取的方式,通过程序集方式获取将不可行等。因此我不推荐将 WPF 的控件作为源代码包发布 |
实际上这种场景还是比较少的...碰巧测试到了 |
@lindexi 加了个Target强制生成.g文件来临时解决这个问题, 还没做更多的案例测试 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
如果一个WPF控件类库打包成源码包, 被另一个项目引用时, 如果项目中没有任何xaml文件, 则引用的源码包的控件会爆
The name 'InitializeComponent' does not exist in the current context
. (项目已启用UseWPF
,obj中不生成.g.i.cs)此时如果添加任意xaml窗体或控件进入项目, 则可以正常编译.(obj中有源码包的.g.i.cs文件生成)
再将添加的xaml文件删除, 哪怕obj中还是有源码包相关文件, 仍然会报错.
The text was updated successfully, but these errors were encountered: