{"The given assembly name or codebase, 'MyAssemblyDisplayName', wa

G

Guest

Hi,
I'm creating an AppDomain and creating an instance of a class. This works
fine unless I use caching, which I need to use.
The exception that I get is of type "System.IO.FileLoadException" which
message is:

{"The given assembly name or codebase, 'MyAssemblyDisplayName', was
invalid." }

The stack trace is:

"
Server stack trace:
at System.Reflection.Assembly.nLoad(AssemblyName fileName, String
codeBase, Boolean isStringized, Evidence assemblySecurity, Boolean
throwOnFileNotFound, Assembly locationHint, StackCrawlMark& stackMark)\r
at System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef,
Boolean stringized, Evidence assemblySecurity, StackCrawlMark& stackMark)\r
at System.Reflection.Assembly.InternalLoad(String assemblyString,
Evidence assemblySecurity, StackCrawlMark& stackMark)\r
at System.Activator.CreateInstance(String assemblyName, String typeName,
Boolean ignoreCase, BindingFlags bindingAttr, Binder binder, Object[] args,
CultureInfo culture, Object[] activationAttributes, Evidence securityInfo,
StackCrawlMark& stackMark)\r
at System.Activator.CreateInstance(String assemblyName, String typeName)\r
at System.AppDomain.CreateInstance(String assemblyName, String typeName)\r
at System.AppDomain.CreateInstanceAndUnwrap(String assemblyName, String
typeName)\r
at
System.Runtime.Remoting.Messaging.StackBuilderSink.PrivateProcessMessage(MethodBase
mb, Object[] args, Object server, Int32 methodPtr, Boolean fExecuteInContext,
Object[]& outArgs)\r
at
System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg, Int32 methodPtr, Boolean fExecuteInContext)

Exception rethrown at [0]:
"

I have set permissions for the user everyone on the cache directory.
The source code I am using is:


appDomain.SetShadowCopyPath(appDomain.BaseDirectory);
appDomain.SetShadowCopyFiles(); //if i skip this, the following works well

MyClass myClass = (MyClass)
appDomain.CreateInstanceAndUnwrap(assemblyDisplayName,myClassDisplayName);

Thanks a lot.
Pablo.
 
D

David Levine

What are the values of the assemblyDisplayName and myClassDisplayName
arguments you are passing to CreateInstanceAndUnwrap?
 
G

Guest

Dear David,
Thanks for your interest. They are like this:
assemblyname: MyCompany.Solutions.MyProduct.MyAssemblyName
typename: MyCompany.Solutions.MyProduct.MyAssemblyName.MyTypeName

As you can see I'm passing just the name with its full namespace to the
CreateInstanceAndUnwrap method. Besides, it works well if I do not use
caching, so I think this values are right.

What do u think it is happening ? thanks again.
Pablo


David Levine said:
What are the values of the assemblyDisplayName and myClassDisplayName
arguments you are passing to CreateInstanceAndUnwrap?

Pablo said:
Hi,
I'm creating an AppDomain and creating an instance of a class. This works
fine unless I use caching, which I need to use.
The exception that I get is of type "System.IO.FileLoadException" which
message is:

{"The given assembly name or codebase, 'MyAssemblyDisplayName', was
invalid." }

The stack trace is:

"
Server stack trace:
at System.Reflection.Assembly.nLoad(AssemblyName fileName, String
codeBase, Boolean isStringized, Evidence assemblySecurity, Boolean
throwOnFileNotFound, Assembly locationHint, StackCrawlMark& stackMark)\r
at System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef,
Boolean stringized, Evidence assemblySecurity, StackCrawlMark&
stackMark)\r
at System.Reflection.Assembly.InternalLoad(String assemblyString,
Evidence assemblySecurity, StackCrawlMark& stackMark)\r
at System.Activator.CreateInstance(String assemblyName, String typeName,
Boolean ignoreCase, BindingFlags bindingAttr, Binder binder, Object[]
args,
CultureInfo culture, Object[] activationAttributes, Evidence securityInfo,
StackCrawlMark& stackMark)\r
at System.Activator.CreateInstance(String assemblyName, String
typeName)\r
at System.AppDomain.CreateInstance(String assemblyName, String
typeName)\r
at System.AppDomain.CreateInstanceAndUnwrap(String assemblyName, String
typeName)\r
at
System.Runtime.Remoting.Messaging.StackBuilderSink.PrivateProcessMessage(MethodBase
mb, Object[] args, Object server, Int32 methodPtr, Boolean
fExecuteInContext,
Object[]& outArgs)\r
at
System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage
msg, Int32 methodPtr, Boolean fExecuteInContext)

