Hi Nadav,
Thanks for your post.
We need to perform more research on this issue . We will reply here as soon
as possible.
If you have any more concerns on it, please feel free to post here.
Thanks for your understanding!
Best regards,
Wen Yuan
Hi Nadav,
Thanks very much for your waitting.
Accorinding to your description, I understand you want to know why the
project has been compiled even if the dependence failed to compile. If I
have misunderstood anything here, please don't hesitance to correct me.
I think this is because MSbuild has compiled the project with an old
version dll file. The dependence has compiled failed, but that doesn't mean
the project which is dependent on will also compiled failed. If you have
compiled the solution before, the dll file will be exported in the
directory. For this reason, if the dependence library compiled success,
this dll file will be overwrited, otherwise, the dll file will still be
there. For the project which is dependent on this Library, it still can
compile successful, because there is really a dll file.
Please feel free to let me know if you have anything unclear. I'm glad to
assist you.
Best regards,
Wen Yuan
Nadav Popplewell - 27 Feb 2007 09:15 GMT
Hi WenYuan,
> I think this is because MSbuild has compiled the project with an old
> version dll file. The dependence has compiled failed, but that doesn't mean
[quoted text clipped - 4 lines]
> there. For the project which is dependent on this Library, it still can
> compile successful, because there is really a dll file.
Yes, the dependent project might compile successfully, but the resulting
application will NOT be right. It will have an old DLL version!
There are other problems with this 'FEATURE':
1. Compilation time:
If I have 1 project that X projects are dependant on and that project failed
I don't want to compile all those X projects (and their dependants) before I
find out that the compilation failed.
2. If I change the prototype of an function in project A (or add a new
class), and then use this function or class in project B, when I compile I
will get *a lot* of errors from *project B* and somewhere in all those errors
there will be one error from project A that caused all this...
It can be quite hard to find what the problem is...
3. the compiled application will not work as expected.
If for example I press F5 and one of the dlls has failed to compile, then I
will get a WARNING in the output directory which will probably drown in all
the other text in the output directory, and then the application will run and
I will spend a lot of time trying to figure out WHY the application does not
work as expected.
There are two things I want to know:
1. WHY isn't MSBuild checking the results of the compilations of the
projects that the current project is depending on.
(I can understand HOW the compilation can succeed, I just don't understand
why you would want it to... )
2. Is there some way to change this behavior so that MSBuild will NOT
compile dependant projects if their dependancies has failed?
Thanks,
Nadav
WenYuan Wang - 28 Feb 2007 07:25 GMT
Hi Nadav,
Thanks for your reply.
There are two ways we can used to add reference in Visual Studio 2005,
ProjectReference or Reference to the dependency.
Would you please let me know how you added the reference to your project?
MSBuild will not compile projects if their dependencies failed to compile -
when you have a ProjectReference rather than a Reference to the dependency
(which is strongly recommended).
Here is what the.csproj file ProjectReference looks like:
<ItemGroup>
<ProjectReference Include="">
<Project>{GUID HERE}</Project>
<Name></Name>
</ProjectReference>
</ItemGroup>
Here is what the .csproj file Reference to the dependency looks like:
<ItemGroup>
<Reference Include="...">
<SpecificVersion>False</SpecificVersion>
<HintPath>... </HintPath>
</Reference>
</ItemGroup>
If you want MSBuild not to compile projects if their dependencies failed to
compile, please add the reference as ProjectReference.
Please feel free to let me know if you have anything unclear. We are glad
to assist you.
Sincerely,
Wen Yuan
Nadav Popplewell - 28 Feb 2007 07:55 GMT
Hi WenYuan,
> There are two ways we can used to add reference in Visual Studio 2005,
> ProjectReference or Reference to the dependency.
> Would you please let me know how you added the reference to your project?
I add my references to the project by clicking Add Reference, going to the
Projects tab and selecting the name of the project, NOT be adding reference
to the DLL.
This is how the reference is stored in the csproj file:
<ProjectReference
Include="..\..\Common\Utilities\General\Utilities.General.csproj">
<Project>{38F7A9FB-EA17-452F-965F-B525C85DE897}</Project>
<Name>Utilities.General</Name>
</ProjectReference>
> MSBuild will not compile projects if their dependencies failed to compile -
> when you have a ProjectReference rather than a Reference to the dependency
> (which is strongly recommended).
Well, It does for me...
Thanks,
Nadav.
WenYuan Wang - 01 Mar 2007 06:30 GMT
Hi Nadav,
Thanks for your reply.
>> MSBuild will not compile projects if their dependencies failed to compile -
>> when you have a ProjectReference rather than a Reference to the dependency
>> (which is strongly recommended).
>Well, It does for me...
Do you mean ProjectReference had resolved your issue?
Please feel free to let me know if you have any further questions.
Have a great day.
Sincerely.
Wen Yuan
Nadav Popplewell - 01 Mar 2007 07:21 GMT
Hi WenYuan,
> >> MSBuild will not compile projects if their dependencies failed to
> compile -
[quoted text clipped - 4 lines]
>
> Do you mean ProjectReference had resolved your issue?
No, I mean that EVEN when I use ProjectReference MSBuild still compiles
projects whose dependencies has failed (I always use ProjectReferences..).
BTW, just in case I forgot to say, I'm using VS Team Edition for developers
with SP1.
Nadav
WenYuan Wang - 02 Mar 2007 14:12 GMT
Hi Nadav,
Thanks for your reply.
Could you please provide us some detailed information (.sln and .csproj
file) or a trivial example if this is possible? I think we should have do
some further research on it.
My alias is v-wywang@microsoft.com
If you have any concern on this please feel free to let me know.
Sincerely,
Wen Yuan