Click to See Complete Forum and Search --> : Compile error, cant access file


Begotten
June 18th, 2002, 01:04 PM
Hi all,

Anyone can help me?

I trying to use an old dll from a vc6 project with a new c# project making a 2 projects solutions.
Everything compile and works ok, but there is one problem with the compiler.

(the c# project needs the dll and everythig is set correctly to use it; i think)

I have 2 outputs directory for each project.
1- the standard \debug directory.
2- a ..\bin\debug

In the project option for the Dll i puted this line:
"copy Debug\utilDllD.dll ..\bin\debug"

If the file utilDll.dll is not in the ..\bin\debug directory there is no problem. But if its there the compiler complain about "a file cant be access, its used by another process".

I have to shut down Visual studio .net delete the Dll, and restart VS.net.

I didnt have this king of problem with the old VS6.

Can anyone help me.

Thanks.

AlenT
June 18th, 2002, 05:42 PM
Unless you need your dll to be in Debug directory, you can try to direct the linker to output your dll into ..\bin\debug directory right away without copying it afterwards. Then make your executable project depend on the dll, so the IDE will build the dll first, if there are any changes, and then the exe.

To change output directory for the dll project, go to project properties, Configuration Properties->General and change Output Directory to ..\bin\debug. Also, go to solution properties, Project Dependencies and make your executable depend on your dll project. And remove "Copy Debug ..bin\debug" directive.

Hope that helps.

Begotten
June 20th, 2002, 10:12 AM
No, it doesnt work.
The created dll caonnot be overwriten, or deleted.
I have to close the solution, delete it and rebuild the dll.