I just upgraded my dev laptop to Vs11 and all was great with the world….. Until I ran my command line build script on my Silverlight project. When my script failed with the following error I was perplexed because of course everything ran fine from INSIDE VS
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\WebApplications\Microsoft.WebApplication.targets(289,9): error
MSB4006: There is a circular dependency in the target dependency graph involving target "CopySilverlightApplications". [C:\
At first I tried to diff the Microsoft.WebApplication.targets file to see what changed there but nothing looked out of place…hum.
Finally when chatting about this issue with a co-worker it dawned on me what my issue was. Our silverlight project uses RIA Services and because of this there is technically a circular dependency between the web project and the client project.
The client knows about the server because the RIA services end points are created inside the web project and post build the client side RIA endpoints are pushed into the Client project.
The server knows about the client because as a silverlight project we had the server setup to copy the .xap file into the ClientBin folder
How did I resolve this?
I removed the Silverlight copy dependency inside my server project as seen below
I added a post build event inside my Silverlight client project do xcopy the .xap into the correct ClientBin folder in the web project.
Once I made this change I was able to do the following
- Compile inside of VS with NO issues
- Compile via MSBuild on the command line
- F5 my application and run the silverlight client
Hope this helps someone else
Till next time,
03-20-2012 9:43 AM