开发者

Web Application + Silverlight project in TFS, .xap file keeps being checked in, can I avoid it?

开发者 https://www.devze.com 2023-01-06 14:59 出处:网络
When I look at my ASP.NET application that hosts a Silverlight project, it has a Clientbin folder, inside of which there is a .xap file, the one being compiled from my Silverlight project.

When I look at my ASP.NET application that hosts a Silverlight project, it has a Clientbin folder, inside of which there is a .xap file, the one being compiled from my Silverlight project.

This file keeps being checked into TFS. Is there a way for me to tell TFS to just plan ignore it?

The reason is that once the file is checked in, if I forget to check it back out, it appears Visual Studio will silently (there is a warning, but nothing that prevents me from starting the debugger) fail when building the Silverlight project, so when I debug, it starts the version in TFS, not the version I just built.

What I have to do is either check our, or just plain 开发者_Go百科delete (which also checks out) the corresponding xap files, then build the Silverlight project. When I do that, I notice that Visual Studio puts the file(s) back into the Clientbin directory (if I deleted it, it first undos the delete, but keeps it checked out). Now I can debug the right version of the binary.

So, what am I doing wrong, how can I fix this?


There is a bug in TFS2008 which caused this error for Web Application Projects (as opposed to Web Site Projects, which should work fine), so at least it's not your fault. This was fixed in VS2010/TFS2010.

This thread on the Silverlight forums contains this suggestion:

We had the same problem.

I deleted the clientbin folder with the xap in it, checked in.

On the _Web project, properties, silverlight app, Removed the sl project, save, check in.

Then I readded my silverlight project.

It seems to be working for everyone now and isn't getting readded to source control. I hope that helps out.

This other thread from the Silverlight forums contains this suggestion:

Hi, it seems that now in SL 3.0 the things have changed. Now we are using the following three steps in order to get the xap correctly published.

1) Remove any post/pre build script in the SL project.

2) In the host project (web): Make sure the ClientBin.xap file has these settings: Build Action: Content Copy to Output Directory: Do not copy

3) In post pre-build event, put the following script: attrib -r ....\Sources[WebProject_NAME]\ClientBin[XAPFileName].xap

For example: attrib -r ....\Sources\test.web\ClientBin\sl.xap

(this last step avoid the "unable to copy the xap file" error from TFS Build)

0

精彩评论

暂无评论...
验证码 换一张
取 消