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
1,105 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:adaco
[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:adaco
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 500 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
Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

 
LVL 6

Author Comment

by:adaco
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:adaco
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

Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

Question has a verified solution.

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

The recent Microsoft changes on update philosophy for Windows pre-10 and their impact on existing WSUS implementations.
A procedure for exporting installed hotfix details of remote computers using powershell
This tutorial will walk an individual through the steps necessary to enable the VMware\Hyper-V licensed feature of Backup Exec 2012. In addition, how to add a VMware server and configure a backup job. The first step is to acquire the necessary licen…
This tutorial will walk an individual through the steps necessary to install and configure the Windows Server Backup Utility. Directly connect an external storage device such as a USB drive, or CD\DVD burner: If the device is a USB drive, ensure i…

749 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