How To Get Multiple Overlapping Config Files For Multiple Solutions
Mar 30, 2011
I'm very new to ASP.net, so I'm just figuring this out.First off, I have multiple separate projects that will be hosted on the same server.Second, they must be able to share certain settings (like connection string, configuration options, etc).Third, those shared settings must be configurable for different deployments (test, prod, etc).
I have two webconfig files, on in the root directory and one in the other directory. I dont know how to access or specify for the particular pages or APIs those are in the folder.Root webconfig file used by another section and the 2nd one accessed by another api. I have no idea about that
We are working on a web application that creates more web applications.Each web application will have to get a Url Rewrite rule (URL REWRITE MODULE 2.0).As far as I know, there's no way to add such rules without modifying the web.config file (am I right??).So my plan was to work with multiple web.config partial files. One main .config file, and lots of .config files per application (every file will contain it's web application url rewrite rules).This way sounds a little bit messy, but I can't think of anything else, and suggestions will be welcomed.
I'm designing a framework solution DLL with reusable code that I like to use for many different projects,
I want this DLL to be able to load unknown configuration variables dynamically based on the solution its running from.
I like to load my config variables like this: MyConfig.MyVariableX
Hopefully I can also to validate my variables when the web application loads (by type) and make sure it's not missing(otherwise Throw New ApplicationException("Missing..."))
It would also be nice if I can have intellisense on these variables
I want solution A (web application) to have the configuration variables and solution B (DLL) to load the variables from the configuration file in solution A
I'm thinking maybe I should create a database table to hold the variables with types and stuff...
What would be the best way to do it ?
How can I read unknown list of variables names and values from a config file and populate my class with it on runtime ?
How to apply the asp.net authorization in two different folders ?
How to use the multiple login for multiple folders ?
i have two different login pags in folders ADMIn and VEndors ...i want when any of the user directly access any of the page inside admin folder then it redirect to login page of Admin folder ......and if any of the user directly access any of the page inside Vendors folder then it redirect to login page of Vendors folder ......
I have an application that uses resource files to display items in multiple languages. My app uses quote a lot of javascript and the alerts need to display in the local language. To do this, I have created an http handler which will read the keys and values of the culture-specific resource file and write them to a JSON array which is then embedded in the page in a script tag, the messages can then be accesses using, for exmaple:
Message.Error (en-GB = "Error", fr-FR = "Erreur")
The messages http handler works great in development, however when I run the application on a test server, I get the error: Could not find any resources appropriate for the specified culture or the neutral culture. Make sure "Resources.Alerts.resources" was correctly embedded or linked into assembly "App_GlobalResources.b0n9j90e" at compile time, or that all the satellite assemblies required are loadable and fully signed. The code that I use to acccess the resource file is:
Where Resources.Alerts is the type that contains my multi-lingual definitions. The build action for the Alerts.resx file is set to "Embedded Resource". Any ideas why this works locally but not on my test server, am I missing something?
My team is creating several solutions to develop separate branches of the same site. We have some CSS, partials, and master view files that we would like to somehow share between solutions. I have tried linking files but that has to be done for each and every file (cannot link directories, it seems). Does anyone have a tried and true system for doing this sort of thing for larger sites (other than putting everything in one massive solution)?
for example i have two web config in a application.when we display the first page we have to get the connstring from first web config.then we display the second page we have to get the connstring from second web config.
I know this question is asked (and answered) a lot already, but I believe my situation is unique.
We are using the ASP.NET SqlMembershipProvider. However, we also have some less-secure content we would like to secure by adding users directly to the web.config, like so...
Is it possible to use this method alongside a SQL Membership Provider? If so, how?
I know it's bad practice to do this. This is only a stepping stone as we move parts of our website into the asp.net application. We would like some of those password to be easily editable without going to the database.
I'm trying to use ConfigurationManager.AppSettings.GetValues() to retrieve multiple configuration values for a single key, but I'm always receiving an array of only the last value. My appsettings.config looks like
I am designing a webpage that allows users to select multiple files and download those files. I was wondering if someone could point me in the right direction or examples as to how this accomplished in asp.net using VB.NET as my language. I'm thinking I need to determine which check boxes the user checked and then go out and programatically go out using VB.NET and compress and put those files in one zip file which will be sent to user for download. It would be nice also to incude a progress bar as well on the webform as it's compressing the files..
Is it possible to specify that multiple roles are required inside the authorization element of the web.config file? I currently have this block in one web.config of my site for a specific directory:
I've just identified a special case where a person with two lower-level permissions than Global and Region should also have access to this directory. Roughly, I want something like this:
I am using a Network Solutions (NS) shared hosting account. When adding two domain names to my NS account I originally had my entire hosting folder "/htdoc/" assigned to my first domain. I was instructed by customer service to create a new sub folder for each domain and assign the domain names to each one using my NS account manager. Each website is its own application with vastly different settings At this point my directory looked like this:
It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS
Naturally I called NS assuming that all they need to do was change a setting so that each sub folder would serve as the main directory for each site. Instead I was told that I need to configure /htdocs/ as its own application with a special web.config file configured to handle this in some way. Of course my next question was how do I configure the web.config to solve this problem and instead of answering the question they said that the question was outside the scope of their customer support.
What I need is simple. Code to add to a web.config with default settings in the /htdocs/ directory that specifies the sub directories as the parent directories for those websites and that no setting in any specifec site should have an effect on any others.
I am attempting to setup Config Transforms on my project that I migrated to VS 2010. The web project works just fine, but I have a WCF Host project that I seem to be unable to add transforms.
We would like to add styles and images to location, e.g. location path="images, styles". Is it possible to put multiple paths in location element (and how)?