什么是 WCFServiceReference.datsource 文件?

什么是。数据源文件是否由 VisualStudio 中的“创建服务引用”自动生成?文件中的注释如下:

这个文件是自动生成的 由 VisualStudio.Net 用于存储一般对象数据源配置信息。
重命名文件扩展名或编辑此文件的内容可能
导致程序无法识别文件。

然而,听起来这些文件是可选的,所以我想知道它们是用来做什么的。我还想知道删除它们是否真的安全,因为它们在 XP 上经常会导致路径长度问题。

Http://www.eggheadcafe.com/conversation.aspx?messageid=34104031&threadid=34104026

有人能告诉我这些文件的官方 MS 文档吗?

34149 次浏览

As far as I remember, they are just generated so that you can use the data contracts used in the service as object data sources for data binding against UI controls.

I was able to delete them from one of our projects. Project built fine, and loaded stuff from the database fine, so I'm assuming it was safe. I would like to hear someone who knows more about them weigh in on this element of the subject though.

The .datasource files are optional, but they can be used in your client app to easily bind a data contract to a ui control. Here is an article explaining how to use them:

http://msdn.microsoft.com/en-us/library/ee373840.aspx

Expand your Reference.svcmap from visual studio.

Update reference.

And delete yellow warning datasources.