Please help me issue related to . net framework

Posted by Ckshailendra under BizTalk Server on 12/21/2012 | Points: 10 | Views : 1132 | Status : [Member] | Replies : 3
Could not write to output ile. process cannot be access the file beacuse it is being used by another application




Responses

Posted by: Pavanandey on: 12/21/2012 [Member] Bronze | Points: 25

Up
0
Down
Check if the file as been locked with other user

Thanks
Pavan Kumar
Mark Answer if this fits the need

Ckshailendra, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sandhyab on: 12/21/2012 [Member] Starter | Points: 25

Up
0
Down
If You used StreamReader sr = new StreamReader(rcvpath + "\\" + fileinfo.Name); Or stremwriter close it eg see this,
private void ProcessData(string rcvpath, string archpath)
{
DirectoryInfo dir = new DirectoryInfo(rcvpath);
string line;
foreach (FileInfo fileinfo in dir.GetFiles())
{
StreamReader sr = new StreamReader(rcvpath + "\\" + fileinfo.Name);
StreamWriter sw = new StreamWriter(tempPath + "\\" + fileinfo.Name);
while ((line = sr.ReadLine()) != null)
{//Code implementation

}
sr.Close();
sw.Close();
}
}

Ckshailendra, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Oliviajones on: 8/31/2013 [Member] Starter | Points: 25

Up
0
Down
If you have 2 version of VS.NET open, where one project is refernecing another, this can happen. Also, if you have a process manually load up an assembly, it will get a lock on it.

http://www.athenainfotech.co.uk/free-biztalk-health-check


Ckshailendra, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response