Windows Mobile 设备指出找不到程序集 System.Windows.Forms 2.0.0.0
我是 .NET 编程的新手,我正在尝试使用 .NET Compact Framework 2.0 为 Windows Mobile 设备创建一个简单的 Windows 窗体应用程序。我使用 Boo 进行开发并使用 Nant 来构建我的应用程序。我的应用程序可以编译,但无法运行。当我在设备上启动该应用程序时,它指出找不到程序集 System.Windows.Forms 2.0.0.0。然而,Compact Framework 安装在设备上。该应用程序在桌面 Windows 安装上运行良好。
我的源代码:
import System.Drawing
import System.Windows.Forms
def Main():
button = Button(Text: "Ok", Location: Point(10, 10))
form = Form(Text: "Sample", FormBorderStyle: FormBorderStyle.FixedDialog, MaximizeBox: false, MinimizeBox: false, AcceptButton: button, StartPosition: FormStartPosition.CenterScreen)
form.ShowDialog()
我的 Nant 构建脚本:
<project name="Sample" default="compile">
<property name="dir.build" value="./build"/>
<property name="nant.settings.currentframework" value="netcf-2.0"/>
<target name="clean">
<delete dir="${dir.build}" failonerror="false"/>
</target>
<target name="compile">
<mkdir dir="${dir.build}"/>
<booc target="exe" output="${dir.build}/Sample.exe">
<sources basedir="./source">
<include name="**/*.boo"/>
</sources>
</booc>
</target>
</project>
这是否有一些简单的问题,或者我是否误解了有关程序集引用的某些内容?正如我所说,我对 .NET 开发相当陌生,并且不确切知道程序集引用是如何工作的。
I am a newbie to .NET programming and I'm trying to create a simple Windows Forms application for a Windows Mobile device using the .NET Compact Framework 2.0. I develop using Boo and using Nant to build my application. My application compiles but it won't run. When I launch the application on my devices it states that the assembly System.Windows.Forms 2.0.0.0 cannot be found. Compact Framework is however installed on the device. The application runs fine on a desktop Windows installation.
My source code:
import System.Drawing
import System.Windows.Forms
def Main():
button = Button(Text: "Ok", Location: Point(10, 10))
form = Form(Text: "Sample", FormBorderStyle: FormBorderStyle.FixedDialog, MaximizeBox: false, MinimizeBox: false, AcceptButton: button, StartPosition: FormStartPosition.CenterScreen)
form.ShowDialog()
My Nant build script:
<project name="Sample" default="compile">
<property name="dir.build" value="./build"/>
<property name="nant.settings.currentframework" value="netcf-2.0"/>
<target name="clean">
<delete dir="${dir.build}" failonerror="false"/>
</target>
<target name="compile">
<mkdir dir="${dir.build}"/>
<booc target="exe" output="${dir.build}/Sample.exe">
<sources basedir="./source">
<include name="**/*.boo"/>
</sources>
</booc>
</target>
</project>
Is there something simple thats wrong with this or have I misunderstood something regarding assembly references? As I said, I'm rather new to .NET development and don't know exactly how assembly references work.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
结果 Boo 不支持紧凑框架。 Boo.Lang.dll 程序集使用 CF 中不可用的功能。然而,这并不能解释我得到的错误,但我最好的猜测是,Nant 允许 Boo 编译器使用完整 .NET 框架中的程序集,即使我已指定 .NET CF 2.0 应该是“当前框架”。问题可能在于我对南特对“当前框架”的理解。
Turns out Boo doesn't support the compact framework. The Boo.Lang.dll assembly uses functionality not available in CF. That does however not explain the error I have gotten but my best guess is that Nant allows the Boo compiler to use assemblies from the full .NET framework even though I have specified that .NET CF 2.0 should be the "current framework". It is probably my understanding of what Nant means with "current framework" that is the problem.