SharpDevelop Community

Get your problems solved!
Welcome to SharpDevelop Community Sign in | Join | Help
in Search

Matt Ward

February 2006 - Posts

  • Targeting Different Frameworks with VB.NET

    SharpDevelop 2.1, revision 1157, allows VB.NET projects to target the older Microsoft Frameworks and Mono. This extends Daniel's previous work to target different frameworks with C#. SharpDevelop 2.1 is only available from the repository.

    To target a different framework, open the project's "Compiling" options (Project | Project Options | Compiling) and select the desired framework from the "Target Framework" drop down list.

    MonoBASIC

    When Mono is targeted, the MonoBASIC compiler (mbas) will be used.  This compiler is still under going a lot development, so there are a few things that are missing or have incomplete support.  One omission, for example, is that it will not embed resources into an assembly.

    SharpDevelop now contains Gtk# project and file templates for VB.NET.  There is no Glade# project template for VB.NET since MonoBASIC does not currently support embedded resources.

    Issues

    There are a few things to be aware of when using SharpDevelop to target the older frameworks.

    Code completion for certain core assemblies will only show .NET 2.0 information.  These core assemblies are:
    • mscorlib
    • System
    • System.Data
    • System.Design
    • System.DirectoryServices
    • System.Drawing
    • System.Web.Services
    • System.Windows.Forms
    • System.Xml
    • Microsoft.Build.Engine
    • Microsoft.Build.Framework

    The Forms Designer will generate .NET 2.0 code only.

    The Forms Designer will generate .NET 2.0 specific resources.

    Alternative Solutions

    Robert McLaws produced an MSBuild toolkit for Visual Studio 2005 RC, but this does not look like it supports the latest version of Visual Studio.

    Jomo Fisher produced a targets file, for C# projects, that can be used to target the older Microsoft frameworks.  This targets file is a sample that supports Visual Studio beta 2.

    Microsoft recently released an MSBuild toolkit for .NET 1.1 called MSBee.  This adds support for targeting .NET 1.1 with VB.NET as well as C# projects.  It will also generate .NET 1.x resources from .NET 2.0 resx files.

    [Update 30 August 2006] 

    From version 1.1.17 Mono no longer ships with the MonoBASIC compiler. When the new VB compiler for Mono is released SharpDevelop 2.1 will be updated to support it.

    Posted Feb 18 2006, 05:09 PM by MattWard with no comments
    Filed under: ,
Powered by Community Server (Commercial Edition), by Telligent Systems
Don't contact us via this (fleischfalle@alphasierrapapa.com) email address.