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

  • Home
  • SEARCH
  • 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 720985
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T05:49:16+00:00 2026-05-14T05:49:16+00:00

UnhandledException: System.ComponentModel.Win32Exception: No application is associated with the specified file for this operation at

  • 0
UnhandledException: System.ComponentModel.Win32Exception: No application is associated with the specified file for this operation
   at System.Diagnostics.Process.StartWithShellExecuteEx(ProcessStartInfo startInfo)
   at System.Diagnostics.Process.Start()
   at System.Diagnostics.Process.Start(ProcessStartInfo startInfo)
   at System.Diagnostics.Process.Start(String fileName)

Hi everyone,

I am getting the following exception on one machine I am testing on when trying to use Process.Start to open a .csv file. I think this is happening because no file association has been set for .csv files on this box.

So how would you avoid this situation?

Force the Process.Start to open in Notepad? – Ideally it should be opened in excel, but what do you do if excel then doesn’t exist on that computer?

Thanks

  • 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-14T05:49:16+00:00Added an answer on May 14, 2026 at 5:49 am

    If your application depends on Excel being installed to work properly and effectively, then bug the user about it. Catch the exception, and pop up a notification to tell them about the problem, but then in that notification give them an option to open it in an alternative editor such as notepad.

    This all boils down to good UX – tell the user, but do it in such a way that you are empowering them by offering options to continue, rather than just getting in their way and stopping when a little problem like that occurs.

    Edit: Do exactly what you are doing – don’t assume that they have Excel, they may have some other viewer/editor like OpenOffice. Whatever is registered to csv, let it do it’s thing. Don’t try to go and check the file association yourself, your app may not (probably won’t) have sufficient privileges to go fossicking around in the registry.

    You also need to check for other obvious reasons for exceptions, like the user doesn’t have rights to open the target file, this could be due to restrictions placed on the folder or the file itself. Maybe the file is locked because it is still open in another process. There are a bunch of reasons why your Process.Start could fail.

    Catch the exception, and if the cause is no application associated with the file then offer them the option. If the user chooses to use Notepad, try and open the file in Notepad, but still watch out for exceptions. Notepad is a good option, it doesn’t hold a lock on the file, but it is still subject to folder/file ACLs.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to use System.Windows.Forms.HTMLDocument in a console application. First, is this even possible?
I've tried this, but it doesn't seem to work: Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException); Application.ThreadException += new System.Threading.ThreadExceptionEventHandler(Application_ThreadException);
Consider this simple console application: using System; namespace Demo { class Program { static
Question: I catch generally unhandled exceptions with AddHandler System.AppDomain.CurrentDomain.UnhandledException, AddressOf OnUnhandledException The problem now
On the production server, I can see this event from system Event Viewer when
I tried using http://msdn.microsoft.com/en-us/library/system.windows.forms.application.threadexception.aspx#Y399 but when I do this throw new ArgumentNullException(playlist is empty);
First, within the Program.Program() static constructor I have this code: AppDomain.CurrentDomain.UnhandledException += (s, eargs)
I've recently switched over to handling my unhandled exceptions this way: Application.ThreadException += new
I am using system.timer in a windows service application (c#) and have added: AppDomain
I'me currently developing a silverlight application. In this application, I've an exception handler which

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.