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,068 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
  • 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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
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

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Join & Write a Comment

Sometimes drives fill up and we don't know why.  If you don't understand the best way to use the tools available, you may end up being stumped as to why your drive says it's not full when you have no space left!  Here's how you can find out...
Possible fixes for Windows 7 and Windows Server 2008 updating problem. Solutions mentioned are from Microsoft themselves. I started a case with them from our Microsoft Silver Partner option to open a case and get direct support from Microsoft. If s…
This tutorial will walk an individual through locating and launching the BEUtility application to properly change the service account username and\or password in situation where it may be necessary or where the password has been inadvertently change…
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…

706 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now