开发者

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

开发者 https://www.devze.com 2023-01-20 21:24 出处:网络
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 b

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开发者_如何学Go.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.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消