473,549 Members | 2,616 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

VS.NET file locking problem : Totally screwed

Sin
I've tried everything and I've come to the conclusion that I'm screwed. If
anyone can help, I would be eternaly greatful.

I have a solution which has 47 projects.. This is includes (very roughly) :

1- plain win32 C++ DLL projects (little over a dozen, refered to as BASE
OBJECTS)

2- ATL/COM/C++ DLLs which use the plain win32 DLLs (another dozen, refered
to as COM WRAPPERS)

3- VB.NET interface projects exposing COM classes which use the ATL/COM
DLLs. (another dozen, refered to as VB GUI)

4- One of the base objects is shared by all others, the same object's
wrapper is also shared, and so is it's VB gui project. This component is
refered to as the KERNEL.

5- The main application is VB.NET and uses the VB GUI projects

ALL projects are outputed to the same directory... Before you jump at this,
I have already tried outputing ALL of them to different directories and the
problem remains, so there's something else and I think it's related to COM.

So as you've probably guessed by now, everytime I do a build/rebuild on this
solution, there are a couple of projects which won't compile because I get
"Cannot access file because it's locked by another process" or similar
messages (there are actually 3 different ones, all pertaining to locked
DLLs).

Anytime this happens, the kernel's wrapper is usually one of those having
problems but it's VB gui also causes problems from time to time. There are 2
other wrappers which are almost always there too, but I have no clue why as
they are built the same way as others and are not used differently either.
When this happens I need to delete all the contents of my debug directories,
close VC and usually even reboot to fix the problem. It's getting extremely
iritating.

ALL these project's outputs are bigger than the 64K mentionne in the KB
articles.

I'm totally lost.... How can I make this work?

Thanks in advance... And please reply if you have ANY tip concerning this...
At this point I'm willing to try voodoo, weejaa and any other trick that
might help.

Alex.
Jul 21 '05 #1
14 1683
Hi Alex

I get a similar problem with a solution with far fewer projects. Do you need
to work on all the projects at the same time? By that I mean could you build
some of the core projects, or some of the globally referenced projects, and
then remove them from the solution? The rest of the projects could still
reference the built dlls, but they would not get rebuilt every time. It
would also speed up the building of the solution quite a bit.

HTH

Charles
"Sin" <br****@hotmail .com> wrote in message
news:O5******** ******@TK2MSFTN GP12.phx.gbl...
I've tried everything and I've come to the conclusion that I'm screwed. If
anyone can help, I would be eternaly greatful.

I have a solution which has 47 projects.. This is includes (very roughly) :
1- plain win32 C++ DLL projects (little over a dozen, refered to as BASE
OBJECTS)

2- ATL/COM/C++ DLLs which use the plain win32 DLLs (another dozen, refered
to as COM WRAPPERS)

3- VB.NET interface projects exposing COM classes which use the ATL/COM
DLLs. (another dozen, refered to as VB GUI)

4- One of the base objects is shared by all others, the same object's
wrapper is also shared, and so is it's VB gui project. This component is
refered to as the KERNEL.

5- The main application is VB.NET and uses the VB GUI projects

ALL projects are outputed to the same directory... Before you jump at this, I have already tried outputing ALL of them to different directories and the problem remains, so there's something else and I think it's related to COM.
So as you've probably guessed by now, everytime I do a build/rebuild on this solution, there are a couple of projects which won't compile because I get
"Cannot access file because it's locked by another process" or similar
messages (there are actually 3 different ones, all pertaining to locked
DLLs).

Anytime this happens, the kernel's wrapper is usually one of those having
problems but it's VB gui also causes problems from time to time. There are 2 other wrappers which are almost always there too, but I have no clue why as they are built the same way as others and are not used differently either.
When this happens I need to delete all the contents of my debug directories, close VC and usually even reboot to fix the problem. It's getting extremely iritating.

ALL these project's outputs are bigger than the 64K mentionne in the KB
articles.

I'm totally lost.... How can I make this work?

Thanks in advance... And please reply if you have ANY tip concerning this... At this point I'm willing to try voodoo, weejaa and any other trick that
might help.

Alex.

Jul 21 '05 #2
Hi Alex

I get a similar problem with a solution with far fewer projects. Do you need
to work on all the projects at the same time? By that I mean could you build
some of the core projects, or some of the globally referenced projects, and
then remove them from the solution? The rest of the projects could still
reference the built dlls, but they would not get rebuilt every time. It
would also speed up the building of the solution quite a bit.

