What are the WCF Service Reference .datasource files?

WcfFileDatasourceService Reference

Wcf Problem Overview


What are the .datasource files that are automatically generated by "Create Service Reference" in Visual Studio? The comment in the file is this:

> This file is automatically generated > by Visual Studio .Net. It is > used to store generic object data source configuration information.
> Renaming the file extension or editing the content of this file may
> cause the file to be unrecognizable by the program.

However, it sounds like these files are optional, so I'm wondering what they are used for. I'm also wondering if it is truly safe to delete them, since they often cause path length problems on XP.

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

Can anyone point me to some official MS documentation on these files?

Wcf Solutions


Solution 1 - Wcf

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.

Solution 2 - Wcf

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

Solution 3 - Wcf

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.

Solution 4 - Wcf

Expand your Reference.svcmap from visual studio.

Update reference.

And delete yellow warning datasources.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionAndy WhiteView Question on Stackoverflow
Solution 1 - WcftomasrView Answer on Stackoverflow
Solution 2 - WcfChris SchrollView Answer on Stackoverflow
Solution 3 - WcfAdam NofsingerView Answer on Stackoverflow
Solution 4 - WcfelifekizView Answer on Stackoverflow