Is it possible to have two web application projects (one main website and one running in a virtual directory such as an admin site) share the same application pool to allow the sharing of content in the back end such as static lists, session state etc?
A quick google search turned up this related question IIS App Pools & Static Classes with the answer that the two web sites will still be in different AppDomains and will not share Static instances.
If you need to share data between your web applications you would be better served by setting up a shared database/service for the two web sites to communicate via. This would also better adhere to best practices.
Related
I'm trying to lay my hands on MVC currently but I'm a rookie for the moment. I'm tasked to build an intranet web application on ASP.Net MVC5 but I hesitate to do so because it will restrict users in many ways, such as they ought to be in queue sitting on companies PCs and accomplish the required tasks that they are obliged for.
I have read and found out that there is an available option through Web.config file but that is applied if the web application is to be hosted in IIS whereas the web application should be hosted from another server online. Stackoverflow Link
To sum up, I want to enable the website I'm going to create to only be accessible from any device connected to the wireless/cable network of our company whether it is from a PC or from a smartphone/tablet.
I have web application that are using multiple clients.
I should create one copy of application for all clients or every client should have its own copy.
I am using Asp.net MVC and SQLServer.
What you suggest.
Creating seperate projects per client will be troublesome to maintain while a single project for all clients could be difficult to customize. It is a fine line and your needs will dictate how you build your solution.
One of my more recent projects where we do SAS (Software as a Service) we were able to build our MVC application using a plugin architecture so that each client COULD have their own DLL deployed to the BIN that would enable customizations for just that client (to the Views, Assets or even the Controllers). We are able to leverage a single code base and have many clients, most without customizations and some with minor to heavy customizations.
Every client has a unique URL for their "portal" and most often they have private domains, so http://app.mycompany.com or http://mycompanyapp.com and some are even hosted on our own site, http://hostingcompany.com/client/.
By building an application that can determine what client it is based on the URL we were able to handle all of these cases with ease. When we deploy we have a single code base (deployed just ONCE to a single folder) and all of the sites use that same code deployment.
We run a web farm where we have many .NET Web Servers and have load balancing setup and the sites all have ping pages that our load balancers interact with to determine their health.
Like I said, your needs will determine what the best solution for you is.
Nick , what about database should we use one database every client or should have separate database for each client in my scenario our application is more database centric so there are lot of changes done for each client as per there business roles .
Is it possible to develop a web-app in ASP.NET (framework is not a constraint), to have a sandbox architecture, and deploy widgets without disturbing the parent application?
I expect both the parent application and the widget to be developed using .NET.
EDIT:
To elaborate, I want to have an web-app, say App1, and widgets (say wid1 and wid2). wid1 and wid2 should be like a plugin into App1, only difference is that, if I make any changes to wid1, I want to be able to deploy it without disturbing App1 or Wid2.
The widgets can be something similar to a flash object, only that it needs to be developed on .net.
Would something like the Managed Extensibility Framework be what you are looking for? They even have a WebForms sample:- http://mef.codeplex.com/releases/view/44166
I believe you will want to look into Application Pools.
In a web server running IIS with ASP.NET websites, you can create Application Pools which will contain your applications (web sites). You can restrict pools to limit resources usage like RAM, CPU, # of threads, etc. If one of the websites go crazy, it should only affect it's own Application Pool. You can put more than one website in a single Application Pool so if you put all of the websites in one Application Pool, then they will all crash together.
Is it possible to have a central cache for an ASP.NET web application that is accessed using multiple domain names? The web application is using a single website and application pool, with multiple domains (host headers) pointing to it.
A bit of background - the application has a lot of data that doesn't change much, and to alleviate database load, I've been storing this in static variables. This has been working without any problems when there is only a single domain. However, with multiple domains, it seems that each domain name being used to access the website has its own copy of this data, so when it's invalidated in one site, the others still retain their own version causing it to never be updated.
I've tried changing this to use HttpRuntime.Cache instead of static variables, but this also exhibits the same problem where each domain being used to access the site seems to be storing its own version of the data.
Is there any way to cache data within an ASP.NET web application that can be shared (and invalidated) across all domains being used to access it?
Try memcached. You can use the BeIT .Net API.
Memcached runs as a stand-alone service and is meant to facilitate distributed caching. It runs under windows and under Linux.
You could create a table in memory in your database and have all the applications pull from that. It should work essentially the same as your cache does now.
I have an asp.net 3.5 site and I've just written some wcf services. It is ok to just drop the .svc file right alongside my .aspx files or should I move my .svc files onto a separate virtual directory and IP and call it something like services.mydomain.com.
Just wondering what best practices are. Maybe it doesn't make any difference? I have a client app that will update the database that my web site uses. It updates through an IIS hosted wcf service.
IMHO it would be better to isolate the web service into a separate virtual directory and application pool. In this case the client application and the web service don't share the same AppDomain and if one fails the other will continue serving requests.
In our project we tend to keep them in separate virtual directories. I like to regard the service as something that can be used by more than one client, and so I like the deployment and hosting of it separate from the client. Of course, if you just stick it in a separate virtual directory you can argue to what extent the hosting is separated, but at least it is separate on a logical level, and easily moved to separate physical hosting if necessary.
You definitely don't want to have them in the same place - not least because it makes it hard to configure the appropriate level of security. It also makes configuration simpler as they won't share a web.config.