开发者

Add Service Reference not appearing

In a Windows Phone 7 Silverlight project, I had a service reference to a WCF service. This morning when I opened up the project, suddenly the namespaces f开发者_如何学Pythonor my WCF service were unknown. The option for "Update Service Reference" in Solution Explorer was not there, so I deleted the Service Reference with the intent of re-adding it. But the option for "Add Service Reference" is also not there. Gone. Disappeared.

Closed and re-opened the solution. Restarted VS2010 Ultimate. No dice. Anyone run across this?


I don't know how this happends in the first place, so we don't know the cause yet, but I found a solution to the problem.

Open your *.csproj file in Notepad or Textpad or something like that. Find where it has the tag. Replace that tag with this:

<ProjectTypeGuids>{14822709-B5A1-4724-98CA-57A101D1B079};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>

Close and re-open the project and the option to add service references will be usable.


In my case, I changed my target framework from .Net Framework 2 to .Net Framework 4. The "Add Service Reference" appears immediately

Change Project Properties


I had the exact same problem with the missing "Add Service Reference" context menu option in Visual Studio 2017 with a regular C# desktop app project.

For me, the problem could be fixed by simply re-creating the entire project solution from scratch within Visual Studio. It turned out that the original project solution file had been created by an earlier version of Visual Studio, and this seems to have caused the problem.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