在VS2013(使用适用于VS 2.0.11016的Python工具)中为我的VS2013的IronPython 2.7项目中添加了一个全新的未更改的WPF窗口之后,它立即在设计窗口中告诉我“无效标记”,并且错误列表显示:
Window is not supported in a Windows Presentation Foundation (WPF) project.
Grid is not supported in a Windows Presentation Foundation (WPF) project.
XAML窗口中包含以下无害的代码:
<Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Window1" Height="300" Width="300">
<Grid>
</Grid>
</Window>
VS的Python工具是否真的不支持表单创建?我忘了配置一些东西吗?
最佳答案
该项目是作为“IronPython Windows窗体应用程序”而不是“IronPython WPF应用程序”启动的,因此缺少相关的引用资料:
添加它们会使WPF表单起作用,或者只是重新创建项目。
如果所有这些引用似乎都在项目中,则删除/读取其中的一些引用可能会有所帮助。另一个用户报告说他必须为“PresentationFramework”这样做;也许有一对名字相同?
关于wpf - 向提示 "Window is not supported in a WPF project"添加新的IronPython WPF窗口,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22582094/