简体   繁体   English

Windows Mobile设备指出找不到程序集System.Windows.Forms 2.0.0.0

[英]Windows Mobile device states that the assembly System.Windows.Forms 2.0.0.0 cannot be found

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. 我是.NET编程的新手,我正在尝试使用.NET Compact Framework 2.0为Windows Mobile设备创建一个简单的Windows Forms应用程序。 I develop using Boo and using Nant to build my application. 我使用Boo和Nant开发应用程序。 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. 当我在设备上启动应用程序时,它指出找不到程序集System.Windows.Forms 2.0.0.0。 Compact Framework is however installed on the device. 但是,Compact Framework已安装在设备上。 The application runs fine on a desktop Windows installation. 该应用程序在桌面Windows安装上运行良好。

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: 我的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>

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. 就像我说的那样,我是.NET开发的新手,也不知道程序集引用是如何工作的。

Turns out Boo doesn't support the compact framework. 事实证明,Boo不支持紧凑型框架。 The Boo.Lang.dll assembly uses functionality not available in CF. Boo.Lang.dll程序集使用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". 但这并不能解释我得到的错误,但是我最大的猜测是,即使我已指定.NET CF 2.0应该是“当前框架”,Nant仍允许Boo编译器使用整个.NET框架中的程序集。 It is probably my understanding of what Nant means with "current framework" that is the problem. 问题可能在于我对Nant对“当前框架”的含义的理解。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM