Windows XP Service Pack 3を実行しています。Visual Studio 2010. C#プロジェクト。PresentationCore.dllが参照されていても "using System.Windows.Media"の認識されない
私は「System.Windows.Mediaを使用する」とクラスのプロジェクトで「System.Windows.Media.Imagingの使用」を含め。私はPresentationCore.dllリファレンスも追加しました。これはソリューションウィンドウで行いました。
いわゆる「インテリセンスは」赤いライニングでこれらの名前空間から来るすべての機能を。私はそれを修正するものはありません。コンパイラがPresentationCoreリファレンスを認識しないのはなぜですか?
私はこの問題を解決するためにFASTを必要としています。
は親切にも私を助けるためにある誰にもありがとう。
using System.Windows
using System.IO;
using System.Windows;
using System.Windows.Media;
using System.Windows.Media.Imaging;
namespace TextEditor
{
public partial class App : Application
{
AppDomain.CurrentDomain.UnhandledException += UnhandledExceptionOccurred;
}
private static void UnhandledExceptionOccurred(object sender, UnhandledExceptionEventArgs e)
{
Window win = Current.MainWindow;
RenderTargetBitmap bmp = new RenderTargetBitmap((int) win.Width, (int) win.Height, 96, 96, PixelFormats.Pbgra32);
bmp.Render(win);
string errorPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "ErrorReports");
if(!Directory.Exists(errorPath))
Directory.CreateDirectory(errorPath);
BitmapEncoder encoder = new PngBitmapEncoder();
encoder.Frames.Add(BitmapFrame.Create(bmp));
string filePath = Path.Combine(errorPath, string.Format("{0:MMddyyyyhhmmss}.png", DateTime.Now));
using(Stream stream = File.Create(filePath))
{
encoder.Save(stream);
}
}
}
http://social.msdn.microsoft.com/Forums/en-US/windowswic/thread/fdfff143-c1ae-41cd-bbeb-8ff6c1c879ecは、いくつかの手がかりを持っています。 –
タイトルに「Visual Studio .NET:」などのプレフィックスを付けないでください。それが[so]のタグに使われているものです。 –