Exception rethrown at [0]:
"

I have set permissions for the user everyone on the cache directory.
The source code I am using is:


appDomain.SetShadowCopyPath(appDomain.BaseDirectory);
appDomain.SetShadowCopyFiles(); //if i skip this, the following works well

MyClass myClass = (MyClass)
appDomain.CreateInstanceAndUnwrap(assemblyDisplayName,myClassDisplayName);

Thanks a lot.
Pablo.
 
D

David Levine

Is the actual name of the assembly
MyCompany.Solutions.MyProduct.MyAssemblyName.DLL? Or are you including the
namespace as part of the assembly name? If so, don't do that. Also, make
sure that the assembly is in a directory that is located by the normal
probing that the fusion layer uses. You should also look at fuslogvw.exe and
see if it is able to locate the assembly and if not, why not.

Pablo said:
Dear David,
Thanks for your interest. They are like this:
assemblyname: MyCompany.Solutions.MyProduct.MyAssemblyName
typename: MyCompany.Solutions.MyProduct.MyAssemblyName.MyTypeName

As you can see I'm passing just the name with its full namespace to the
CreateInstanceAndUnwrap method. Besides, it works well if I do not use
caching, so I think this values are right.

What do u think it is happening ? thanks again.
Pablo


David Levine said:
What are the values of the assemblyDisplayName and myClassDisplayName
arguments you are passing to CreateInstanceAndUnwrap?

Pablo said:
Hi,
I'm creating an AppDomain and creating an instance of a class. This
works
fine unless I use caching, which I need to use.
The exception that I get is of type "System.IO.FileLoadException" which
message is:

{"The given assembly name or codebase, 'MyAssemblyDisplayName', was
invalid." }

The stack trace is:

"
Server stack trace:
at System.Reflection.Assembly.nLoad(AssemblyName fileName, String
codeBase, Boolean isStringized, Evidence assemblySecurity, Boolean
throwOnFileNotFound, Assembly locationHint, StackCrawlMark&
stackMark)\r
at System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef,
Boolean stringized, Evidence assemblySecurity, StackCrawlMark&
stackMark)\r
at System.Reflection.Assembly.InternalLoad(String assemblyString,
Evidence assemblySecurity, StackCrawlMark& stackMark)\r
at System.Activator.CreateInstance(String assemblyName, String
typeName,
Boolean ignoreCase, BindingFlags bindingAttr, Binder binder, Object[]
args,
CultureInfo culture, Object[] activationAttributes, Evidence
securityInfo,
StackCrawlMark& stackMark)\r
at System.Activator.CreateInstance(String assemblyName, String
typeName)\r
at System.AppDomain.CreateInstance(String assemblyName, String
typeName)\r
at System.AppDomain.CreateInstanceAndUnwrap(String assemblyName,
String
typeName)\r
at
System.Runtime.Remoting.Messaging.StackBuilderSink.PrivateProcessMessage(MethodBase
mb, Object[] args, Object server, Int32 methodPtr, Boolean
fExecuteInContext,
Object[]& outArgs)\r
at
System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage
msg, Int32 methodPtr, Boolean fExecuteInContext)

Exception rethrown at [0]:
"

I have set permissions for the user everyone on the cache directory.
The source code I am using is:


appDomain.SetShadowCopyPath(appDomain.BaseDirectory);
appDomain.SetShadowCopyFiles(); //if i skip this, the following works
well

MyClass myClass = (MyClass)
appDomain.CreateInstanceAndUnwrap(assemblyDisplayName,myClassDisplayName);

Thanks a lot.
Pablo.
 
G

Guest

Ok, thanks again for answering.
The actual name of the assembly is
MyCompany.Solutions.MyProduct.MyAssemblyName.DLL.

I will probe the utility you mention. I hope I will do it tomorrow.

Thanks again.
Pablo

David Levine said:
Is the actual name of the assembly
MyCompany.Solutions.MyProduct.MyAssemblyName.DLL? Or are you including the
namespace as part of the assembly name? If so, don't do that. Also, make
sure that the assembly is in a directory that is located by the normal
probing that the fusion layer uses. You should also look at fuslogvw.exe and
see if it is able to locate the assembly and if not, why not.

Pablo said:
Dear David,
Thanks for your interest. They are like this:
assemblyname: MyCompany.Solutions.MyProduct.MyAssemblyName
typename: MyCompany.Solutions.MyProduct.MyAssemblyName.MyTypeName

As you can see I'm passing just the name with its full namespace to the
CreateInstanceAndUnwrap method. Besides, it works well if I do not use
caching, so I think this values are right.

