Force compilation?

Force compilation?

Old forum URL: forums.lhotka.net/forums/t/68.aspx


xal posted on Thursday, May 11, 2006

I have a solution with a number of projects. Due to the nature of the app, I need to make some of those projects work as plugins, so they're not statically referenced, but rather dinamically loaded by the main app if the dll is in the correct folder.
All projects reside in subfolders whithin the same parent folder and all of them are set to use ..\bin as output folder in the compile options.
All this works just fine. I have one problem though and it's that while I'm testing, hitting F5 will only compile the main project and the ones that are statically referenced by it. If I make a change to one of those "plugin" projects and hit run the app, the change will not show... I have to manually build the plugin project and then start debugging the app.

Now, I know that there is a way to force that unreferenced project to compile always because I've seen it done in other projects, but I can't find the damn parameter!

Any clues?

Andrés

ajj3085 replied on Thursday, May 11, 2006

Have you tried going to Project -> Project Dependencies.  You should be able to manually setup build dependencies.

HTH
Andy

xal replied on Thursday, May 11, 2006

Yes, I saw that, and tried it, but it doesn't work.
I'm also trying to compare my solution the another one that does what I want and it doesn't use that project dependencies thing.

(Which I'm not sure what's the point of it, since it doesn't recompile!! wtf. sorry.)


Andrés

ajj3085 replied on Thursday, May 11, 2006

Hmm... I would think that it would work.  Sorry, out of ideas on this Sad [:(]

xal replied on Thursday, May 11, 2006

Ok, it seems that the project I thought did that actually doesn't recompile anything.

So, it seems that I'm stuck with recompiling manually... I'll start paying more attention to NAnt... (I always wanted to do that anyway... Big Smile [:D])

Andrés

ajj3085 replied on Thursday, May 11, 2006

Just curious.. are you in VS2003, or 2005?  MSBuild is a lot better then the 2003 compiler.

pelinville replied on Thursday, May 11, 2006

Create a macro that first compile the entire sulution then runs the app and re-map the f5 key to run that macro.
 

Bayu replied on Thursday, May 11, 2006

Hi,

The solution is quite simple I thought ....

My situation is exactly the same, one of the apps makes use of several plugins which are only discovered at run-time (just wondering, but I guess we are both talking CAB?) ;-).

I don't know about your setup, so there may be the reason why you haven't found it yet, but in my case it is the following:

Step 1:
- Menu --> Tools --> Options
- Make sure All setting are displayed using the checkbox on the lower left
- Open up Projects and Settings, then Build and Run
- Make sure that 'Only build startup projects and dependencies on Run' is NOT enabled

Step 2:
- Menu --> Build --> Configuration Manager
- this will display a dialog with all known configurations in a dropdown at the top (typically Debug and Release)
- in the center of this dialog I see all my projects in the current solution enumerated and using checkmarks on each row I can select which projects should be compiled with the current configuration (eg Debug).
- typically I compile all plugins and stuff with Debug and with the Release build I also compile the setup projects


If you don't have those options mentioned, then you probably have a different setup and I can't help you. The instructions apply at least to VS2005 Team Edition.

Regards,
Bayu



Bayu replied on Thursday, May 11, 2006

Bayu:
Hi,

The solution is quite simple I thought ....

My situation is exactly the same, one of the apps makes use of several plugins which are only discovered at run-time (just wondering, but I guess we are both talking CAB?) ;-).

I don't know about your setup, so there may be the reason why you haven't found it yet, but in my case it is the following:

Step 1:
- Menu --> Tools --> Options
- Make sure All setting are displayed using the checkbox on the lower left
- Open up Projects and Settings, then Build and Run
- Make sure that 'Only build startup projects and dependencies on Run' is NOT enabled

Step 2:
- Menu --> Build --> Configuration Manager
- this will display a dialog with all known configurations in a dropdown at the top (typically Debug and Release)
- in the center of this dialog I see all my projects in the current solution enumerated and using checkmarks on each row I can select which projects should be compiled with the current configuration (eg Debug).
- typically I compile all plugins and stuff with Debug and with the Release build I also compile the setup projects


If you don't have those options mentioned, then you probably have a different setup and I can't help you. The instructions apply at least to VS2005 Team Edition.

Regards,
Bayu






BTW: ff this doesn't work, maybe switch to NAnt, this will give you all the flexibility you need.

Bayu

xal replied on Monday, May 15, 2006

Bayu,
I finally had time to test this... Thanks for your reply.
I thought it would work, but it didn't. I have VS pro, and it doesn't have the Configuration Manager.
Hitting F5 starts compiling only what "appears to be needed". If I alter the other projects i need to either rebuild them or rebuild the solution.

No, I'm not using CAB (I guess I need to look into that, don't I?). I'm kind of developing a UI system. Similar to the way sharp develop works, but not that complex. (SD uses xml files for plugins and extensions to the menu and other things. My components do not have / need that deep level of interaction, so I'm trying to keep it simple.)

One more thing I find strange is that I'm using "..\..\bin" as compilation folder, but when debugging the app it starts from "bin\" which makes the app and the plugins be in separate places...
This isn't such a big issue, because I only load plugins once and the code is in one place, but it forces me to do a "#If DEBUG Then" block...

Also, setting a different folder as output only puts one version of the files in that place. I'm figuring it leaves the debug build in "bin\" and the release in "..\..\bin". Does anyone know if this is right?

Andrés

Bayu replied on Monday, May 15, 2006

I see ...

Guess it's NAnt time then ... :-)

Bayu

Copyright (c) Marimer LLC