Could not start application from Network,...

K

Kerem Gümrükcü

Dear NG,


i have some code/assembly here that must be executable from a network share.
But it only works if i run it as a Administrator or another privileged user.
But it
does not execute and silently fails when i try to run it as a standard user.
I tried
this to make the assembly work with normal users, but it did not work:

Caspol.exe -m -cg LocalIntranet_Zone FullTrust

The application should be executable that way:
\\servername\share$\program.exe

When i try to run it with non-priv standard user the application
fails silently and i get nothing else that makes any sense.

The Codebase where the exception araises (debugged):

using System;

namespace AppInit
{
static class Program
{
[STAThread]
static void Main(string[] args)
{
AppDomainSetup ads = new AppDomainSetup();
string appDir = AppDomain.CurrentDomain.BaseDirectory;
//System.Environment.CurrentDirectory;

ads.ShadowCopyFiles = "true";
ads.ApplicationBase = appDir;
ads.PrivateBinPath = appDir + "\\bin;";
ads.ShadowCopyDirectories = ads.PrivateBinPath + ";" +
ads.ApplicationBase;
//EXCEPTION HERE!!!!
AppDomain domain = AppDomain.CreateDomain("TEK WorkSpace", null,
ads); // Exception is thrown here

}
}
}
}

Some ideas,...?
Code must be executable over the network!
Code must be executable with a non-privilegded standard user!

Thanks for any help and ideas!

Beste Grüsse / Best regards / Votre bien devoue

Kerem Gümrükcü
 
N

Nicholas Paldino [.NET/C# MVP]

Kerem,

Well, there are two things going on here. There is CAS, which would
restrict what your app can do since it is run from the network. This seems
to be recitfied by calling caspol and telling it to give assemblies from the
Local Intranet Zone full trust (although you really should make this
dependent on something based on the assembly, not the whole zone).

The second is whether or not the regular user has rights to write to the
directories specified for the ShadowCopyDirectories property. Does a
standard user have rights to write to this directory?
 
K

Kerem Gümrükcü

Nicholas Paldino said:
Kerem,

Well, there are two things going on here. There is CAS, which would
restrict what your app can do since it is run from the network. This
seems to be recitfied by calling caspol and telling it to give assemblies
from the Local Intranet Zone full trust (although you really should make
this dependent on something based on the assembly, not the whole zone).

The second is whether or not the regular user has rights to write to
the directories specified for the ShadowCopyDirectories property. Does a
standard user have rights to write to this directory?


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Kerem Gümrükcü said:
Dear NG,


i have some code/assembly here that must be executable from a network
share.
But it only works if i run it as a Administrator or another privileged
user. But it
does not execute and silently fails when i try to run it as a standard
user. I tried
this to make the assembly work with normal users, but it did not work:

Caspol.exe -m -cg LocalIntranet_Zone FullTrust

The application should be executable that way:
\\servername\share$\program.exe

When i try to run it with non-priv standard user the application
fails silently and i get nothing else that makes any sense.

The Codebase where the exception araises (debugged):

using System;

namespace AppInit
{
static class Program
{
[STAThread]
static void Main(string[] args)
{
AppDomainSetup ads = new AppDomainSetup();
string appDir = AppDomain.CurrentDomain.BaseDirectory;
//System.Environment.CurrentDirectory;

ads.ShadowCopyFiles = "true";
ads.ApplicationBase = appDir;
ads.PrivateBinPath = appDir + "\\bin;";
ads.ShadowCopyDirectories = ads.PrivateBinPath + ";" +
ads.ApplicationBase;
//EXCEPTION HERE!!!!
AppDomain domain = AppDomain.CreateDomain("TEK WorkSpace",
null,
ads); // Exception is thrown here

}
}
}
}

Some ideas,...?
Code must be executable over the network!
Code must be executable with a non-privilegded standard user!

Thanks for any help and ideas!

Beste Grüsse / Best regards / Votre bien devoue

Kerem Gümrükcü

Hi Nichoals,

i'll forward this to my developer workmate who asked me
the question. Maybe he will continue this thread.
I could not solve the problem for him so i asked
the newsgroup. He already had left the work when
i asked the Newsgroup,...what he should do instead.

Thank you very much for the quick reply!

Beste Grüsse / Best regards / Votre bien devoue

Kerem Gümrükcü
 

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