Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What are the WCF Service Reference .datasource files?

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?

like image 980
Andy White Avatar asked Sep 17 '09 14:09

Andy White


People also ask

What are .datasource files?

A data source, also called a data file, is a collection of records that store data. A data source can be any document organized to provide structure for the receiving program to pull data. You can use any text file as a data source, such as a plain text file or a database file.

What are service references in C#?

For . NET Framework projects, service reference enables a project to access one or more WCF Data Services. Use the Add Service Reference dialog box to search for WCF Data Services in the current solution, locally, on a local area network, or on the Internet. For .

How do I add a Web reference to a SVC file?

Try starting your service first by right-clicking the . svc file and using "View in Browser". Then give the URL of the service to the "Add Web Reference" dialog.

How do I change my WCF service reference?

If you do run the WCF in debug, once it loads, just go to your debug menu in VS and click "Detach All." Then update your service reference. Show activity on this post. If you have your application published on local IIS, you must change the server on your Web Application Project.


2 Answers

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.

like image 110
tomasr Avatar answered Sep 22 '22 04:09

tomasr


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

like image 45
Chris Schroll Avatar answered Sep 22 '22 04:09

Chris Schroll