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,092 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
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

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Web site error 3 41
Initial get page response times and IIS8 15 51
ADFS for O365 login page 2 48
FTP Directory Permissions 3 26
Scenario:  You do full backups to a internal hard drive in either product (SBS or Server 2008).  All goes well for a very long time.  One day, backups begin to fail with a message that the disk is full.  Your disk contains many, many more backups th…
OfficeMate Freezes on login or does not load after login credentials are input.
To efficiently enable the rotation of USB drives for backups, storage pools need to be created. This way no matter which USB drive is installed, the backups will successfully write without any administrative intervention. Multiple USB devices need t…
This tutorial will show how to configure a new Backup Exec 2012 server and move an existing database to that server with the use of the BEUtility. Install Backup Exec 2012 on the new server and apply all of the latest hotfixes and service packs. The…

772 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