Clean Cannot run my application outside VS without previously doing a"clean" before rebuild

S

SQACSharp

Hi,

Many of my applications who use dll ProjectReference stop working
since this week for unknown reasons.

I suspect that I ran a downloaded openSource project who change
something in the registry about dll reference/ version

The problem :
The application stop because of "object not reference to an instance
of the object...blablabla" and the form cannot even be displayed

- The problem occur ***ONLY*** when running my application outside VS
(not in vs.. with start debugging)
- Doing a "Clean" of the project before doing rebuild project solve
the problem until next rebuild
- when running the application after rebuild, the problem occurs 50%
of the time when executing the exe directly , sometime it works,
sometime not. But it always work in VS or after a "Clean"

I dont think the problem has something to do with my code.

Any ideas? I Defenitively need help on this.... I try almost anything
possible and lost many many precious hours on this.....Help!!!!!! :(

Thanks,
 
P

Peter Duniho

SQACSharp said:
Hi,

Many of my applications who use dll ProjectReference stop working
since this week for unknown reasons.

I suspect that I ran a downloaded openSource project who change
something in the registry about dll reference/ version

The problem :
The application stop because of "object not reference to an instance
of the object...blablabla" and the form cannot even be displayed

- The problem occur ***ONLY*** when running my application outside VS
(not in vs.. with start debugging)
- Doing a "Clean" of the project before doing rebuild project solve
the problem until next rebuild
- when running the application after rebuild, the problem occurs 50%
of the time when executing the exe directly , sometime it works,
sometime not. But it always work in VS or after a "Clean"

I dont think the problem has something to do with my code.

A null reference exception is almost always something to do with your
code. They are also relatively easy to debug, with access to the code.
All you have to do is look in the debugger where the program stopped
and see what's null and why.

Of course, since you didn't post any code, never mind a
concise-but-complete code example that reliably reproduces the problem,
there would be no way for anyone else to suggest what might be wrong.
But you should be able to figure it out yourself.

If you're unable to, for anyone else to provide any specific information
you'd need to provide more information than you have so far. Such as
the code example I mentioned above.

Pete
 
S

SQACSharp

My first use of attach process debugging...

Problem = When several separate projects output dll to a SAME
directory I need to add reference to that dll in my main project even
if the main project is not using it. Compiling the main project
delete the file (.dll) somehow. Adding a reference to this "unused"
dll in my main project prevent the deletion of the file in the bin
dir.

Is there an option for this? Why rebuilding a project can result in
removing dll in the output dir? Anyway at least the problem is
Resolved!!!! :)

Michel
 
P

Peter Duniho

SQACSharp said:
My first use of attach process debugging...

Problem = When several separate projects output dll to a SAME
directory I need to add reference to that dll in my main project even
if the main project is not using it. Compiling the main project
delete the file (.dll) somehow. Adding a reference to this "unused"
dll in my main project prevent the deletion of the file in the bin
dir.

Is there an option for this? Why rebuilding a project can result in
removing dll in the output dir? Anyway at least the problem is
Resolved!!!! :)

The "Rebuild" option performs a "Clean" then a "Build", where the
"Build" is based on the dependencies for the project being built (or the
whole solution, if you use the "Build Solution" command).

It seems plausible to me that if you for some reason have multiple
projects all writing their output to some directory, but those projects
are not properly configured as dependencies for the project that
actually depends on them, they won't get rebuilt after being cleaned
from the output directory.

It's impossible to say for sure what's going on without access to the
actual solution and projects. But it sounds like you haven't set them
up correctly. Certainly having a bunch of DLLs that aren't actually
related to each other all getting written to the same output directory
seems a bit irregular to me.

Pete
 
S

SQACSharp

The "Rebuild" option performs a "Clean" then a "Build", where the
"Build" is based on the dependencies for the project being built (or the
whole solution, if you use the "Build Solution" command).

It seems plausible to me that if you for some reason have multiple
projects all writing their output to some directory, but those projects
are not properly configured as dependencies for the project that
actually depends on them, they won't get rebuilt after being cleaned
from the output directory.

It's impossible to say for sure what's going on without access to the
actual solution and projects.  But it sounds like you haven't set them
up correctly.  Certainly having a bunch of DLLs that aren't actually
related to each other all getting written to the same output directory
seems a bit irregular to me.

Pete

Thank for the advise but the design is like this because the
particular use of my application a 3.5 application who inject dll from
different framework version into other process. The goal was to
remove duplicated stuffs and avoid managing several projects to
compile in different version. Anyway it's a really particular case so
I cant define dependencies without getting duplication and complicate
maintenance in a multi framework support context. At least I
understand now and it's fixed!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top