473,325 Members | 2,860 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,325 software developers and data experts.

Could not write to output file ...it is being used by another process

I am having serious problems with the following IDE bug:
Could not write to output file 'x.dll' -- 'The process cannot access the
file because it is being used by another process. '

and

BUG: "Could Not Copy Temporary Files to the Output Directory" Error Message
When You Build a Solution That Contains Multiple Projects

I have tried all the solutions in Microsoft Knowledge Base Article - 313512.
They have not solved the problem for me. I have had these problems in VS.NET
2003 and VS.NET 2003 for more than a year. They happen on a project that has
several large assemblies and several levels of project dependencies.

My problem is very much like what was described in the folllowing post. Any
help is GREATLY appreciated!
Dave

From: Simon Weaver (fl***@simonweaver.com)
Subject: still problems with Could not copy temporary files to the output
directory
View this article only
Newsgroups: microsoft.public.dotnet.languages.csharp
Date: 2002-12-11 11:45:46 PST

There appears to be a problem with DLLs > 64KB and i get errors like :

"Unexpected error writing metadata to file 'C:\Documents and
Settings\Simon.SIMON_DEV\My Documents\Visual Studio
Projects\XXX\BusinessCS\obj\Debug\BusinessCS.dll' -- 'Access is denied. '"

and

Could not write to output file 'C:\Documents and Settings\Simon.SIMON_DEV\My
Documents\Visual Studio Projects\ITD
Database\BusinessCS\obj\Debug\BusinessCS.dll' -- 'The process cannot access
the file because it is being used by another process. '

and more commonly

Could not copy assembly to output directory.... The file is being used by
another process.

This is a known problem. In the ASP.NET world it has something to do with
leading slashes on directory names.
I am using windows forms so this does not apply.

One of my core DLLS has just passed the 64kb barrier, and now this problem
has become so severe I cannot even continue working.

I do not have all my DLLs going to the same output path, which some people
says was the problem. All the DLLs go to different directories, but I have
the CopyLocal option enabled so effectively they do all end up in the same
directory.

I have a VB project referencing a C# project, both of which are > 64kb. The
problem seems to be more evident with cross language references, but I dont
see why.
Nov 15 '05 #1
4 8278
You also need to make sure the class browser is closed. It will keep open
and lock output files.

--
--Grant
This posting is provided "AS IS" with no warranties, and confers no rights.
Nov 15 '05 #2
Yes, I've read that too. There seems to be something else going on that is
not mentioned in any of the KB articles so far. I suspect it is related to
large assemblies together with more levels of dependencies (but I'm not
sure).
Dave

"Grant Richins [MS]" <gr*****@online.microsoft.com> wrote in message
news:O$**************@tk2msftngp13.phx.gbl...
You also need to make sure the class browser is closed. It will keep open
and lock output files.

--
--Grant
This posting is provided "AS IS" with no warranties, and confers no rights.

Nov 15 '05 #3
One other problem I have found is concerning inherited forms.
If you have an inherited form and it's in an other project that is in
referenced it loads the dll from the obj directory, instead of the
temporary folder where you will see other dll's loaded from, while compiling
and then you are screwed...

Just start up a debugger session on devenv.exe then compile and you will see
the assemblies that are loaded and if any assemblies are loaded from the
obj directory forget it. Restart VS.

This was such a problem that we changed the way we worked. Split up projects
in multiple Solutions (so we have about 10 projects per Solution). We have a
common directory where all files from the builds are copied and we have
assembly references (to the assemblies in other solutions) in the projects
instead of project references. We built a tool that does all the compiling
and copying and running and attaching to a debugger. Ever since never had a
cannot copy file and life is good.

Chris.
"Mountain Bikn' Guy" <vc@attbi.com> wrote in message
news:kdYgb.522487$Oz4.380130@rwcrnsc54...
Yes, I've read that too. There seems to be something else going on that is
not mentioned in any of the KB articles so far. I suspect it is related to
large assemblies together with more levels of dependencies (but I'm not
sure).
Dave

