ASP.NET Web Api metadata exchange? - asp.net-mvc

Does anyone knows if there is any way to expose the new ASP.NET WEB Api REST interface metadata as with WCF (/help)?
<standardEndpoints>
<webHttpEndpoint>
<standardEndpoint name="" helpEnabled="true"
automaticFormatSelectionEnabled="true" />
</webHttpEndpoint>
</standardEndpoints>

Help page generation is not supported in the first drop of ASP.NET Web API (in ASP.NET MVC 4 Beta) but is planned to be supported in later versions. The generation of the Test Client website is also planned to be supported.

Related

Migrate FormsAuthentication to .NET5.0

We have an ASP.NET MVC project running on .NET Framework 4.6.1, we use Forms authentication with cookies. We need to migrate this project to .NET 5.0, however Forms authentication is no longer supported.
What would be the best approach/course of action in order to introduce an authentication process that could fit with this migration?
We have used this project https://github.com/synercoder/FormsAuthentication for ASP.NET Core 3.1 and it allows us to seamlessly share cookies of old ASP.NET’s Forms Authentication. You can certainly use it on .net 5.

Adding a New REST Service Project to an ASP.Net MVC SPA

I have been developing an ASP.Net Core 2.0 SPA web application in Visual Studio 2017 which started life using the new Angular SPA Template (ASP.Net Core SPA Templates). I now need to add reporting to the website and the Telerik Reporting solution I am trying requires a REST Service to function.
Telerik provide a VS 2017 template for their REST Service which I used to add a new .Net 4.6.1 Project to my Solution with its own ReportsController and associated references and code etc. The Telerik REST Service requires the full .Net framework.
My solution builds and runs, I can view my Angular web application, but if I use Postman to send a request to the new ReportsController I just get a 500 server error. I have added a reference in my SPA project to the REST Service project, which I may not require. Should I somehow configure the new REST Service in my SPA project's startup class?
How do I configure my solution such that the new REST Service is launched and listening for requests from my Angular web application please?

self hosting asp.net mvc

Is it possible to self host asp.net mvc inside another application ie. console, windows forms, service etc etc.
I'd like to build an app that offers a web interface to control it and I'd like to use asp.net mvc for the web part of it.
I did take a quick look at Nancy which looks like it would work, though its not asp.net mvc it did support razor although it doesn't have quite the same level of support for it as asp.net (eg. strongly typed views)
I did also find this question but it doesn't really go into much depth
Possible to use ASPNET MVC2 without IIS?
You can use "IIS 7.0 Hostable Web Core" and host the web server as part of any user process, even a console application. The benefit is that it is very similar to full blown IIS (incl config etc) but the web server itself is running in your process.
Have a look at the following articles:
Host your own Web Server in your application using IIS 7.0 Hostable Web Core
Creating Hosted Web Core Applications
Please have a look at http://cassinidev.codeplex.com/
It has many advantages for example
No need IIS 7 on client machine
Support MVC (I have tested myself)
Work well with Windows Form and Web Browser Control for packaging as Windows App
Cross Win OS platform ( Windows XP, Vista, 7) I have test XP with .NET 4 installed
Hope this helps.
I know this question is old, but it is still relevant, so with the .NET Core 1.0 + ASP.NET MVC 6 you can self-host your MVC application easily. You can even combine MVC and WebAPI applications into one, and you can decide later if you want to use IIS, IIS Express or the self-hosting feature of the .NET Core.
You can try it if you follow the Yeoman approach from this post:
https://stackoverflow.com/a/30314393/980247

how to convert an existing asp.net mvc 3 web application to azure

I have a solution with 1 asp.net mvc application and some class libraries (core, repo, service, tests).
What are steps needed to convert this solution to azure ?
An ASP.NET MVC 3 application is nothing more than an ASP.NET application so the following blog post stands true.

How to access system.webserver web.config node in .NET 2

Are there any .NET APis that can read/update the system.webServer node in web.config? I know I can do it via reading/parsing the web.config file as xml but that's awkward.
To read/update the system.web node in .NET 2 I can use:
HttpModulesSection httpModulesSection = (HttpModulesSection)configuration.GetSection("system.web/httpModules");
But is there any API based way of accessing system.web/modules using .NET 2?
I have to reference the .NET 2 version of system.web.configuration because I don't know in advance if my web app will be run on a server with .NET 2 or 3.5. So it is limited to .NET 2 API calls only.
Thanks
You need to use the Microsoft.Web.Administration.dll assembly. You can check this blog post.

Resources