FileNotFoundException

Topics: Web Client Software Factory, User Forum
Jan 14, 2009 at 5:00 AM
Edited Jan 14, 2009 at 5:02 AM
Hello everyone,

I can create a business module using Guidance Package Wizard. Later on, I have to unload that business module that I have created earlier. The problem after that, it keep trying to load the module and of course it won't be exist and it will spit a FileNotFoundException exception (as shown below):

[FileNotFoundException: Could not load file or assembly 'RFQ' or one of its dependencies. The system cannot find the file specified.]
   System.Reflection.Assembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection) +0
   System.Reflection.Assembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection) +43
   System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +127
   System.Reflection.Assembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +142
   System.Reflection.Assembly.Load(String assemblyString) +28
   Microsoft.Practices.CompositeWeb.Services.ModuleLoaderService.Load(CompositionContainer rootContainer, IModuleInfo[] modulesInfo) +202
   Microsoft.Practices.CompositeWeb.WebClientApplication.LoadModules() +258
   Microsoft.Practices.CompositeWeb.WebClientApplication.Application_Start(Object sender, EventArgs e) +162

It looks like that somewhere the module is still exist. Anyone know how to get rid of the issue? Thank you in advance for your help.
Jan 14, 2009 at 2:53 PM
Please check your configuration file.

Chester
Jan 14, 2009 at 10:34 PM
Edited Jan 14, 2009 at 10:37 PM
Hi Chester,

Thanks for your respond. I think that is nothing special or related to that unloaded module in the web.config file (as you can see below). I have also searched the word 'RFQ' for the entire solution and this word is not exist. I have no clue what is wrong with this. Any hint or idea? Thanks a lot.

   <configSections>
    <sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
      <sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
        <section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication" />
        <sectionGroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
          <section name="jsonSerialization" type="System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="Everywhere" />
          <section name="profileService" type="System.Web.Configuration.ScriptingProfileServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication" />
          <section name="authenticationService" type="System.Web.Configuration.ScriptingAuthenticationServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication" />
          <section name="roleService" type="System.Web.Configuration.ScriptingRoleServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication" />
        </sectionGroup>
      </sectionGroup>
    </sectionGroup>
    <sectionGroup name="compositeWeb">
      <section name="modules" type="Microsoft.Practices.CompositeWeb.Configuration.ModulesConfigurationSection, Microsoft.Practices.CompositeWeb" />
      <section name="authorization" type="Microsoft.Practices.CompositeWeb.Configuration.AuthorizationConfigurationSection, Microsoft.Practices.CompositeWeb" />
    </sectionGroup>
    <section name="securityConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Security.Configuration.SecuritySettings, Microsoft.Practices.EnterpriseLibrary.Security, Version=3.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
    <section name="loggingConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.LoggingSettings, Microsoft.Practices.EnterpriseLibrary.Logging, Version=3.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
    <section name="exceptionHandling" type="Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Configuration.ExceptionHandlingSettings, Microsoft.Practices.EnterpriseLibrary.ExceptionHandling, Version=3.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
    <section name="hibernate-configuration" type="NHibernate.Cfg.ConfigurationSectionHandler, NHibernate" />
    <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,log4net" />
  </configSections>
  <connectionStrings />
    <compositeWeb>
    <modules>
      <module name="Shell" assemblyName="Shell" virtualPath="~/" />
    </modules>
  </compositeWeb>

Jan 14, 2009 at 10:52 PM
Edited Jan 14, 2009 at 10:53 PM
Under each module directory of your web site, there is a web.config as well.

Chester
Jan 14, 2009 at 11:23 PM
Yes, you are right. Under each module directory in my web site have already web.config file.
Jan 15, 2009 at 1:45 PM

Hi,

I think you already removed the references from the Web Site Project to the Business Module that you unloaded because you should be getting errors when you try to compile the solution.

Like Chester said, there is a folder (with a Web.config file inside) per Business Module in the Web Site project (This folder is created automatically by the Guidance Package when you create the Business Module).

I think that the problem is you are unloading the Business Module project, but you don’t delete or move outside the WebSite the Business Module’s folder that contains the Web.config file where the Business Module assembly to be loaded is defined.

 

Probably, you have a RFQ folder inside your website, try removing it or commenting the lines similar to these in the Web.config file inside the module folder:

 

<module name="RFQ" assemblyName="RFQ" virtualPath="~/RFQ">

<dependencies>

<dependency module="Shell" />

</dependencies>

</module>

 

Please, let me know if this helps.

 

Ezequiel Sculli

http://blogs.southworks.net/esculli/

Jan 18, 2009 at 9:44 PM
Hi esculli,

Yes!!! It's solved. Thank you for your help.