"Grant Richins [MS]" <gr*****@online.microsoft.com> wrote in message
news:O$**************@tk2msftngp13.phx.gbl...
You also need to make sure the class browser is closed. It will keep open and lock output files.

--
--Grant
This posting is provided "AS IS" with no warranties, and confers no

rights.


Nov 15 '05 #4
Wow! Thanks for the feedback. I think you have identified the cause of the
issue that I've been struggling with!

Now all I need is a custom tool like you have for compiling and debugging
the multiple solutions as one...

I hope MS takes note of this issue and provides some assistance. This
problem has existed in VS.NET in both 2002 and 2003 versions. Somehow it
seems MS doesn't understand the problem (or even that there is a problem
beyond the scope of Knowledge Base Article 313512) -- but you guys have
identified it and fixed it. Maybe your company could bring it to their
attention.

And maybe you should sell your custom tool to people like me...

Regards,
Dave
"Christian Boult" <ch******@hotmail.com> wrote in message
news:%2******************@TK2MSFTNGP09.phx.gbl...
One other problem I have found is concerning inherited forms.
If you have an inherited form and it's in an other project that is in
referenced it loads the dll from the obj directory, instead of the
temporary folder where you will see other dll's loaded from, while compiling and then you are screwed...

Just start up a debugger session on devenv.exe then compile and you will see the assemblies that are loaded and if any assemblies are loaded from the
obj directory forget it. Restart VS.

This was such a problem that we changed the way we worked. Split up projects in multiple Solutions (so we have about 10 projects per Solution). We have a common directory where all files from the builds are copied and we have
assembly references (to the assemblies in other solutions) in the projects
instead of project references. We built a tool that does all the compiling
and copying and running and attaching to a debugger. Ever since never had a cannot copy file and life is good.

Chris.
"Mountain Bikn' Guy" <vc@attbi.com> wrote in message
news:kdYgb.522487$Oz4.380130@rwcrnsc54...
Yes, I've read that too. There seems to be something else going on that is
not mentioned in any of the KB articles so far. I suspect it is related to large assemblies together with more levels of dependencies (but I'm not
sure).
Dave

"Grant Richins [MS]" <gr*****@online.microsoft.com> wrote in message
news:O$**************@tk2msftngp13.phx.gbl...
You also need to make sure the class browser is closed. It will keep

open and lock output files.

--
--Grant
This posting is provided "AS IS" with no warranties, and confers no

rights.



Nov 15 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

18
by: jas | last post by:
Hi, I would like to start a new process and be able to read/write from/to it. I have tried things like... import subprocess as sp p = sp.Popen("cmd.exe", stdout=sp.PIPE)...
0
by: Ben | last post by:
All of sudden, compiling my c# program fails with the following error: error CS0016: Could not write to output file '...\myapp.exe' -- 'The process cannot access the file because it is being...
3
by: Daniel Billingsley | last post by:
Today I went to compile a solution I've been working on for months. I've been off most of the last few months, so there's been a gap in the work, but I did compile it a few times earlier this...
3
by: lasmit | last post by:
I am having some troubles with a project I am working on not building correctly. I converted an old ASP project to .Net and then have been adding pages to the project in C#. This all works ok,...
11
by: Dica | last post by:
i'm getting an error about 'the process cannot access the file becaise it is being used by another process.' write after i've created a new file and try to open it for writing with xmlTextWriter....
10
by: Tibby | last post by:
I need to read/write not only text files, but binary as well. It seems like on binary files, it doesn't right the last 10% of the file. -- Thanks --- Outgoing mail is certified Virus...
2
by: Bob | last post by:
Cannot copy assembly '<...>' to file <...>.dll'. The process cannot access the file because it is being used by another process. Could not copy temporary files to the output directory. The file...
8
by: Alec MacLean | last post by:
Hi, I'm using the DAAB Ent Lib (Jan 2006) for .NET 2.0, with VS 2005 Pro. My project is a Web app project (using the WAP add in). Background: I'm creating a survey system for our company, for...
5
by: bulldog8 | last post by:
I've read numerous posts and have tried multiple approaches that I found, but just cannot get a file renamed. I am using VB.Net 2002 ... Here is what I have tried: 1) Code common to all...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.