please need help in this code error "source 5156 NewestCOServer"

06/05/2018 15:07 traplx#1
hello guys i'm looking for help about this error in an 5156 source "NewestCOServer"
this the error i got ...
any hint please, thanks
Code:
System.IO.IOException: The process cannot access the file 'C:\Era_Conquer_database\Users\Characters\desil.chr' because it is being used by another process.
   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
   at System.IO.File.InternalWriteAllBytes(String path, Byte[] bytes, Boolean checkHost)
   at System.IO.File.WriteAllBytes(String path, Byte[] bytes)
   at NewestCOServer.Database.SaveCharacter(Character C, String Acc) in c:\Era_Conquer\Era_Conquer_source\Database.cs:line 4120
06/05/2018 17:06 Spirited#2
As the error says... it can't access a file because it's opened by another program...
How much more of a "hint" do you really need?
06/05/2018 17:21 traplx#3
Quote:
Originally Posted by Spirited View Post
As the error says... it can't access a file because it's opened by another program...
How much more of a "hint" do you really need?
i know that bro but the source not used by another thing what that mean !
06/05/2018 18:10 Spirited#4
Quote:
Originally Posted by traplx View Post
i know that bro but the source not used by another thing what that mean !
Likely you terminated the program incorrectly or it's still running. Restart your computer? I see you're using an out of community source, so I guess it could always be a thread safety issue. In which case, adding a lock would fix it... But it's not optimal.
06/06/2018 10:52 Super Aids#5
Quote:
Originally Posted by Spirited View Post
Likely you terminated the program incorrectly or it's still running. Restart your computer? I see you're using an out of community source, so I guess it could always be a thread safety issue. In which case, adding a lock would fix it... But it's not optimal.
Or it's because the file handling does not dispose properly in the source, because it doesn't use using statements and/or exceptions happen and you don't have finally blocks where you manually dispose.

Overall the source it's trash and this is the least of the issues in the source.

@OP have fun trying to solve the concurrency / synchronization issues afterwards :)
06/06/2018 17:17 Spirited#6
Quote:
Originally Posted by Super Aids View Post
Or it's because the file handling does not dispose properly in the source, because it doesn't use using statements and/or exceptions happen and you don't have finally blocks where you manually dispose.

Overall the source it's trash and this is the least of the issues in the source.

@OP have fun trying to solve the concurrency / synchronization issues afterwards :)
^ Much more likely.
06/06/2018 17:20 sNk|Tools#7
PM on private!
06/06/2018 21:24 Spirited#8
Quote:
Originally Posted by sNk|Tools View Post
PM on private!
For a reason. Not interested.
Keep the conversation public so others can pitch in.