I'm working on an application which should add a vdir on the default web site.
Before adding the vdir I need to check whether the default web site exists.
The way I'm doing it today is using the DirectoryServices via c# (example).
The problem is that using the DirectoryServices on IIS7 is possible only when the IIS6 backwards compatibility roles are installed.
I have no problem with creating the vdir since it is done after adding the IIS6 b/w compatibility roles (yes, the default web site test must be before :-) ).
Is there any alternative way for querying the IIS?
Maybe through the registry/file system?
Thanks a lot.
Related
I'm building a site for SaaS.
I'd like to distinguish sites by Domain name to use same contoller.
The reason why I want to make multiple IIS Application is, There are tons of HttpContext.Current.Application in Application_Start() and OnActionExecuting(). And It should be isolated by domains.
My questions are :
Is there any solution for multiple IIS Application using same C# MVC controllers?
If not, Is there other container instead of HttpContext.Current.Application?
Or, Is there other solution that is more elegant, efficient, or effective?
What I tried for creating multiple IIS Application are :
Setting same path.
Set only bin directory to same path as virtual directory
However, Nothing works.
I Hope this is helpful
Windows Server 2012 / IIS 8.5
VS 2013 / C# MVC5 / .Net Framework v4.5.0
Thank you.
Is there any solution for multiple IIS Application using same C# MVC controllers?
Yes.
IIS7 - How do I use the same physical path for different domains?
Can I configure IIS to use the same physical path for different sites but use custom web.config
If not, Is there other container instead of HttpContext.Current.Application?
Or, Is there other solution that is more elegant, efficient, or effective?
It is possible to have multiple domains pointed to a single web application. For more information take a look at IIS Bindings
In my organization, there is a process where in for every new website/application to be added into the IIS, we have to go through a 6 weeks complex process and waiting. Even after the process completes the team will not have access to IIS. We can only deploy the build files using TFS, web deploy etc.
I have initiated the process for my first application/site in the IIS. I wanted to know if there is a way I can avoid future request/process for new application, by making this upcoming application an application of applications :). Something like child applications. But remember I do not have IIS access. I still have access to my application's web config. I also have the freedom to manage URL structures/patterns.
Either by using multiple routes, multiple projects etc. Just thinking loud. My applications will be of type web api, mvc etc
Any crazy ideas? Thanks in advance.
You can have several application roots in IIS, which can be virtual or real directories, under the same site.
Those separate applications will have separate configs and will not inherit each other's settings.
You can access your apps under the same domain, or to be configured to use different domains
http://www.domain.com/app1, http://www.domain.com/app2
They can share the same app pool or be configured to use different.
Since you don't have an access to IIS, I'm not sure how would you configure the app pool or domain, but perhaps Microsoft.Web.Administration namespace will help doing this from code. It contains managed classes to manage all aspects of IIS, including the configuration . It can be used from .Net or from PowerShell.
Creating Sites and Virtual Directories Using System.DirectoryServices
Using IIS Programmatic Administration
I need to implement a functionality in one of my web app in such a way that if i host a webapp in the IIS (let say
http://localhost/mywebapp
), it should also open through
http://localhost
I simply cannot install my web app on the root web app i.e.
http://localhost
For this, I found a setting in web.config for IIS7 named as HttpRedirect. Which i set programatically during application installation.
But, I wouldn't able find the same setting for IIS6 which i can set programmatically. I found a solution through which it can be done but its manually. http://www.serverintellect.com/support/iis/iis-url-redirect/
Any idea on how to create this programatically in IIS6.
I am using c# as a language in .net4.
Does anyone know of an analytics package, either open source or commercial, that can be integrated into a corporate MVC3 site running in a restricted environment?
The (rather rigid) requirements for my project are: -
The solution must be installed locally, which sadly rules out Google Analytics.
The solution must track analytics for individual users / customers.
The solution must work on a Microsoft technology stack and work under IIS 7.5.
Unfortunately due to client sensitivities (I.E., security and brand reputation) they cannot use publically analytics packages and thus rule out Google, Open Web Analytics, etc.)
Thanks, and let me know if I need to make the requirements clearer.
Piwik is one of the best open source Web Analytics solution. I understand you need a solution in Microsoft stack but this is based on PHP.
I am using this to tracking SharePoint web applications and I am running Piwik using IIS 7.5.
Configure IIS to use a detailed log. Then use a IIS log analayzer tool (there is plenty, google).
http://awstats.sourceforge.net/ is pretty popular. (PHP, but easy to configure in a separate website in IIS)
A .NET based analyzer: http://www.iis.net/community/default.aspx?tabid=34&i=1864&g=6
I am looking to implement a WebDAV server in ASP.Net. the app will be deployed to IIS 6. I have seen a few frameworks that provide this functionality, but I can't seem to identify how they're able to accomplish it without (apparently) modifying IIS settings.
My specific question is how do I configure IIS and ASP.Net so that a IHttpModule/IHttpHandler might have an opportunity to handle any of the additional WebDAV verbs (i.e. LOCK, OPTIONS, PROFIND, etc.)
There is no way to configure WebDAV verbs in IIS 6 without modifying IIS settings. It is possible only with IIS 7 and later.
To handle all verbs required by WebDAV in IIS 6 you will need to create an application wildacrd map. Right click on your web application in IIS 6 MMC console and go to Properties->Virtual Directory Tab->Configuration. Click Insert to add new wildcard map.
Executable - \Microsoft.NET\Framework\<.Net
Framework Version>\aspnet_isapi.dll
Verify that file exists - Unchecked
On Home Directory tab of your application properties set Execute permissions to Scripts only and allow reads.
Here is the web.config example: http://www.webdavsystem.com/server/prev/v2/documentation/hosting_iis_asp_net/webconfig_example
Please note that this web.config example was specifically created and tested with ASP.NET 2.0 on IIS 6 on Server 2003 and IIS 5.1 on XP. It does not handle &, %, + and trailing dots (.).
ASP.NET 4.x provides means for handling any special characters in your WebDAV server, configuring web.config, including &, % and '.'. The web.config that supports IIS versions 6-8 is generated by IT Hit WebDAV Server Engine Wizard.
Check out Geoff Lane's articles on WebDAV:
http://www.zorched.net/2006/01/20/aspnet-web-application-without-aspx-extension/ - shows configuration of verbs in IIS and HttpModule setup.
http://www.zorched.net/2006/02/02/custom-webdav-server-using-net/
http://www.zorched.net/2006/03/01/more-webdav-tips-tricks-and-bugs/
I would take a look at this project http://sourceforge.net/projects/webdav/ for a webdav implementation in C#. If you must build your own it is nice to reference a completed one; even better if you can reuse it.
Yes, you will need to modify IIS6 settings to support binding the ISAPI module for .NET to all request types and not checking if a file exists. There is no other way to do this on IIS6 because web dev clients on windows will do an OPTIONS request on the root (/) of the website when checking for webdav support.
II7 gives you more options...