开发者

upgrading a project from vs 2008 to 2010 loses generated code in service reference

I have a project that I'm upgrading from 2008 to 2010.

My problem is with the code being generated by a service reference. Any classes used in the Reference.cs are given by their full name according to the reference

The difference results in a 'cannot convert from foo.Data.MtkBaseRequest to foo.WebServicesClient.ModelDataService.MtkBaseRequest'

So I have the old code

namespace foo  
{  
  public abstract class MtkBaseRequest{}  
}

And this code be开发者_开发知识库ing called

List<MtkBaseRequest> newList = new List<MtkBaseRequest>(requestArray);  
this.DataAccessWebService.doStuff(newList);

but this is the method it means to call(which is generated)

public void doStuff(System.Collections.Generic.List<foo.WebServicesClient.ModelDataService.MtkBaseRequest> requests)

So what's happening is that the namespace no longer matches for the class which should be the same. In the code generated by VS 2008 the method being called is:

public void doStuff(System.Collections.Generic.List<foo.Data.MtkBaseRequest> requests)

Is there a work-around, or something I can do to get the code generating properly?

BTW: the project this is in is called WebServicesClient, the service reference is ModelDataService


I fixed it, turns out there were some assemblies hanging around in the GAC.
stupid GAC

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