question

Elado avatar image
0 Votes"
Elado asked Elado edited

How to add [WebMethod] to a WebApplication

Hello,
I'm doing a project with business logic layer (BLL DAL)
How can I add web services with [WebMethod] ?

I have WebApplication project with asmx.
Which file do I need to add ?

119057-webmethod.png


I see the files are different that it was in visual studio 2017


Thanks in advanced.

dotnet-csharp
webmethod.png (9.8 KiB)
· 6
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

It looks like you added an ASMX service to the project already. What exactly is the problem? Are you trying to add a service references?

Keep in mind ASMX is very old. If you are building a new project then consider implementing Web API.

0 Votes 0 ·

Hi Joe
I need to run the code (from the BLL project) in the browser with WebMethod, how can I do that ?

..................
In the old days it was like that -

119102-cs.png

How is it done today ? is WebMethod obsolete ?
Yea I learned the ASMX 2.5 years ago.


0 Votes 0 ·
cs.png (8.7 KiB)

Are you asking how to add a project reference in Visual Studio??? Keep in mind, that the community cannot see your BLL project so we have no idea how it works.

Yea I learned the ASMX 2.5 years ago.

ASMX has been around since the early 2000s. Even 2.5 years ago ASMX was outdated...


How is it done today ? is WebMethod obsolete ?

As stated above, today we use RESTful services; Web API. The latest framework is ASP.NET Core.









0 Votes 0 ·
Show more comments

0 Answers