HTH

Charles
"Sin" <br****@hotmail .com> wrote in message
news:O5******** ******@TK2MSFTN GP12.phx.gbl...
I've tried everything and I've come to the conclusion that I'm screwed. If
anyone can help, I would be eternaly greatful.

I have a solution which has 47 projects.. This is includes (very roughly) :
1- plain win32 C++ DLL projects (little over a dozen, refered to as BASE
OBJECTS)

2- ATL/COM/C++ DLLs which use the plain win32 DLLs (another dozen, refered
to as COM WRAPPERS)

3- VB.NET interface projects exposing COM classes which use the ATL/COM
DLLs. (another dozen, refered to as VB GUI)

4- One of the base objects is shared by all others, the same object's
wrapper is also shared, and so is it's VB gui project. This component is
refered to as the KERNEL.

5- The main application is VB.NET and uses the VB GUI projects

ALL projects are outputed to the same directory... Before you jump at this, I have already tried outputing ALL of them to different directories and the problem remains, so there's something else and I think it's related to COM.
So as you've probably guessed by now, everytime I do a build/rebuild on this solution, there are a couple of projects which won't compile because I get
"Cannot access file because it's locked by another process" or similar
messages (there are actually 3 different ones, all pertaining to locked
DLLs).

Anytime this happens, the kernel's wrapper is usually one of those having
problems but it's VB gui also causes problems from time to time. There are 2 other wrappers which are almost always there too, but I have no clue why as they are built the same way as others and are not used differently either.
When this happens I need to delete all the contents of my debug directories, close VC and usually even reboot to fix the problem. It's getting extremely iritating.

ALL these project's outputs are bigger than the 64K mentionne in the KB
articles.

I'm totally lost.... How can I make this work?

Thanks in advance... And please reply if you have ANY tip concerning this... At this point I'm willing to try voodoo, weejaa and any other trick that
might help.

Alex.

Jul 21 '05 #3
Sin
> I get a similar problem with a solution with far fewer projects. Do you
need
to work on all the projects at the same time? By that I mean could you build some of the core projects, or some of the globally referenced projects, and then remove them from the solution? The rest of the projects could still
reference the built dlls, but they would not get rebuilt every time. It
would also speed up the building of the solution quite a bit.


Most of the time we will work on one of the objects (ie: the base object,
it's wrapper, and it's interface)... Indeed your solution would work and
don't worry we've though about it but ideally we would like a solution where
we can build all our projects without opening a couple dozen solutions...

Is there a way to compile a solution from the command line? I suppose if we
could then we could have a batch file compile all our solutions when
needed....

The idea is to keep things easy to work with... It will often happen that I
need to flush my entire project dir and replace it with a backup (a newer
version from my co-worker) and then recompile all...

Another problem is debugging... I need to be able to debug all projects
without switching from a solution to another. Note that this is something
I'm not even able to do now... Seems I can't trace from VB to C.......

I'll experiment along those lines... But ideally we'd want a single
solution... We've been working like this for 15 years, it would suck to
change the mentality :)

Alex.
Jul 21 '05 #4
Sin
> I get a similar problem with a solution with far fewer projects. Do you
need
to work on all the projects at the same time? By that I mean could you build some of the core projects, or some of the globally referenced projects, and then remove them from the solution? The rest of the projects could still
reference the built dlls, but they would not get rebuilt every time. It
would also speed up the building of the solution quite a bit.


Most of the time we will work on one of the objects (ie: the base object,
it's wrapper, and it's interface)... Indeed your solution would work and
don't worry we've though about it but ideally we would like a solution where
we can build all our projects without opening a couple dozen solutions...

Is there a way to compile a solution from the command line? I suppose if we
could then we could have a batch file compile all our solutions when
needed....

The idea is to keep things easy to work with... It will often happen that I
need to flush my entire project dir and replace it with a backup (a newer
version from my co-worker) and then recompile all...

Another problem is debugging... I need to be able to debug all projects
without switching from a solution to another. Note that this is something
I'm not even able to do now... Seems I can't trace from VB to C.......

I'll experiment along those lines... But ideally we'd want a single
solution... We've been working like this for 15 years, it would suck to
change the mentality :)

Alex.
Jul 21 '05 #5
I agree. I'm sure MS could fix this particular problem right now if they
would only release a service pack for the VS IDE. There are many other such
'niggles' that they are definitely aware of and which they must surely have
a fix for by now.

