3流プログラマのメモ書き

元開発職→社内SE→派遣で営業支援の三流プログラマのIT技術メモ書き。 このメモが忘れっぽい自分とググってきた技術者の役に立ってくれれば幸いです。(jehupc.exblog.jpから移転中)

VisualStudio無いけど、.Net Framework1.1のアプリを作りたい

検証で、.Net Framework1.1の HelloWorld アプリケーションを作る必要がありました。

しかし、.Net Framewrok1.1用のIDEである VisutalStudio2003 が有りません。

ということで、IDEを使わずにコンパイルしてみました。

コンパイルには、.NetFramework1.1 SDKが必要です。

インストールして、下記のようなコードを書き、C:\helloroworld.cs に保存しました。

namespace helloworld

{

using System;

using System.Text;

using System.Windows.Forms;

class helloworld

{

public static void Main()

{

//ビルドCLRバージョン取得

string clrVerBuild = System.Reflection.Assembly.GetExecutingAssembly().ImageRuntimeVersion;

clrVerBuild = "ビルドCLR ver:" + clrVerBuild + "\n";

//実行CLRバージョン取得

string clrVerRuntime = System.Runtime.InteropServices.RuntimeEnvironment.GetSystemVersion();

clrVerRuntime = "実行CLR ver:" + clrVerRuntime ;

MessageBox.Show( clrVerBuild + clrVerRuntime);

}

}

}

ビルドはコマンドプロンプトから、下記のようにしてやります。

C:\>C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\csc.exe C:\helloroworld.cs

Microsoft(R) Visual C# .NET Compiler version 7.10.6001.4

for Microsoft(R) .NET Framework version 1.1.4322

Copyright (C) Microsoft Corporation 2001-2002. All rights reserved.

これで、カレントフォルダにexeが出来ていはずです。

簡単ですね。

参考:

.NET Framework 開発環境構築