Add a web link to the project, but make the automatically generated proxy classes internal (i.e. not public)

I am creating a class library that uses a web link at its data access level, but, unfortunately, it does not seem to be an acceptable way to set access for automatically generated proxy classes. By default they are public , but I do not want to open proxy classes outside the library.

I found this on MSDN , but all answers point to manually changing proxy classes to set access modifiers.

No wonder all proxy classes have this at the top:

 //------------------------------------------------------------------------------ // <auto-generated> // This code was generated by a tool. // Runtime Version:4.0.30319.42000 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. // </auto-generated> //------------------------------------------------------------------------------ 

So, I want to play by the rules and not worry about remembering to check access modifiers every time I compile a project - something that can be easily missed.

Is there a more β€œofficial” way to set the default access modifier on proxy classes created for a web link?

EDIT:

I found this article which is related to setting access for service links , but I'm talking about an old style web link (if you click the "Advanced" button when adding a link to the service, click the "Add Web Link ..." button). The article does not address my problem.

For anyone interested, the reason I use web services instead of WCF is because I work with SQL Server Reporting Services (SSRS), which seems to have tied all of my documentation to web service calls, not to WCF service links (which appear to exist, but are very poorly documented).

+3
access-modifiers c # auto-generate web-reference
source share

No one has answered this question yet.

See similar questions:

7
ReportingService2010 could not be found

or similar:

76
Retrieving RAW Soap Data from a Web Reference Client Running on ASP.net
8
How to create a web service link without INotifyPropertyChanged?
4
WCF design principle: is it recommended to edit automatically generated proxy classes?
one
Specify the CLR namespace for the web service auto-generated proxy class
one
Specify a database base class with automatic web service generation
0
Creating a proxy class via WSDL
0
Different proxy class when adding a WCF service as a link to a web service and a service
0
Cannot use WCF service without adding reference or proxy classes
0
web link: how to change proxy class code
0
Compiled proxy class (in basket) against web link

All Articles