none
Reference.svcmap file shows different method signatures RRS feed

  • Question

  • Hi all,

    I have a service reference in one of my projects that have the correct method signatures in the interface and the .svc file. But my service reference shows older method signatures that I changed awhile back in the Reference.svcmap file.

    1) I tried cleaning each project and rebuilding and building.

    2) I tried getting rid of the files in the obj/debug and bin folders manually. 

    3) I also tried to manually edit the Reference.svcmap file and of course it worked but when I update the service reference in one of my projects, it goes back.

    4) I tried deleting the service reference and adding a fresh service reference.

    I am confused at where I can edit this for good since my method signatures in both  interface and the .svc file match. Everything ran perfectly and I didn't change these method signatures for months and all of a sudden I get these errors. Could these files be corrupted? Anyone have any idea?

    Thursday, March 20, 2014 2:16 PM

Answers

  • I would just re-write the function name with the same signature and delete the old ones if you have access to the service code. Use the same logic in the methods. I never came across this problem but it seems no one else can fix it.
    Tuesday, April 1, 2014 7:14 PM

All replies

  • From what you wrote, I am making a couple assumptions.  First of all, I assume you created your reference to the WCF service using the Add Service Reference wizard in Visual Studio.  If that is the case, you should never manually edit the Reference.svcmap because it was generated by Visual Studio from the URL.  You can just update your reference by clicking on the service and choosing Update Service Reference from the menu.  It will do all the work for you to make sure that the new contracts show up as expected. 

    My second assumption is that you wrote the WCF service.  If you actually removed an existing operation, this will break your client unless you create a new version of your WCF service and reference this instead.  See this article on Data Service Versioning.  If you do not want to create a new version of your service because you want to make sure no one ever, ever calls that method again under any circumstances, you could keep the operation the same, but throw a Fault Exception in the method and/or use the Permissions attribute to prevent any user from being allowed in this method.  This may be necessary if external clients are using parts of your service.  If you create a new WCF version, then you need to delete your old service reference from your client and reference the new version.  If you just change the methods in the service, you may not need to do anything, but the old operations will still appear to be available. 

    If someone external wrote the service, make sure you have the URL for the correct version in your service reference. 

    Hope that helps!


    Christine A. Piffat

    Thursday, March 20, 2014 3:13 PM
  • I did use the VS Add Service Wizard and I did write the WCF service. I did not yet publish the service, it is still being debugged in my project. I did delete my service reference and added a new one but still have this problem. Sometimes I clean, rebuild some projects and I get a warning,

    "Warning 11 Could not copy "obj\Debug\EntitiesLayer.dll" to "bin\Debug\EntitiesLayer.dll". Beginning retry 10 in 1000ms. The process cannot access the file 'bin\Debug\EntitiesLayer.dll' because it is being used by another process. EntitiesLayer"

    I will close Visual Studio 2012 and that warning will go away. I never had so many problems with Visual Studio 2008. I just don't know why my Interface, svc file match but my service reference still shows an older version of my Interface and .svc file even after a new service reference is established. Is Visual Studio saving the older files somewhere else in my project?

    Thursday, March 20, 2014 6:34 PM
  • It does sound as if it is storing the old version somewhere.  I did see the same warning you mentioned once on Visual Studio 2010 (what I am still using for my services), and only managed to get rid of it by doing a pretty thorough cleaning of everything.  Basically, I did all the steps you mentioned--deleted all project and service references, cleaned the solution, and then deleted every bin and obj folder in both Debug and Release for each project.  Then I started with the bottom project (EF in my case) and did a build on that project alone.  After that, I moved up layer by layer and added the required project (or service references) to each project and then did a build on just that project.  Finally, I did a build on the entire solution.  It was tedious, but it seemed to remove whatever was causing the problem.  I never did figure out how it got out of sync, though. 

     

    Christine A. Piffat

    Thursday, March 20, 2014 7:34 PM
  • Sorry, meant to say deleted the Debug and Release folders in each bin and obj folder.

    Christine A. Piffat

    Thursday, March 20, 2014 7:41 PM
  • One other question--is your service in a separate project from your client? 

    Christine A. Piffat

    Thursday, March 20, 2014 8:13 PM
  • Yeah its located in a separate project.
    Thursday, March 20, 2014 8:38 PM
  • Don't know if this will help but I will throw it out there anyway, I am trying to pass a typed datatable through a WCF method. I think awhile back I used the wrong type like instead of passing a Services table I was passing a ServicesParts table. The signature got fixed and for the longest while it was fine. Then I added some more methods and did an update on the service reference and got the type mismatch error. I also just updated SQL Data Tools.
    Thursday, March 20, 2014 8:48 PM
  • I pretty much finished the rest of my project and now I am still stuck on this. I really don't know how to solve this problem since I checked everything out a million times.
    Monday, March 31, 2014 6:49 PM
  • I would just re-write the function name with the same signature and delete the old ones if you have access to the service code. Use the same logic in the methods. I never came across this problem but it seems no one else can fix it.
    Tuesday, April 1, 2014 7:14 PM
  • Yeah this works. I sent Microsoft a bug report on the issue but this gets around the problem. Ty very much guys you all were helpful.
    Tuesday, April 1, 2014 8:28 PM