How to use 2 web.config file in a single web application

Hello Guyz,

In my web application I'm trying to use a Blog and for that I'm using the free version of community server. The blog itself runs fine. But I'm trying to use it as a subdomain of my original application.

The blog itself has its own web.config file as my application does and for that it's throws the following  error

Parser Error Message: 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.

It's happens only because of 2 web.config file in a single application, but I have to use it anyway.

So guyz if you have any idea then please let me know.

Thanks in advance

Regards--Arindam 


Mark It as Answer if it helps you....

My Other Articles

http://www.codeproject.com/KB/aspnet/Any_Video_to_FLV.aspx
http://www.codeproject.com/KB/aspnet/ImageMagick.aspx
http://www.codeproject.com/KB/aspnet/swf2img.aspx
0
arinhere
11/20/2007 2:06:07 PM
asp.net.vs2005-webapp-projects 1239 articles. 0 followers. Follow

3 Replies
765 Views

Similar Articles

[PageSpeed] 40

just what the error says, if you want a sub app you can do so by making its directory as a virtual directory therefore setting it as an application...this way it shall work and you can have a web.config in that directory.

simply go to iis take the parent folder where your web.config is (second one) and make it an app(virtual directory)


Joël Hébert [MVP ASP.NET]

Opulent ASP Development Inc.
www.opulentasp.com
Ottawa,Canada

Click "Mark as Answer" on the posts that helped you to help future readers to get the solutions
0
Joël
11/20/2007 4:09:45 PM

Thanks Joel for your comment. But what about server? Suppose in my local system I create a virtual directory to that parent directory, which give me a intented result?

But how would I access it on the server? Please let me know.

Waiting for your reply

Thanks in advance

Regards--Arindam


Mark It as Answer if it helps you....

My Other Articles

http://www.codeproject.com/KB/aspnet/Any_Video_to_FLV.aspx
http://www.codeproject.com/KB/aspnet/ImageMagick.aspx
http://www.codeproject.com/KB/aspnet/swf2img.aspx
0
arinhere
11/21/2007 5:16:24 AM

Hi Arindam,

Based on my understanding, you have two web.config files. One is in the root directory and another is in the sub-directory. If I have misunderstood it, please let me.

For this scenario, the root cause is some elements in web.config don't allow sub-directory level. All of those elements have an attribute: allowDefinition="MachineToApplication". It means we can only define those elements in machine level and root application level.

To solve this issue, please remove the elements (in the sub-directory web.config) which can result in this problem. For example: membership, roleManager, sessionState, authentication, and so on. They can automatically inherits from the root web.config.

For more information about this scenario, please refer to my replies in the following thread:

Server Error in '/Forms' Application
http://forums.asp.net/t/1167482.aspx


Sincerely,
Benson Yu
Microsoft Online Community Support

Please remember to mark the replies as answers if they help and unmark them if they provide no help. This can be beneficial to other community members reading the thread.
0
Benson
11/22/2007 2:12:40 AM
Reply:

Similar Artilces:

Why we use Web.Config File for connection string wether we can use class Library for get connection for whole web Application
 Why we use Web.Config File for connection string wether we can use class Library for get connection for whole web Application  please help me? Friend, Web.config has its own advantages. 1) Web.Config is used to store the important information like connections strings etc...so that it can be modified even after the code has been    deployed to the server without compiling the entire application again. 2) Since it is a XML file, there is no need of building the project of you are going to change the connection strings.   If you go for the class files,...

VS 2005 SP1 + .NET AJAX => automatically adds web.config in nested Web Application Project when opening project or solution
I get a 'Configuration Error' on an aspx page because VS added automatically a web.config to my nested Web Application Project where no web.config file should be. This effect I have noticed since I have installed SP1 and .NET AJAX Extensions. Why is VS 2005 adding the web.config file and how can I disable this behavior? Following is the content of the automatically added web.config file (comments omitted): <?xml version="1.0"?><configuration>    <appSettings/>    <connectionStrings/>    <system.web> &...

