Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1146
  • Last Modified:

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

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
Ada County
Asked:
Ada County
  • 3
  • 3
1 Solution
 
Brad HoweCommented:
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
 
Ada CountyAuthor Commented:
Unfortunately I cannot have all the .net apps at the same directory level because the main site is .net nuke.
0
 
Brad HoweCommented:
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
Simplify Active Directory Administration

Administration of Active Directory does not have to be hard.  Too often what should be a simple task is made more difficult than it needs to be.The solution?  Hyena from SystemTools Software.  With ease-of-use as well as powerful importing and bulk updating capabilities.

 
Ada CountyAuthor Commented:
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
 
Brad HoweCommented:
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
 
Ada CountyAuthor Commented:
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

Creating Active Directory Users from a Text File

If your organization has a need to mass-create AD user accounts, watch this video to see how its done without the need for scripting or other unnecessary complexities.

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now