Error on return from function call in ASP.NET "Operation is not supported on this platform."

N

news.microsoft.com

I am getting the following error on the return from a function call.It
specically happens on the assignment of the return value from the function
call. No error happens inside the function. The function is returning an
Integer with a value of 1.

Err.number =5
Err.Description=Operation is not supported on this platform.
Err.Source=System.Web

Anyone ever seen this error or can explain why I am getting this? Thanks,

Steve M
 
N

news.microsoft.com

I found out what was causing this problem. Not only is the message
misleading, the error is raised way after the fact. see Example below, by
changing the ByRef to ByVal the code works. The example below will have the
URL and the error is raised on the exit of the function. In my opinion the
error should be raised on trying to enter the function so the developer has
some clue as to what is really wrong when debugging.

to recreate the error use this code

Dim RC as integer
RC = TestFunction(Request.ServerVariables("HTTP_HOST"))

Public function TestFunction( ByRef URL as string) as integer
return 1
end function
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top