How to force HTTPS on asp.net MVC VNext? - asp.net-mvc

Does someone know how to force HTTPS in MVC Vnext?
I have read a couple of articles about forcing HTTPS in MVC, but in the new version VNext, alot of things have changed so they are all kinda deprecated so im pretty lost right now

That part hasn't changed much. You can use the same RequireHttpsAttribute

Related

Does Razor use SignalR by default?

So, I have been reworking an old WebForms site that our company has. In my initial efforts, I used Blazor which is SignalR based. This went well until I deployed the site to our servers that are behind a load balancer. After some research, I have come to the conclusion that unless the load balancer is configured to use sticky sessions, SignalR will not work.
https://learn.microsoft.com/en-us/aspnet/core/signalr/scale?view=aspnetcore-3.1
And, unfortunately, our IT department refuses to do so.
So, I am reconsidering using an MVC project with Razor pages. My question is, will a project of this sort use SignalR under the hood as well, thus putting me in the same predicament?
If there are any other gotchas that anyone with more experience could point out, that would be appreciated as well.

Angular JS with MVC

I want to know if Angular JS can be used with ASP.NET MVC architecture in any way? I have tried searching on Google, but can't figure out if Angular JS is usable in .cshtml page of ASP.NET MVC and is it the good idea to use it?
you can definitely use AngularJs with Asp.Net MVC as it is a client side framework which entirely runs in the browser. It doesn't depend on any of the Asp.Net features as such. There are lot of samples available online. Here is a channel 9 video which guides you through
From the official ASP.net pages: Hands On Lab: Build a Single Page Application (SPA) with ASP.NET Web API and Angular.js
The fact that is uses WebAPI shouldn't really matter here, as that's a detail matter of implementation. AngularJS works fine on top of either.
First hit on google...
If you looking to achieve CRUD in your application I recommend this post as a guide to follow. Even though this uses WEB API, its still a good way of getting to grips with angularjs.
Hope this helps.
CRUD with SPA, ASP.NET Web API and Angular.js

On what level can SPDY be used?

I'm curious how SPDY should be implemented when using an ASP.NET MVC application. As far as I know it is not the case by now, but should I wait for an updated MVC (5), new IIS-server, upgraded .net-framework, or something else?
My understanding of this question is "can I use spdy with my IIS based server and .net application".
As I understand it, IIS would need to implement the protocol, and/or a third party would need to offer a module for IIS that implements this. So far, I have not found either of these, but will update my answer if I do.

IIS 6 Extensionless URLs

I am attempting to do some domain redirects on one of the sites on my server (Server 2003, IIS6), but the Extensionless URLs feature of .Net 4 keeps tacking on that eurl.axd/GUID before the redirect. I found some info on that here.
I would just disable this feature, as described here, but I am pretty sure this will impact an MVC .Net site I also have set up in IIS (because MVC uses extensionless URLs).
Can someone please assist me in finding other options? Is there a way to just remove the eurl.axd/GUID from the URL, via an IHttpModule? I haven't been able to find an example of anyone doing this or something similar.
Ok, I seem to have fixed things on my own. Originally I had both my websites set up in IIS under the same App Pool. I separated them into different app pools, made sure they were both set to .Net 4, and everything started working. Now when users are redirected from one domain to another, the eurl.axd/GUID does not get tacked on to the end of the URL.

Do you lose functionality when hosting ASP.NET MVC on IIS 6? If so, what?

As a dev team, we're looking to switch to asp.net MVC and I've heard rumors about IIS 6 not being able to support all of the MVC functionality. Is this true? Is there any official set of functionality supported in IIS 7 vs IIS 6? Should we completely avoid running it on IIS6?
You do not loose any functionality of ASP.Net MVC; however, you have one of two options. You can either define an extension on your URL's which will allow you to set up mapping. So for example:
www.example.com/books/computer/list
might become:
www.example.com/books.mvc/computer/list
You can use any extension you want so long as you map to ASP.Net. I am currently using .aspx which meant I could avoid changing IIS configuration at the sacrifice of having extensionless URLs.
The other option as mentioned is using a wild card mapping. What this does is route all requests to ASP.Net. Even requests for static content such as images. This does have a negative effect on performance that you will want to measure. There are ways around this, I believe such as placing all your content in a specific virtual directory that you turn off the wild card mapping for, but I haven't fully explored that option.
I think the issue with IIS6 is extensionless URLs that you can easily achieve by adding a wildcard ISAPI map in IIS configuration.
So, no. While I love IIS7 integrated mode and strongly recommend using it, you won't lose functionality using it. I've deployed several ASP.NET MVC 1.0 projects on Windows Server 2003/IIS6.
Url rewriting can help you to solve the problem. I've implemented solution allowing to deploy MVC application at any IIS version even when virtual hosting is used.
http://www.codeproject.com/KB/aspnet/iis-aspnet-url-rewriting.aspx

Resources