One other consideration that may improve the situation: have a look at the
linkage of your projects within the solution. I find that the problem is
greater when there is tight coupling and low cohesion. I have resolved this
issue on occasions by refactoring my solution to reduce the amount of
coupling between projects.

Charles
"Sin" <br****@hotmail .com> wrote in message
news:O8******** ******@TK2MSFTN GP09.phx.gbl...
I get a similar problem with a solution with far fewer projects. Do you need
to work on all the projects at the same time? By that I mean could you

build
some of the core projects, or some of the globally referenced projects,

and
then remove them from the solution? The rest of the projects could still
reference the built dlls, but they would not get rebuilt every time. It
would also speed up the building of the solution quite a bit.


Most of the time we will work on one of the objects (ie: the base object,
it's wrapper, and it's interface)... Indeed your solution would work and
don't worry we've though about it but ideally we would like a solution

where we can build all our projects without opening a couple dozen solutions...

Is there a way to compile a solution from the command line? I suppose if we could then we could have a batch file compile all our solutions when
needed....

The idea is to keep things easy to work with... It will often happen that I need to flush my entire project dir and replace it with a backup (a newer
version from my co-worker) and then recompile all...

Another problem is debugging... I need to be able to debug all projects
without switching from a solution to another. Note that this is something
I'm not even able to do now... Seems I can't trace from VB to C.......

I'll experiment along those lines... But ideally we'd want a single
solution... We've been working like this for 15 years, it would suck to
change the mentality :)

Alex.

Jul 21 '05 #6
I agree. I'm sure MS could fix this particular problem right now if they
would only release a service pack for the VS IDE. There are many other such
'niggles' that they are definitely aware of and which they must surely have
a fix for by now.

One other consideration that may improve the situation: have a look at the
linkage of your projects within the solution. I find that the problem is
greater when there is tight coupling and low cohesion. I have resolved this
issue on occasions by refactoring my solution to reduce the amount of
coupling between projects.

Charles
"Sin" <br****@hotmail .com> wrote in message
news:O8******** ******@TK2MSFTN GP09.phx.gbl...
I get a similar problem with a solution with far fewer projects. Do you need
to work on all the projects at the same time? By that I mean could you

build
some of the core projects, or some of the globally referenced projects,

and
then remove them from the solution? The rest of the projects could still
reference the built dlls, but they would not get rebuilt every time. It
would also speed up the building of the solution quite a bit.


Most of the time we will work on one of the objects (ie: the base object,
it's wrapper, and it's interface)... Indeed your solution would work and
don't worry we've though about it but ideally we would like a solution

where we can build all our projects without opening a couple dozen solutions...

Is there a way to compile a solution from the command line? I suppose if we could then we could have a batch file compile all our solutions when
needed....

The idea is to keep things easy to work with... It will often happen that I need to flush my entire project dir and replace it with a backup (a newer
version from my co-worker) and then recompile all...

Another problem is debugging... I need to be able to debug all projects
without switching from a solution to another. Note that this is something
I'm not even able to do now... Seems I can't trace from VB to C.......

I'll experiment along those lines... But ideally we'd want a single
solution... We've been working like this for 15 years, it would suck to
change the mentality :)

Alex.

Jul 21 '05 #7
Sin
> I agree. I'm sure MS could fix this particular problem right now if they
would only release a service pack for the VS IDE. There are many other such 'niggles' that they are definitely aware of and which they must surely have a fix for by now.
I guess we can keep dreaming... VB6 had the same problem and it never got
fixed after years and years of service packs... In VB6 if you had a EXE
project and a ActiveX DLL project and switched from one to the other the DLL
would stay locked and you'd need to close and re-open VB to recompile the
DLL.... Extremely annoying when you're working on BOTH.....

One other consideration that may improve the situation: have a look at the
linkage of your projects within the solution. I find that the problem is
greater when there is tight coupling and low cohesion. I have resolved this issue on occasions by refactoring my solution to reduce the amount of
coupling between projects.


I'll keep that in mind..... My boss is the lead designer and I'll see with
him what opions he wants to go with. As far as I'm concerned all 47 projects
could easily be merged in 2 projects (1 C++/COM, 1 VB) but he's been working
with separate projects for 15+ years... The objects are actually plugins to
the main application but there are really just final release 2
configurations (a normal and a pro version of the product, the pro version
includes all plugins while the normal version only has a subset of them).