What do u think it is happening ? thanks again.
Pablo


David Levine said:
What are the values of the assemblyDisplayName and myClassDisplayName
arguments you are passing to CreateInstanceAndUnwrap?

Hi,
I'm creating an AppDomain and creating an instance of a class. This
works
fine unless I use caching, which I need to use.
The exception that I get is of type "System.IO.FileLoadException" which
message is:

{"The given assembly name or codebase, 'MyAssemblyDisplayName', was
invalid." }

The stack trace is:

"
Server stack trace:
at System.Reflection.Assembly.nLoad(AssemblyName fileName, String
codeBase, Boolean isStringized, Evidence assemblySecurity, Boolean
throwOnFileNotFound, Assembly locationHint, StackCrawlMark&
stackMark)\r
at System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef,
Boolean stringized, Evidence assemblySecurity, StackCrawlMark&
stackMark)\r
at System.Reflection.Assembly.InternalLoad(String assemblyString,
Evidence assemblySecurity, StackCrawlMark& stackMark)\r
at System.Activator.CreateInstance(String assemblyName, String
typeName,
Boolean ignoreCase, BindingFlags bindingAttr, Binder binder, Object[]
args,
CultureInfo culture, Object[] activationAttributes, Evidence
securityInfo,
StackCrawlMark& stackMark)\r
at System.Activator.CreateInstance(String assemblyName, String
typeName)\r
at System.AppDomain.CreateInstance(String assemblyName, String
typeName)\r
at System.AppDomain.CreateInstanceAndUnwrap(String assemblyName,
String
typeName)\r
at
System.Runtime.Remoting.Messaging.StackBuilderSink.PrivateProcessMessage(MethodBase
mb, Object[] args, Object server, Int32 methodPtr, Boolean
fExecuteInContext,
Object[]& outArgs)\r
at
System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage
msg, Int32 methodPtr, Boolean fExecuteInContext)

Exception rethrown at [0]:
"

I have set permissions for the user everyone on the cache directory.
The source code I am using is:


appDomain.SetShadowCopyPath(appDomain.BaseDirectory);
appDomain.SetShadowCopyFiles(); //if i skip this, the following works
well

MyClass myClass = (MyClass)
appDomain.CreateInstanceAndUnwrap(assemblyDisplayName,myClassDisplayName);

Thanks a lot.
Pablo.
 
G

Guest

Dear David,
I am trying fusloggvw but no information is reported. Additionally, I have
set the registry key 'ForceLog', but nohting is displayed.

Do you have another idea ??

Thanks again.
Pablo.

David Levine said:
Is the actual name of the assembly
MyCompany.Solutions.MyProduct.MyAssemblyName.DLL? Or are you including the
namespace as part of the assembly name? If so, don't do that. Also, make
sure that the assembly is in a directory that is located by the normal
probing that the fusion layer uses. You should also look at fuslogvw.exe and
see if it is able to locate the assembly and if not, why not.

Pablo said:
Dear David,
Thanks for your interest. They are like this:
assemblyname: MyCompany.Solutions.MyProduct.MyAssemblyName
typename: MyCompany.Solutions.MyProduct.MyAssemblyName.MyTypeName

As you can see I'm passing just the name with its full namespace to the
CreateInstanceAndUnwrap method. Besides, it works well if I do not use
caching, so I think this values are right.

What do u think it is happening ? thanks again.
Pablo


David Levine said:
What are the values of the assemblyDisplayName and myClassDisplayName
arguments you are passing to CreateInstanceAndUnwrap?

Hi,
I'm creating an AppDomain and creating an instance of a class. This
works
fine unless I use caching, which I need to use.
The exception that I get is of type "System.IO.FileLoadException" which
message is:

{"The given assembly name or codebase, 'MyAssemblyDisplayName', was
invalid." }

The stack trace is:

"
Server stack trace:
at System.Reflection.Assembly.nLoad(AssemblyName fileName, String
codeBase, Boolean isStringized, Evidence assemblySecurity, Boolean
throwOnFileNotFound, Assembly locationHint, StackCrawlMark&
stackMark)\r
at System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef,
Boolean stringized, Evidence assemblySecurity, StackCrawlMark&
stackMark)\r
at System.Reflection.Assembly.InternalLoad(String assemblyString,
Evidence assemblySecurity, StackCrawlMark& stackMark)\r
at System.Activator.CreateInstance(String assemblyName, String
typeName,
Boolean ignoreCase, BindingFlags bindingAttr, Binder binder, Object[]
args,
CultureInfo culture, Object[] activationAttributes, Evidence
securityInfo,
StackCrawlMark& stackMark)\r
at System.Activator.CreateInstance(String assemblyName, String
typeName)\r
at System.AppDomain.CreateInstance(String assemblyName, String
typeName)\r
at System.AppDomain.CreateInstanceAndUnwrap(String assemblyName,
String
typeName)\r
at
System.Runtime.Remoting.Messaging.StackBuilderSink.PrivateProcessMessage(MethodBase
mb, Object[] args, Object server, Int32 methodPtr, Boolean
fExecuteInContext,
Object[]& outArgs)\r
at
System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage
msg, Int32 methodPtr, Boolean fExecuteInContext)

