473,583 Members | 3,413 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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***@simonwea ver.com)
Subject: still problems with Could not copy temporary files to the output
directory
View this article only
Newsgroups: microsoft.publi c.dotnet.langua ges.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\Visua l Studio
Projects\XXX\Bu sinessCS\obj\De bug\BusinessCS. dll' -- 'Access is denied. '"

and

Could not write to output file 'C:\Documents and Settings\Simon. SIMON_DEV\My
Documents\Visua l Studio Projects\ITD
Database\Busine ssCS\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 8314
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$******** ******@tk2msftn gp13.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.5224 87$Oz4.380130@r wcrnsc54...
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$******** ******@tk2msftn gp13.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******@hotma il.com> wrote in message
news:%2******** **********@TK2M SFTNGP09.phx.gb l...
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.5224 87$Oz4.380130@r wcrnsc54...
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$******** ******@tk2msftn gp13.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
4868
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) p.stdin.write("hostname\n") however, it doesn't seem to work. I think the cmd.exe is catching it.
0
2718
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 used by another process. ' I used the task manager to see if myapp.exe process was
3
4534
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 week. Today I get a message: Could not write to output file 'D:\DevelopmentProjects\Enterprise\CustomUtilities\obj\Debug\CustomUtilities ..dll' --...
3
2147
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, however when I try and compile the project I get two error messages: 1) Could not copy temporary files to the output directory. 2) The file...
11
4335
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. FileInfo oFileInfo = new FileInfo(STR_FILE_NAME); bool bFileExists = oFileInfo.Exists; if (!bFileExists) {
10
2529
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 Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.538 / Virus Database: 333 - Release Date: 11/10/2003
2
4147
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 '<...>.dll' cannot be copied to the run directory. The process cannot access the file because it is being used by another process. I'm sick of...
8
2679
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 which invites will target selected personnel among our customers via email. Each email will provide a custom hyperlink for each respondent using a...
5
4706
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 attempts: OldName = "c:\albums\061203\email\DSC07272.JPG" NewName = "c:\albums\061203\email\Lalala.JPG"
0
8176
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8321
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7931
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
8191
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6578
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
5370
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3841
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2331
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
1154
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.