I’m having problem with publishing WCF service from CI (Cruise Control)..
Let’s say I have a WCF project called “WCF-A”. I put the following lines in csproj of “WCF-A”
<Target Name="BeforeBuild">
<Message Text="##############Before build##################" Importance="high" />
<RemoveDir Directories="publish" ContinueOnError="true" />
</Target>
<Target Name="AfterBuild">
<Message Text="##############After build##################$(OutputFolder)" Importance="high" />
<MSBuild Projects="$(ProjectName).csproj" Targets="ResolveReferences;_CopyWebApplication" Properties="WebProjectOutputDir=publish\;OutDir=publish\bin\" />
</Target>
I’m using the following to build my service from commandline. (Note that we are using CI but in order to make my question simple, I will use commandline. )
E:\..\Code\>msbuild MyServices.sln /t:Clean;Rebuild
It works perfectly and all assemblies, cross-domain xml, svc files are published under “publish” folder.
The problem come out when I add another services (let’s called it “WCF-B”) in the solution file. [Edit] I added the same “BeforeBuild” and “AfterBuild” in WCF-B as well. [/Edit] I project-referenced WCF-A from “WCF-B”… but when I build the solution with the same command that I used, the publishing for “WCF-B” is working fine. But the cross-domain file and svc file of “WCF-A” are not being deployed anymore. Only assembly of “WCF-A” are being published under “publish\bin” folder.
Do you guys have any idea why it’s happening like that? Thanks in advance.
Edit
I think having “project-reference” creates this problem.. But I need to project-reference instead of calling the service from proxy class. Since both services will be hosted on the same server, I prefer dll-reference over service-calls.
It looks as if the files of WCF-A are being deleted by the
BeforeBuildtarget of WCF-B (assuming that the publish directory resolves to the same directory) and that the assembly WCF-A cannot be deleted because it is referenced by WCF-B and in use.You might try to increase the log verbosity using
/v:dor even/v:diagfor further information.