Answer the question
In order to leave comments, you need to log in
C# Error creating file before form is run
In the program, the data is taken from the XML file
. When the file does not exist for the first time, an error is generated that the file does not exist.
Tried creating the file before running application.run(form1) etc.
Also tried to stop the thread for 10 seconds ( Thread.sleep(10000) ). The file was created, but after 10 seconds there was still a warning
How to create a file so that there is no error warning?
Answer the question
In order to leave comments, you need to log in
Apparently change the architecture and handle exceptions correctly. You can tell a lot here, look towards observer design patterns, look towards working with threads, in particular BackgroundWorker, etc.
Is the file read on request, or is there some kind of static singleton class that generates a link when it is created? Perhaps the generation of a link to the file occurs at the time of initialization.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question