?
Solved

How to setup a .NET app within a subdirectory of a site that is a different .net app

Posted on 2010-09-16
6
Medium Priority
?
1,129 Views
Last Modified: 2012-05-10
We have a main site that is .net nuke and I want to run another .net application in a subdirectory of the main site.  When I do this though the app within the subdirectory gives me an error because it is trying to use the web.config file of the main site.  Is this possible or do have to create another site?

Thanks
Abe
0
Comment
Question by:Ada County
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
6 Comments
 
LVL 30

Expert Comment

by:Brad Howe
ID: 33696683
Hi
Root web.config settings are inherited, unless they are overridden by a web.config further down the directory tree.
ASP.NET Configuration File Hierarchy and Inheritance
http://msdn2.microsoft.com/en-us/library/ms178685.aspx
For your Folder setup, Have the physical directories isolated and then create a virtual App under your IIS root. Therefore they each have separate application roots, so they would *not* inherit from a directory placed higher than them in the directory tree.
Cheers, Hades666
0
 
LVL 6

Author Comment

by:Ada County
ID: 33696854
Unfortunately I cannot have all the .net apps at the same directory level because the main site is .net nuke.
0
 
LVL 30

Accepted Solution

by:
Brad Howe earned 2000 total points
ID: 33696906
This is the way web.config work.  If this is what you have, then you will need to block child inheritance from the top down.
 <location path="." inheritInChildApplications="false">
<system.web>
 ...
</system.web>
</location>
-Hades666

0
NFR key for Veeam Agent for Linux

Veeam is happy to provide a free NFR license for one year.  It allows for the non‑production use and valid for five workstations and two servers. Veeam Agent for Linux is a simple backup tool for your Linux installations, both on‑premises and in the public cloud.

 
LVL 6

Author Comment

by:Ada County
ID: 33697042
Ok I added the code but I still get an error. I attached some screen shots.
Server Error in '/ar' Application.
--------------------------------------------------------------------------------

Could not load file or assembly 'DotNetNuke.HttpModules' or one of its dependencies. The system cannot find the file specified. 
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.IO.FileNotFoundException: Could not load file or assembly 'DotNetNuke.HttpModules' or one of its dependencies. The system cannot find the file specified.

Source Error: 

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.  

Assembly Load Trace: The following information can be helpful to determine why the assembly 'DotNetNuke.HttpModules' could not be loaded.


WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].

 

Stack Trace: 


[FileNotFoundException: Could not load file or assembly 'DotNetNuke.HttpModules' or one of its dependencies. The system cannot find the file specified.]
   System.RuntimeTypeHandle._GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark, Boolean loadTypeFromPartialName) +0
   System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark) +64
   System.RuntimeType.PrivateGetType(String typeName, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark) +58
   System.Type.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase) +65
   System.Web.Compilation.BuildManager.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase) +62
   System.Web.Configuration.ConfigUtil.GetType(String typeName, String propertyName, ConfigurationElement configElement, XmlNode node, Boolean checkAptcaBit, Boolean ignoreCase) +45

[ConfigurationErrorsException: Could not load file or assembly 'DotNetNuke.HttpModules' or one of its dependencies. The system cannot find the file specified.]
   System.Web.Configuration.ConfigUtil.GetType(String typeName, String propertyName, ConfigurationElement configElement, XmlNode node, Boolean checkAptcaBit, Boolean ignoreCase) +346
   System.Web.Configuration.Common.ModulesEntry..ctor(String name, String typeName, String propertyName, ConfigurationElement configElement) +66
   System.Web.HttpApplication.BuildIntegratedModuleCollection(List`1 moduleList) +152
   System.Web.HttpApplication.GetModuleCollection(IntPtr appContext) +1070
   System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) +97
   System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context) +176
   System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +296
   System.Web.HttpApplicationFactory.GetPipelineApplicationInstance(IntPtr appContext, HttpContext context) +54
   System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +237

[HttpException (0x80004005): Could not load file or assembly 'DotNetNuke.HttpModules' or one of its dependencies. The system cannot find the file specified.]
   System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +548
   System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +78
   System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +334

 

Open in new window

ar.jpg
ar.jpg
0
 
LVL 30

Expert Comment

by:Brad Howe
ID: 33697395
Hi,
What do you mean you can't move the Directory. Take the c:\inetpub\wwwroot\ar folder as an example and place in c:\inetpub\ar. Then create a Virtual directory like you have above and make it an application.
This should resolve your issues,
-Hades666
0
 
LVL 6

Author Closing Comment

by:Ada County
ID: 33719729
Thanks for help, it seemed like the key was first creating the virtual directory then convert it to an application.  Thanks again
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A procedure for exporting installed hotfix details of remote computers using powershell
Resolving an irritating Remote Desktop connection that stops your saved credentials from being used.
This tutorial will walk an individual through configuring a drive on a Windows Server 2008 to perform shadow copies in order to quickly recover deleted files and folders. Click on Start and then select Computer to view the available drives on the se…
This tutorial will show how to configure a single USB drive with a separate folder for each day of the week. This will allow each of the backups to be kept separate preventing the previous day’s backup from being overwritten. The USB drive must be s…
Suggested Courses

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question