Home Dashboard Directory Help

Adding a service reference not relative to the project's default namespace by Marcel Veldhuizen


 as By Design Help for as By Design

Sign in
to vote
Type: Suggestion
ID: 478305
Opened: 7/29/2009 12:47:02 PM
Access Restriction: Public


When adding a service reference to a web application, there is a simple dialog box allowing you to customize a number of settings, including the namespace used for the generated proxy classes.

The namespace entered in this dialog is relative to the global namespace for the project. However, I would like to be able to add a reference using an absolute namespace.

For example:
Web service internal namespace for contracts: MyCompany.Services.MyService
Web Application project default namespace: MyCompany.Sites.MySite

I'd like to add the reference with the namespace MyCompany.Services.MyService. Right now, I can only accomplish this by changing the default namespace for the web application to "MyCompany". If the web app were made by OtherCompany, it would get really nasty.

Right now, I've worked around this by setting explicit namespace URIs in my ServiceContract and DataContract attributes, and then editing the <NamespaceMappings> of Reference.svcmap manually to get what I want.
Sign in to post a comment.
Posted by Microsoft on 8/5/2009 at 12:27 PM
Thank you for your feedback. While we will not be able to make this change in the upcoming release of Visual Studio, we will continue to track this for considerating during subsequent releases/updates.

Best regards,
Posted by Microsoft on 7/31/2009 at 3:15 AM
Thanks for reporting this issue. We are routing this suggestion to the product unit who works on that specific feature area. The team will review this suggestion and make a decision on whether they will fix it or not for the next release.

Thank you,
Visual Studio Product Team
Sign in to post a workaround.
Posted by Marcel Veldhuizen on 7/29/2009 at 12:49 PM
Edit <NamespaceMappings> in Reference.svcmap to explictly map a namespace uri to the desired CLR namespace.

See problem description and http://stackoverflow.com/questions/1200346/wcf-service-reference-namespace-differs-from-original for details.