one application has many web.config files which web.config file execute first?
hi to all In my application i will add three web.config file which will execute first. how to set it. Give me a guidlines. by Devan.G Hi,You can't add multiple web.config to applicationYou can add single web.config to each folder present in sub directories of your applicationYou can override the web.config files using multiple config files.SatalajWatch The true story of internet ||Yet another forum |||I'm big fan of Open source flash chart for .net very very simple I n t e r v i e w T i p s Hi, You can check this reference: http://www.beansoftware.com/ASP.NET-Tutorials/Mult...

.Net 2.0 Web application using Vb.net is unable to create object of another dll writen in C# .net 2.0
Hi, I habe created one ASP.net web application using Vb.net which is adding reference of dlls written in C# and .net 2.0. But whenever trying to create object of referencing dll, it is throwing error :Object reference does not set to an object. But, locally it is working fine,. In the server i have deployed the .aspx files and dll files in the bin. There were already an web.config in the server which is of .net 1.1. But checked it is retrieving value for that web.config correctly. Should i have to deply any other files and if not what can be the solution for this? Please help. Thanks, So...

How to use web deployment projects with multiple web application projects.
I followed the guide on this page http://support.microsoft.com/kb/307467 "How To Create an ASP.NET Application from Multiple Projects for Team Development" and I now have my main app at the root of the application and I have all of the sub applications as sub directories of the root application.  It all works great when I do a normal debug build or a normal publish.  The problem is that I have nested sitemaps, nested master pages, and of course, nested web.config files.  Basically the root app has a master page, sitemap, and web.config file and each child app ...

How do I use .pdb files in .NET 2.0 Web Applications
I've been a .NET web developer for a number of years, and I got real used to the .PDB file information on my website error routines.  I have a standard error handler I've used, that will just dump the error object into an email, and send it to me on any web error.  This has worked fine for years, and always gave me a line by line trace of where the problem is.  I can solve most problems in only seconds by just looking at the trace. If I have a .NET 1.1 application that I convert to .NET 2.0, it still uses the .PDB file, and I get the error information like I always ha...

Encrypting web AND window application config files (.NET 2.0)
What would be the easiest way to encrypt both web and windows application config files (all being on the one server)? I know about the 'aspnet_regiis' command, but as it doesn't do application config files I was wondering if a single GAC shared assembly could be used to initially encrypt  (an interface for encrypting, with developer then manually implementing) and decrypt the data.TIA  I'm not sure I follow you.  Still hope this helps: http://weblogs.asp.net/scottgu/archive/2006/01/09/434893.aspxZhao Ji MaSincerely,Microsoft Online Community Support“Please remember to click...

vs2005 web application with vs2005 web deployment project build failed
We Migrated our faily large ASP.NET project (has several folder hierarchy and our aspx pages refers to usercontrols in parent folders) to a VS2005 Web Application (not web site) project.Migration went well. We can build and run the project successfully.But when we comes to deploy vs 2005 web application project we did not find publish web site option unfortunately.So we added a Web deployment project to our web application project. But we could not complie the web deployment projecteven though we can complie out web application project. We encounter the following error in all of our ascx pag...

Web Deployment Project deploying files not included by Web Application Project
Recently my boss asked me to find a way to share a web site project between 2 separate projects which will only share a subset of the files in the folder.  I created 2 web applications projects in the folder and eliminated the web site project.  I discovered when I publish the web application projects, that it wasn't compiling the .as*x pages, so I looked into web deployment projects.  The problem I'm having with web deployment projects is that when I build them from the solution configuration, it copies all the files in the web project to the deployment folder and I c...

Is it possible to migrate VS2005 Web Application Project to VS2005 Web Site.
Good afternoon.On my first project using VS2005, it was a brand new project so we didn't have to face the migration issue.  As we were developing right after VS2005 was released, we created the code using File | New | Web Site.I have now moved onto my second project and this one is a migration from a previously existing .NET 1.1 codebase to .NET 2.0.   We are currently investigating the best approach for migrating this code from VS2003 to VS2005.  We are thinking that at least initially, we might convert the code into a VS2005 Web Application Project using the steps located at...