Exception rethrown at [0]:
"

I have set permissions for the user everyone on the cache directory.
The source code I am using is:


appDomain.SetShadowCopyPath(appDomain.BaseDirectory);
appDomain.SetShadowCopyFiles(); //if i skip this, the following works
well

MyClass myClass = (MyClass)
appDomain.CreateInstanceAndUnwrap(assemblyDisplayName,myClassDisplayName);

Thanks a lot.
Pablo.
 
D

David Levine

Try specifying the complete assembly name, which is "AssemblyName,
Version=xxx, Culture=xxx, PublicKeyToken=xxx"

Pablo said:
Dear David,
I am trying fusloggvw but no information is reported. Additionally, I have
set the registry key 'ForceLog', but nohting is displayed.

Do you have another idea ??

Thanks again.
Pablo.

David Levine said:
Is the actual name of the assembly
MyCompany.Solutions.MyProduct.MyAssemblyName.DLL? Or are you including
the
namespace as part of the assembly name? If so, don't do that. Also, make
sure that the assembly is in a directory that is located by the normal
probing that the fusion layer uses. You should also look at fuslogvw.exe
and
see if it is able to locate the assembly and if not, why not.

Pablo said:
Dear David,
Thanks for your interest. They are like this:
assemblyname: MyCompany.Solutions.MyProduct.MyAssemblyName
typename: MyCompany.Solutions.MyProduct.MyAssemblyName.MyTypeName

As you can see I'm passing just the name with its full namespace to the
CreateInstanceAndUnwrap method. Besides, it works well if I do not use
caching, so I think this values are right.

What do u think it is happening ? thanks again.
Pablo


:

What are the values of the assemblyDisplayName and myClassDisplayName
arguments you are passing to CreateInstanceAndUnwrap?

Hi,
I'm creating an AppDomain and creating an instance of a class. This
works
fine unless I use caching, which I need to use.
The exception that I get is of type "System.IO.FileLoadException"
which
message is:

{"The given assembly name or codebase, 'MyAssemblyDisplayName', was
invalid." }

The stack trace is:

"
Server stack trace:
at System.Reflection.Assembly.nLoad(AssemblyName fileName, String
codeBase, Boolean isStringized, Evidence assemblySecurity, Boolean
throwOnFileNotFound, Assembly locationHint, StackCrawlMark&
stackMark)\r
at System.Reflection.Assembly.InternalLoad(AssemblyName
assemblyRef,
Boolean stringized, Evidence assemblySecurity, StackCrawlMark&
stackMark)\r
at System.Reflection.Assembly.InternalLoad(String assemblyString,
Evidence assemblySecurity, StackCrawlMark& stackMark)\r
at System.Activator.CreateInstance(String assemblyName, String
typeName,
Boolean ignoreCase, BindingFlags bindingAttr, Binder binder,
Object[]
args,
CultureInfo culture, Object[] activationAttributes, Evidence
securityInfo,
StackCrawlMark& stackMark)\r
at System.Activator.CreateInstance(String assemblyName, String
typeName)\r
at System.AppDomain.CreateInstance(String assemblyName, String
typeName)\r
at System.AppDomain.CreateInstanceAndUnwrap(String assemblyName,
String
typeName)\r
at
System.Runtime.Remoting.Messaging.StackBuilderSink.PrivateProcessMessage(MethodBase
mb, Object[] args, Object server, Int32 methodPtr, Boolean
fExecuteInContext,
Object[]& outArgs)\r
at
System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage
msg, Int32 methodPtr, Boolean fExecuteInContext)

Exception rethrown at [0]:
"

I have set permissions for the user everyone on the cache directory.
The source code I am using is:


appDomain.SetShadowCopyPath(appDomain.BaseDirectory);
appDomain.SetShadowCopyFiles(); //if i skip this, the following
works
well

MyClass myClass = (MyClass)
appDomain.CreateInstanceAndUnwrap(assemblyDisplayName,myClassDisplayName);

Thanks a lot.
Pablo.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top