I've structured my application architecture similarly to the UIPAB quickstart samples so that I've got a presentation layer, business layer, data access layer etc. and my Controller is contained in a separate library called "MAJ.MyApplication.Common.dll".

The problem occurs when it tries loading this assembly to get a reference to my Controller defined in the config file defined as follows:

...
<views>
<view
name="StartView"
type="MAJ.MyApp.WinUIPresentationLayer.StartView,
MAJ.MyApp.WinUIPresentationLayer,
Version=1.0.0.0,
Culture=neutral,
PublicKeyToken=null"
controller="MyController"
stayOpen="true"
floatable="true" />

</views>
...

<controller
name="MyController"
type="MAJ.MyApp.Common.MyController,
MAJ.MyApp.Common,
Version=1.0.0.0,
Culture=neutral,
PublicKeyToken=null" />
...


The exception is thrown in line 73 in GenericFactory.cs of the UIPAB:

try
{
// Use full assembly name to get assembly instance
assemblyInstance = Assembly.Load( typeSettings.Assembly );
}
catch(Exception e)
{
throw new UIPException( Resource.ResourceManager.FormatMessage( Resource.Exceptions.RES_ExceptionCantLoadAssembly, typeSettings.Assembly )+UIPException.GetFirstExceptionMessage(e), e );
}


with the following message and stack trace:

Message: "Could not load file or assembly 'MAJ.MyApplication.Common, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified."

StackTrace: " at System.Reflection.Assembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection)\r\n at System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)\r\n at System.Reflection.Assembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)\r\n at System.Reflection.Assembly.Load(String assemblyString)\r\n at Microsoft.ApplicationBlocks.UIProcess.GenericFactory.Create(ObjectTypeSettings typeSettings, Object[] args) in c:\\Program Files\\Microsoft Application Blocks For .Net\\User Interface Process 2.0\\Code\\Microsoft.ApplicationBlocks.UIProcess\\Factories\\GenericFactory.cs:line 73"

Although the exception message says "The system cannot find the file specified", the assembly, named "MAJ.MyApp.Common.dll", does exist in the Common\bin\Debug folder.

I just can't see what is causing this problem. Could anyone suggest a probable cause and solution?

Thanks.