Problem when deploying Web Application project over VS2005 Web Site project
Hi,  we ran into this issue yesterday evening when we were trying to deploy new code on production box. It was running previous version of our app that was VS 2005 Web Site project, but the new version was migrated into Web App project. New build was tested on sandbox and even on the same production machine (but under different, non public web site configured there) and was working fine. However, when we deployed on production web site, we got this error:Compiler Error Message: CS0246: The type or namespace name 'ProfileCommon' could not be found (are you missing a using directi...

Web Deployment Project outputs too many files from Web Application Project
Hi everyone, I just downloaded and installed the final releases of the Web Deployment Project and Web Application Project. I created a simple Web Application Project, and then a Web Deployment Project for that web app. When I click Build on the Web Deployment Project context menu, the build succeeds, but in the target folder, I find more files than are necessary. Included are the vbproj, "My Project" folder, "obj" folder, and the files within those folders. This may be naive, but I was expecting the same results as right-clicking the Web App project and choosing Publish; just with the add...

running 2 web.configs in the same website 1 in /web.config and one in /swf/web.config
Im having issues doing this. and when i remove the authentication from the swf/web.config it still doesnt seem to be applying to the child website at all. Whats the proper way to set a child website? Thanks!!  The lower most web.config overrides all previous settings. So if you remove the section from the /swf/web.config whatever settings you have in the web.config in the next higher level will have an effect on the content of the child folder.So instead of removing a section, try giving appropriate settings in the /swf/web.config....

web.config file of root directoy interferes with the sub-application web.config.
Hello! I encountered a problems when I added new sub-application to my application,  with its own web.config, When I try to open page www.mypage.com/subapplication/ It reads the web.config of www.mypage.com and throws an exception (I think it tries to loadsome dlls from root-bin directory (exactly ATLAS files..)  <add name="ScriptModule" type="Microsoft.Web.Services.ScriptModule"/> - exception on this line ) But why it reads the web.config of root dir? What can I do to solve that problem? Thank you.Artashes This is the expected behavior. web.config are inher...

Web resources about - How to use 2 web.config file in a single web application - asp.net.vs2005-webapp-projects

Application - Wikipedia, the free encyclopedia
Text is available under the Creative Commons Attribution-ShareAlike License ;additional terms may apply. By using this site, you agree to the ...

Development application for Holt golf course land open for public inspection
The developers selling 350 dwellings on disused parts of the Holt golf course have submitted their development application for public inspection. ...

Radius CEO Says Drug Application Delayed for `Work-Life Balance'
... Ward said. Radius fell 11 percent to $61.51 Tuesday after the company said in a statement that it was delaying submitting a new drug application ...

Samsung Unveils the Latest Application Processor, Exynos 8 Octa, Built on 14-Nanometer FinFET Process ...
Samsung Electronics Co., Ltd., a world leader in advanced semiconductor technology, today announced the newest member of its Exynos family of ...

MBA: Mortgage Refinance Applications Decrease in Latest Weekly Survey, Purchase Applications up 18% YoY ...
From the MBA: Refinance Applications Decrease in Latest MBA Weekly Survey Mortgage applications decreased 1.3 percent from one week earlier, ...

Mortgage applications rise 6.2%
Home loan borrowers seem undeterred by the highest interest rates in five months.

Help wanted: Obama's tech-training project now accepting applications
Organizers of innovative training programs can now apply for a federal grant to help prepare low-wage workers for more-lucrative tech jobs.

Thousands of Java applications vulnerable to nine-month-old exploit
A popular Java library has a serious vulnerability, discovered over nine months ago, that continues to put thousands of Java applications and ...

Google pushing virtual reality applications
Google has been pushing its R&D into virtual reality applications and is looking to enhance YouTube with the ability to provide virtual reality ...

ARM Math Libraries to Speed HPC Applications
At the SC 15 show, the company will demonstrate the libraries that will improve the performance of applications running on 64-bit ARM systems. ...

resources last updated: 11/20/2015 5:06:11 PM