This question is locked. New answers and comments are not allowed.
Hi.
I think I have found a bug in the new enhancer. The enhancer tries to resolve a referenced assembly but cannot find it (in the obj folder I think)
The exception occurs when using three assemblies and a persistent type in one assembly references a persisten type in another. Both classes extending a third persistent class a third assembly.
The exception is created in method:
The 'SearchDirectory' function tries to locate the referenced assembly but cannot find it. It loops through a list of directories bu the list only contains "." and "bin\"
The assembly is passed in to VEnhancer and but does not get forwarded into Cecil it seems.
To recteate problem:
- Create three Class Libraries, Lib1, Lib2 and Lib3
- Create One Persistent Class in each library: Lib1.BaseClass, Lib2.DerivedReferencedClass and Lib3.DerivedClass
- The persistent classes in Lib2 and Lib3 should extend BaseClass in Lib1
- Add a reference field in Lib3.DerivedClass to Lib2.DerivedReferencedClass
- Update Config References
- Compile solution
The build goes fine but the enhancer should fail.
I have created a test solution (VS2010) which will produce the error. If you want me to send it to you (need an email address though) please let me know.
Regards
Pål
I think I have found a bug in the new enhancer. The enhancer tries to resolve a referenced assembly but cannot find it (in the obj folder I think)
The exception occurs when using three assemblies and a persistent type in one assembly references a persisten type in another. Both classes extending a third persistent class a third assembly.
The exception is created in method:
namespace
Mono.Cecil
public
abstract
class
BaseAssemblyResolver : IAssemblyResolver {
public
virtual
AssemblyDefinition Resolve(AssemblyNameReference name){
AssemblyDefinition assemblyInGac =
this
.SearchDirectory(name,
this
.directories);
(...)
throw
new
FileNotFoundException(
"Could not resolve: "
+ name);
}
}
}
The 'SearchDirectory' function tries to locate the referenced assembly but cannot find it. It loops through a list of directories bu the list only contains "." and "bin\"
private
AssemblyDefinition SearchDirectory(AssemblyNameReference name, IEnumerable<
string
> directories)
{
string
[] strArray =
new
string
[] {
".exe"
,
".dll"
};
foreach
(
string
str
in
directories)
{
foreach
(
string
str2
in
strArray)
{
string
path = Path.Combine(str, name.Name + str2);
if
(File.Exists(path))
{
return
this
.GetAssembly(path);
}
}
}
return
null
;
}
The assembly is passed in to VEnhancer and but does not get forwarded into Cecil it seems.
To recteate problem:
- Create three Class Libraries, Lib1, Lib2 and Lib3
- Create One Persistent Class in each library: Lib1.BaseClass, Lib2.DerivedReferencedClass and Lib3.DerivedClass
- The persistent classes in Lib2 and Lib3 should extend BaseClass in Lib1
- Add a reference field in Lib3.DerivedClass to Lib2.DerivedReferencedClass
- Update Config References
- Compile solution
The build goes fine but the enhancer should fail.
I have created a test solution (VS2010) which will produce the error. If you want me to send it to you (need an email address though) please let me know.
Regards
Pål