ASP.Net WebServices: Attribute specifier is not a complete statement

June 19, 2006

I’ve recently been tasked with adding some functionality to a web service I wrote some time back. I started by adding a function like this:

_
‘Get the name of an overlay from its ordinal reference
Public Function GetOverlayName(ByVal intOverLayNumber) As String
Return aString
End Function

This caused Visual Studio.Net intellisense to throw an error, highlighting the closing greater than sign, the error was:

“Attribute specifier is not a complete statement. Use line continuation to apply the attribute to the following statement”

Eh?! I have used line continuation!

Turns out you can’t have a comment directly below a declaration, so I removed the comment and it now works fine. To add a comment, make sure its within the function/sub declaration, like this:

_
Public Function GetOverlayName(ByVal intOverLayNumber) As String
‘Get the name of an overlay from its ordinal reference
Return aString
End Function

Advertisements

2 Responses to “ASP.Net WebServices: Attribute specifier is not a complete statement”

  1. renuka said

    on this line i got an error please help me to solve the error->

    Error 6 Attribute specifier is not a complete statement. Use a line continuation to apply the attribute to the following statement.
    i m trying to print details of emploee from textbox..

    • Hi, did you follow my article? Make sure you don’t have any comments above the method declaration. Try removing all comments perhaps? If that doesnt help, post your code and I will try to assist…although its been a while since I’ve written any VB!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: