Shared Source Common Language Infrastructure 2.0

CLIのソース。
Shared Source Common Language Infrastructure 2.0
http://www.microsoft.com/downloads/details.aspx?FamilyID=8c09fd61-3f26-4555-ae17-3121b4f51d4d&DisplayLang=en

これなんだけど。VS2008ではこいつをそのまま動かせないわけで。
http://blogs.msdn.com/jeremykuhne/archive/2008/02/19/sscli-2-0-and-visual-studio-2008.aspx

それでも出るエラーC4819
VSのバグっぽいんだけど。unicodeに変えてもエラーはくし。
もともと依存文字含まれてないのにエラー出るんだからそれは想定内ではあるんだが。

env/bin/devdiv.def の /WX とったら警告ですむのでそれでビルド。
あーめんどくせ。

副産物(ワラ

if ( DialogResult.OK != MessageBox.Show( string.Format(
		"{0}から{1}へ変換します。", comboBox1.SelectedItem, comboBox2.SelectedItem
	) ,"", MessageBoxButtons.OKCancel )
) {
	return;
}

Encoding fromEncode = Encoding.GetEncoding( comboBox1.SelectedItem.ToString() );
Encoding toEncode = Encoding.GetEncoding( comboBox2.SelectedItem.ToString() );

foreach ( ListViewItem item in fileDropableViewer1.Items ) {
	string content = "";
	string filePath = item.SubItems[0].Text;
	using (StreamReader reader = new StreamReader( filePath, fromEncode )) {
		content = reader.ReadToEnd();
	}

	using (StreamWriter writer = new StreamWriter( filePath, false, toEncode )) {
		writer.Write( content );
	}
}
MessageBox.Show( "おわり。" );

Freeであったんだが指定がめんどかった。上書きでいいだろjk