partialName = value;
} else if (debug) {
System.err.println("Unrecognized keyword in URI: " + keyword + " (ignored)");
}
}
Assembly asm;
try {
//noinspection ConstantIfStatement
if (false) throw new cli.System.IO.FileNotFoundException();
if (partialName != null) {
asm = Assembly.LoadWithPartialName(partialName);
} else if (loadFrom != null) {
String abs = loadFrom;
if (baseURI != null) {
abs = ResolveURI.makeAbsolute(loadFrom, baseURI).toString();
if (debug) {
System.err.println("Absolute location URI: " + abs);
}
}
asm = Assembly.LoadFrom(abs);
} else if (href != null) {
asm = Assembly.LoadFrom(href);
} else {
String longName = asmName;
if (ver != null) {
longName += ", Version=" + ver;
}
if (loc != null) {
longName += ", Culture=" + loc;
}
if (sn != null) {
longName += ", PublicKeyToken=" + sn;
}
asm = Assembly.Load(longName);
// asm = Assembly.Load(aname);
}
if (debug) {
System.err.println("Assembly " + asm.get_FullName() + " successfully loaded");
System.err.println("Assembly codebase (" +
(asm.get_GlobalAssemblyCache() ? "GAC" : "local") +
"): " + asm.get_CodeBase());
}
} catch (cli.System.IO.FileNotFoundException err) {
if (debug) {
System.err.println("Failed to load assembly " + uri + ": " + err.getMessage() +
" (FileNotFoundException)");
}
throw new XPathException("Failed to load assembly " + uri + ": " + err.getMessage());
} catch (Throwable err) {
if (debug) {
System.err.println("Failed to load assembly " + uri + ": " + err.getMessage() +
" (" + err.getClass().getName() + ")");
}
throw new XPathException("Failed to load assembly " + uri + ": " + err.getMessage());
}
cli.System.Type type = asm.GetType(typeName);
if (type == null) {
if (debug) {
System.err.println("Type " + typeName + " not found in assembly");
}
throw new XPathException("Type " + typeName + " not found in assembly");