OT: Activator.CreateInstance failing for some network users

OT: Activator.CreateInstance failing for some network users

Old forum URL: forums.lhotka.net/forums/t/5511.aspx


Jurjen posted on Thursday, October 02, 2008

I'm having a strange problem at one of my clients.

I've writte an Application .NET 3.5 SP1 using Csla 2.1.4 + ActiveObjects 2.0, it runs from a network share, logs to a network share (seperate logfile per pc, using log4net).

Some users on the network can use the application just fine, other users can start the application but can't use it, data cannot be retrieved, the log-files tell me that there is a problem creating the ActiveObjects Dal object, wich is created using CreateInstance, I can't seem to figure out what's wrong here, since it works with some users and it also 'works on my machine :-)' I'd be tempted to say the program is just fine.

Those users who can use the app, can use it on all pc's, those who can't, can't use it on any pc.

Looking in the logfile indicates a problem in the GenericFactory class calling the 'create' method wich creates the object (obviously) and does that using Activator.CreateInstance

does this sound familiar to anyone out here ?

Any help would be greatly appreciated...

Jurjen.

RockfordLhotka replied on Thursday, October 02, 2008

I don't know for sure, but I do know that starting an app from a network share means (by default) that you are starting it in the Intranet Zone, not the Local Zone. By default, the Intranet Zone imposes security restrictions on your code, meaning that many advanced features of .NET won't work - including lots of reflection stuff.

Activator.CreateInstance() is a reflection concept, and not all its options work when your code is in partial trust.

Jurjen replied on Friday, October 03, 2008

Thanks Rocky, I’ll have to look into it again, I guess.

 

Jurjen.

Copyright (c) Marimer LLC