System.IO.IOException was unhandled
I have just 2 lines of code -
File.Create (@"C:\test.test"); When I execute I get the following error and am not able to tackle this problem. System.IO.IOException was unhandled
File.Delete (@"C:\test.test");
Any help will be appreciated-
Message="The process cannot access the file 'C:\\test.test1' because it is being used by another process."
Source="mscorlib"
StackTrace:
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.FileInfo.Delete()
at ConsoleApplication4.Program.Main(String[] args) in C:\Documents and Settings\i032271\My Documents\Visual Studio Projects\ConsoleApplication4\Program.cs:line 31
at System.AppDomain.nExecuteAssembly(Assembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()

