Windows App not launching

Kashish Goyal 1 Reputation point
2021-11-26T18:11:20.577+00:00

Hi,

I am working on a WPF windows application. Whenever I launch this App for the first time in my system it creates a folder insider temp of windows viz. temp/.net/{ProjectName}.

Sometimes the App doesn't launch until I clear this folder i.e. temp/.net/{ProjectName} so I have to first go and clear the temp folder and then my windows app gets launched.

Is there any permanent solution for this?

Windows Forms
Windows Forms
A set of .NET Framework managed libraries for developing graphical user interfaces.
1,903 questions
Windows Presentation Foundation
Windows Presentation Foundation
A part of the .NET Framework that provides a unified programming model for building line-of-business desktop applications on Windows.
2,784 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
11,010 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Ken Tucker 5,856 Reputation points
    2021-11-26T21:52:55.397+00:00

    You probably need to check if the folder exists before you create it.

          if(!Directory.Exists(path))
          {
                  Directory.CreateDirectory(path);
          }
    

    Would need to see code to give a better answer

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.