Reference.vb file

TheMatrix

Member
Joined
Feb 15, 2008
Messages
14
Programming Experience
5-10
Hi,

I want to add an override method in the reference.vb file from my Web Service project. I cannot find the file in my solution and i cannot see it even by clicking the "show all files" icon.

I searched on my C for this file and my search failed. I know this file is supposed to be auto-generated when building a project but can we access it to modify code?

I am using .NET 2003 so am i missing something to view this file?

Thanks
 
No problem with clicking to view the code on the asmx file.

I am unable to view the reference.vb file in my solution.

I need to put that code in that file but unable:

VB.NET:
Protected Overloads Overrides Function GetWebRequest(ByVal uri As Uri) As WebRequest  
    Dim webRequest As HttpWebRequest = DirectCast(MyBase.GetWebRequest(uri), HttpWebRequest)  
      
    webRequest.KeepAlive = False  
    webRequest.ProtocolVersion = HttpVersion.Version10  
    Return webRequest  
End Function
 
Web services are compiled programs too, even if you could insert the code, you would need to re-compile the service which would mean you need to be at the computer it's running on and hope the source code is there too
 
To find the generated web service client consumer proxy class have a look at this screenshot:
referencevb.png

Funny your file search didn't find it also, it is in a folder structure from project that follows the same structure as in Solution Explorer: "\the project\Web Services\the namespace\reference.vb"

When you open it notice this generated comment:
Changes to this file may cause incorrect behavior and will be lost if the code is regenerated.
This means you can't edit that class. In VB.Net 2.0 there is partial classes so it can easily be extended with user code, but for you that is not an option. Instead you can simple add a new class to your project and copy the code you need from the generated, then use your own class to interact with the web service instead of the genered one.
 
Back
Top