Use different .Net Framework for subfolder - asp.net

I have the requirement to build a simplier admin interface for a website. I believe MVC 3 (I want to use .Net 4) would be a good fit, but the main site is using webforms and .Net 3.5. Is it possible to have a subfolder using MVC 3 (I would build a new solution) without affecting the main application? Is there any issues if it possible? So I would have www.mysite.com as asp.net 3.5 web forms and www.mysite.com/simplifiedadmin as the MVC 3 project. Any help, opinions, or advice is welcomed. Thanks.
Edit:
Just to be clear to future readers, when I mention the 3.5 framework it is in reference to what I am using as a target framework in VS. The application pool will references the 2.0 framework on IIS. Thanks Josh for pointing that out.

You have to use two different Application pools, but that is certainly possible in IIS by creating a new Application within the site (in IIS Manager) and giving it a .net 4 Application Pool.
PS: You could also use ASP.net MVC 2 on .net 3.5 if that makes things simpler.

Firstly you seem to be confused about what a sub domain is. If your main site was on www.mysite.com and your administration site was on admin.mysite.com that would be a sub-domain, as it stands, from reading the question that isn't a sub-domain, you want it in a separate directory.
It is possible if you have full control over IIS - you would create an application pool for the new application with the right version of the .NET framework and then, once you've create the new directory, right click it in IIS Manager and choose convert to application. Once that's done right click the folder and choose Manage Web Site -> Advanced Settings and change the application pool.

That is not a subdomain, that is a subfolder.
A subdomain to mysite.com would be simplifiedadmin.mysite.com. (www.mysite.com is actually also a subdomain to mysite.com.) A subdomain has its own DNS record, so it's quite easy to run as a separate application, or even on a different server.
A subfolder can also run as a separate application, but it has to be on the same server. You can either put a subfolder in the web and make it an application in IIS, or you can create a virtual directory that points to a folder somewhere else on the server, and make that an appliction.

Related

Host multiple sites on one domain with IIS

I have few web apps: ASP.NET MVC 4.5, ASP.NET CORE MVC 3/6 and also blazor wasm hosted on ASP.NET CORE 6.
I want to hosst them on one domain with different paths as roots. Like this:
mydomain.com/firstsite
mydomain.com/secondsite
mydomain.com/thirdsite
and etc.
Can I do it somehow on Windows Server 2016 with IIS? Every site use his own authenticication and cookies.
Of course you can achieve this requirement, we can add virtual application under IIS site.
Mytest Steps
1. Setings in IIS
2. Important point, please note.
If we set the main site to .net framework, then the virtual application .net core site should recreate an application pool.
Because the application pool of .net core should choose No Manage Code type.
3. In your blazor webapp, you need change the default path like below.
Add the virtual path in your index.html file.

ASP.NET Core Web API living inside a ASP.NET 4 IIS Web Site

I am tasked to to build a Web API application. The app will be hosted inside an existing web site - a pre-ASP.NET 5 web application with a WCF web service.
I wonder - can I build the web-api application using ASP.NET Core 1 in a way that it can happily exists as a sub application inside the already existing site in IIS?
Thanks!
Yes, this is possible, I'm doing the opposite of this scenario but conceptually its the same thing. You need to create your subsite as a separate application in IIS with its own app pool. That app pool needs to be configured No Managed Code per the instructions on the Docs site https://docs.asp.net/en/latest/publishing/iis.html
The only other thing you need to watch out for is that the web.config in the subsite will inherit some settings from the root web.config, so you need to remove or clear things sometimes like handlers, modules, etc.
If I understand you correctly it is not possible what you want. Please refer to the following documentation about hosting ASP.NET Core on IIS: https://docs.asp.net/en/latest/publishing/iis.html.
If you specifically look at the .NET CLR version in the application pool it should be "No Managed Code" while your current website is set to a .NET framework version I assume. This is because ASP.NET Core is now cross plaform and completely web server agnostic. It even needs a little 'trick' (the ASP.NET Core Module) to work on IIS. See: "The module creates the reverse-proxy between IIS and the Kestrel server."
But if you follow the link provided above I think you'll manage to work it out.

Run .NET Web Application in subfolder of another .NET MVC application with IIS

I'm not sure the other questions I've seen pertained to this scenario, so this may be a duplicate.
I am running a site called http://mysite.mydomain.com/. We are transitioning to a new version in a piecemeal format, and I want all the new transactions to live in a different MVC application. I'd like to do the following:
http://mysite.mydomain.com/v2/ - New application
Is this possible to simply point a subfolder to the new application. Then in my old web site, I can simply redirect to the subfolder and hit the new application?
This is utilizing IIS.
Yes, this is possible. You can even use WebDeploy to deploy both the root and child web application. Just set these MSBuild properties:
<PropertyGroup>
<DeployIisAppPath>Default Web Site</DeployIisAppPath>
<SkipExtraFilesOnServer>True</SkipExtraFilesOnServer>
</PropertyGroup>
The following blog post details this setup.
http://dotnetcatch.com/2016/03/03/simple-service-versioning-with-webdeploy/

How to protect ASP.NET MVC/IIS application from copying?

We are developing intranet base solution in ASP.NET MVC. It will be deployed across client's own internal network hence respective employee of client can use it.
As it is IIS based intranet application, one can easily copy files and configure IIS on other server. So what are the different solution available to prevent this.
Thank you in advance.
Generally when you are publishing the ASP.NET MVC web app, you can publish the version in dlls.
So Instead of creating a single Web App, you can create a new dll file where you are going to compile all the Models of the App and save it in a dll).
Then coming back to your original solution you will add the reference to this dll so no logic can be taken of your solution.

Allow asp web application in MVC site

We build a new MVC4 web site. when we tried to replace existing asp.net webforms website with new MVC4 web site there was a web application inside that website which is pointing to different folder which is having asp files. So we want to support that project as is.
example : website1.com is a website name
website1.com/Customasp is web application in different folder which has to be mainitained.
files in that are hello.asp
website.com/customasp/hello.asp is returning a 404 page. whats wrong with this.
Please help
You will need to create 2 distinct application on IIS.
One for MVC project (root) and second for your classic ASP app which should be defined as virtual directory(customasp) within MVC project.
All that will depend on what version of web server are you using.
You need to make sure that app pool for MVC running on NET 4.0 or better since it is MVC 4 and classic ASP poll running in proper format.
In IIS 7+ it should be set to "No Managed Code". Also make sure that MIME type as well as ISAPI filters properly assigned for both application separately. And if you are using IIS 7+ make sure that ASP mode is enabled because by default it is not.

Resources