none
Service Reference update different datasource files on different machines RRS feed

  • Question

  • Hello,

    We are using Visual Studio 2015 Update 3.

    When I update a service reference, I get datasource files like this:

    <?xml version="1.0" encoding="utf-8"?>
    <!--
        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.
    -->
    <GenericObjectDataSource DisplayName="DisApproveDuties_Result" Version="1.0" xmlns="urn:schemas-microsoft-com:xml-msdatasource">
       <TypeInfo>Mysolution.Web.Api.NavResourceHoursService.DisApproveDuties_Result, Service References.NavResourceHoursService.Reference.cs.dll, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null</TypeInfo>
    </GenericObjectDataSource>

    When my colleague is updating the same service reference on his machine he get this:

    <?xml version="1.0" encoding="utf-8"?>
    <!--
        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.
    -->
    <GenericObjectDataSource DisplayName="DisApproveDuties_Result" Version="1.0" xmlns="urn:schemas-microsoft-com:xml-msdatasource">
       <TypeInfo>Mysolution.Web.Api.NavResourceHoursService.DisApproveDuties_Result</TypeInfo>
    </GenericObjectDataSource>

    Note the difference in the TypeInfo element value.

    I can't figure out why this is happening. Any ideas?

    But it is annoying as it generates unnecessary file changes in source control.

    It would be even better if there was an option to disable generation on these datasource files. But I can't find that.

    Regards, Jaap

    Wednesday, November 9, 2016 1:24 PM

All replies

  • Hi Jaap,

    Did you use the Data Entities in WCF client to bind controls? As my test under VS2013, it seems this datasource file would not generate automatically. If I browser my data entities in WCF client by View->Other Windows->Data Sources->your service reference-> your Data Entities, then the datasource file would be generated.

    If you would not use these data entities in client side, you could delete it directly, it would not affect your WCF client function. These files are used to bind client controls by WCF Services Data.

    I am not sure whether it is related with VS version, I suggest you try the suggestion from below link.

    # What are the WCF Service Reference .datasource files?

    http://stackoverflow.com/questions/1439364/what-are-the-wcf-service-reference-datasource-files

    Best Regards,

    Edward


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Thursday, November 10, 2016 4:43 AM
  • We do not use any databinding to the WCF client, it is just an asp.net mvc/webapi application.

    Deleting the .datasource files would be an options, but annoying because we must update the service references from time to time en every time they would be regenerated again.

    Tuesday, November 15, 2016 7:58 AM
  • Hi Jaap,

    Thanks for more information.

    I made a test with MVC application, but I failed to reproduce under VS 2015 with update 3. My test follows below steps.

    1. Create a web application, add ADO.NET Entity Data Model, and add WCF DATA Service 5.6.4
    2. Create a web application, add data service reference
    3. There is no .datasource files

    For temporary workaround, I would suggest you Exclude from Project from Solution Explorer if you do not use it.

    If you do not accept this workaround, I suggest you make a test with simple project, and check whether this issue still exist, if it does, I suggest you share us your complete test, and then we could try to reproduce your issue at our side.

    Best Regards,

    Edward


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Wednesday, November 16, 2016 8:57 AM
  • It seems to be not very clear what is or what is not triggering the generation of these datasource files.

    The best solution would be to have an options in the service reference configuration to disable or enable the generation.

    The biggest problem currently is that updating the service reference op different computers creates different content in the datasource file (is showed in my first message). This pollutes our changesets very much. No idea what is causing that. Both computers are on VS2015 Update3.

    Deleting or excluding these files from the Solution is also not ideal, because on every update of the service reference, you will need to delete them again. And in our case updating is done at a regular bases because we are developing on both sides.

    Regards, Jaap

    Wednesday, November 16, 2016 10:37 AM
  • Hi Jaap,

    Based on my researching, I am afraid these files are generated by VS automatically, and it seems there is no settings for them.

    I suggest you try below steps which seems to work for someone. Please check above ways one by one to see whether they meet your requirements.

    1. While adding service reference, uncheck the option “Reuse types in referenced assemblies”
    2. Define your custom class types in a shared class library, and reference that class library in both client and service project
    3. This issue seems to be related with VS, I suggest you try to generate client code by svcutil.exe. While there is a need to update the service reference, it is quicker to just drop and recreate them.

    >> This pollutes our changesets very much.

    Do you mean you used TFS or GitHub to manage your project? Since these generated files are not used, you could ignore them when you sign in TFS or GitHub.

    Hope it will help.

    Best Regards,

    Edward


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Thursday, November 17, 2016 2:40 AM