Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6983979
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T18:29:26+00:00 2026-05-27T18:29:26+00:00

I running Windows XP Service Pack 3. Visual Studio 2010. C# project. I included

  • 0

I running Windows XP Service Pack 3. Visual Studio 2010. C# project.

I included a “Using System.Windows.Media” and “Using System.Windows.Media.Imaging” in a Class Project. I also Added the PresentationCore.dll Reference. This was done at the Solution Window.

The so-called “Intellisense” is red-lining all of the functions that come from those namespaces. Nothing I do fixes it. Why doesn’t the compiler recognize the PresentationCore reference?????

I need a solution to this problem FAST.

Thank you to anyone who is kind enough to help me.

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);
        }

    }
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T18:29:27+00:00Added an answer on May 27, 2026 at 6:29 pm

    Firstly, you cannot put method separately from the class even if the method is static. Try to do something like that:

        namespace TestProject
        {
            public partial class App : Application
            {
                public void Init()
                {
                    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);
                }
            }
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My Visual Studio 2010 (with Service Pack 1) install is corrupted. This is on
I have a batch file I'm running from a Windows XP w/service pack 3
I am running a windows service and using a loop and Thread.Sleep to repeat
I wrote a C++ project called 'Foo' using Microsoft Visual Studio 2005 Verison 8.0.50727.762
I'm running Windows 2003 Service Pack 2. I have a batch file that runs
I have have running windows service that is using it's app.config for getting some
We are running windows xp pro service pack 3 both 32 bit and 64
I have a Windows Service application (developed in C++) running under Local System account.
I have a windows service running as local system. I would like the service
I'm running Embedded Visual C++ 4 with service pack 4 , to develop an

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.