Merging them would eliminate 45 potential sources of the error we're
having... hehe... It would certainly help.

Thanks for the input....

Alex.
Jul 21 '05 #8
Sin
> I agree. I'm sure MS could fix this particular problem right now if they
would only release a service pack for the VS IDE. There are many other such 'niggles' that they are definitely aware of and which they must surely have a fix for by now.
I guess we can keep dreaming... VB6 had the same problem and it never got
fixed after years and years of service packs... In VB6 if you had a EXE
project and a ActiveX DLL project and switched from one to the other the DLL
would stay locked and you'd need to close and re-open VB to recompile the
DLL.... Extremely annoying when you're working on BOTH.....

One other consideration that may improve the situation: have a look at the
linkage of your projects within the solution. I find that the problem is
greater when there is tight coupling and low cohesion. I have resolved this issue on occasions by refactoring my solution to reduce the amount of
coupling between projects.


I'll keep that in mind..... My boss is the lead designer and I'll see with
him what opions he wants to go with. As far as I'm concerned all 47 projects
could easily be merged in 2 projects (1 C++/COM, 1 VB) but he's been working
with separate projects for 15+ years... The objects are actually plugins to
the main application but there are really just final release 2
configurations (a normal and a pro version of the product, the pro version
includes all plugins while the normal version only has a subset of them).

Merging them would eliminate 45 potential sources of the error we're
having... hehe... It would certainly help.

Thanks for the input....

Alex.
Jul 21 '05 #9
Sin
> I find that closing all the open source files SOMETIMES clears it.
I use DotNet 1.1 & C#.


Doesn't change a thing here... In fact I rarely compile with any documents
open.

Alex.
Jul 21 '05 #10

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

Similar topics

2
6498
by: Corne' Cornelius | last post by:
Hi, When you open a file for writing/appending with open() or fopen(), and you have multiple applications that might want to write to the same file at the same time, could that cause weirdness in the file ? do i have to add manual file locking, or does open()/fopen() provide file locking ? Thanks,
10
11871
by: McFly Racing | last post by:
Thread Locking In Static Methods I have the need for a Log Manger class that has static methods. Normally I would use the lock statement or a Monitor statement both of which take a reference to (this). In the case of these static methods I am not able to do that.
14
321
by: Sin | last post by:
I've tried everything and I've come to the conclusion that I'm screwed. If anyone can help, I would be eternaly greatful. I have a solution which has 47 projects.. This is includes (very roughly) : 1- plain win32 C++ DLL projects (little over a dozen, refered to as BASE OBJECTS) 2- ATL/COM/C++ DLLs which use the plain win32 DLLs...
0
1109
by: Eric S. Johansson | last post by:
are there any simple examples of how to do record locking with bsddb3? the bsddb3 documentation is reasonably opaque. For example, the DB initialization requires a DBEnv instance for certain environmental features such as locking. but if you want locking, what happens next? I suspect the pattern goes something like the following but it's...
13
11118
by: George | last post by:
Hi, I am re-writing part of my application using C#. This application starts another process which execute a "legacy" program. This legacy program writes to a log file and before it ends, it writes a specific string to the log file. My original program (MKS Toolkit shell program) which keeps running "grep" checking the "exit string" on...
17
4872
by: shineofleo | last post by:
Here is the situation: I wrote a VB programm, which stores all the information in a single Access database file using jet engine. It worked well, however one of my customs reported that there was some problems with this programm. I checked, the log files showed that the database was corrupted. The customer told me that there no 'illegal'...
15
5221
by: Matt Brandt | last post by:
I am trying to get multiple threads to lock specific regions of a file. However, since each thread has the same PID, it appears that a lock by one thread does not block another thread from the same process. How does one maintain file locking between sibling threads? - Matt
36
5348
by: Don | last post by:
I wrote an app that alerts a user who attempts to open a file that the file is currently in use. It works fine except when the file is opened by Notepad. If a text file is opened, most computers are configured to use Notepad to open the file by default and if they are configured to use Notepad by default I want it to remain that way rather...
6
4198
by: Bill H | last post by:
I am wondering if this is possible. I have a file that is accessed by multiple users and keeps track of activity (the file is polled by flash every 2 seconds). As users leave, the flash program tells the php program to remove them from the activity file, and as users access this activity file, users who have timed out (haven't been heard from...
0
7451
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7959
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
7473
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
7810
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
6044
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
3501
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3483
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1061
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
764
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.