简体   繁体   中英

How can we use C# without ASP.NET with a JS framework for developing Single Page Applications?

I am looking for a way to use HTML , CSS , JS Framework like Angular or Vue in the front page and use C# without ASP.NET in the backend to develop Single Page Applications. Is there any possible way to do it? I mean can we use C# without ASP.NET in the backend as an API and develop Single Page APPS?

I googled it a lot but did not find any helpful resources so I came here to get help of the stackoverflow experience.

Thanks in advance for any help.

Yes, ASP.NET is an entirely optional part of a .NET web application.

Depending on how you want to host it, you can just let your code work in an Owin middleware, an IIS module or handler or a plain old HttpListener, and so on, causing "raw" HTTP requests to end up in your code.

You can then mix and match features from ASP.NET or third-party libraries such as routing, security, content negotiation (serialization), bundling and minification and effectively you'll be creating a Frankenstein monster that won't work as well as ASP.NET and that others can barely maintain.

At least one such framework already exists and is called "Nancy", and has all the drawbacks mentioned above, in addition to a barely maintained and poorly debuggable cousin of Razor.

So the answer is "yes, but why?".

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM