Re: Faillure to run .NET 2.0 app from UNC



I usually do this (to give permission to run .NET code from a network share
on our LAN) by using .NET Framework Configuration console in "Control
Panel->Administrative Tools" and it always workd. Can you try that, instead
of CASPOL.exe at command line? (Although the result should be the same, if
you do it correctly.) Just give it a try to prove you did it correctly with
caspol.exe command line.

If you have not done that in .NET framework configuration console, following
these steps:

1. Open "Control Panel->Administrative Tools->.NET Framework 2.0
Configuration";
2. Select node "Console Root->.Net Framework 2.0 Configuration->My
Computer->Runtime Security Policy->Machine->Code Groups->All_Code" and
right-click, select "New...";
3. Select "Create a new code group" radio button and enter code group name
of your choice; click "Next";
4. In dropdown list, choose "URL" and enter URL (such as
file://theserver/theshare/myCodeFolder/*); click "Next";
5. Select a existing permission set, such as "FullTrust"; click "Next" and
then "Finish".

Now test your app. It should work (It work on a few of my Win form apps,
including .NET1.1 and 2.0 apps)


"Adri" <a3@xxxxxxxxxxxxxxxx> wrote in message
news:980E7660-3FE8-4BD2-83C7-23465F9C3845@xxxxxxxxxxxxxxxx
Hi Norman,

The user (myself) has full access (on OS level) to the UNC share.

The CASPOL call is:
caspol -q -m -ag 1.2. -url file://SERVER/Share/* FullTrust

--
Adri
Programmers do it Bit by Bit


"Norman Yuan" wrote:

It is obviously the security/permission issue. In order to run .NET code
from a network share, you need to

1. Give user necessary file access permission, read and execute, whether
it
is .NET file or not;
2. Allow .NET code from outside computer to run with CASPOL tool.

Are you sure you have done both correctly? I do not see there is other
reasons.


"Adri" <a3@xxxxxxxxxxxxxxxx> wrote in message
news:B66FF897-A249-46CC-9092-ADAA9E990C58@xxxxxxxxxxxxxxxx
I've built an localised .NET 2.0 application, which runs fine on my
development machine. But when I deploy the app, it fails to run from an
UNC
path. I've already used CASPOL to add FullTrust to the UNC.

The error that occurs us the following:
System.InvalidOperationException was unhandled
Message="An error occurred creating the form. See
Exception.InnerException
for details. The error is: Request for the permission of type
'System.Security.Permissions.SecurityPermission, mscorlib,
Version=2.0.0.0,
Culture=neutral, PublicKeyToken=b77a5c561934e089' failed."
Source="TMD"
StackTrace:
at TMD.My.MyProject.MyForms.Create__Instance__[T](T Instance)
at TMD.My.MyApplication.OnCreateSplashScreen()
at
Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.ShowSplashScreen()
at
Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnInitialize(ReadOnlyCollection`1
commandLineArgs)
at
Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel()
at
Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[]
commandLine)
at TMD.My.MyApplication.Main(String[] Args)

It seems to happen when the app tries to show the SplashScreen

--
Adri
Programmers do it Bit by Bit





.