I am currently converting a project from VB to C#. I have a Web Reference in the VB project which I have referenced in the C# project (Add Web Reference). The signatures are the same. The VB code looks like this:
If Not tws.StartSession(tsd) Then
Throw New systemMonitor.internalEx.securityEx("Failed to initiate a TROPOS session")
End If
I have tried to covert that across as this:
// Start our session
if (!this._service.StartSession(this._details))
throw new Exception("The TROPOS session failed to start.");
The problem I have, is that it won't compile and comes up with the error:
argument 1 must be passed with the 'ref' keyword
so I changed it to this:
// Start our session
if (!this._service.StartSession(ref this._details))
throw new Exception("The TROPOS session failed to start.");
which compiles and runs (although nothing seems to happen, but that is another issue). My question is simple. In VB do you not have to set the ByRef keyword?