Go to "Control Panel -> Administrative Tools -> Microsoft .NET
Framework
1.1
[1.0] Configuration" to configure security settings. The simplest way
is
to
give "Local Intranet" zone full trust by highlighting "My
Computer->Runtime
Security Policy" node on the left and clicking "Adjust Zone Security" link
on the right side. Warning: this adjustment is a bit risky and not
recommended unless you have very small network and you have controls on
the
security of the network. Better approach is to create a code group and
give
required security settings to that code group. You need to explore more on
this topic once you get your app running.
Hi Norman,
Yes, my dll file is using by a window form application (1 form with 1
button
to test my createproject function)
I think the security setting is the problem because before using the
function On Error Resume Next, I had a security error message from the
mscorlib.dll.
So how can I autorize my application to run from a network drive ? How
can
I
change the security of the mscorlib.dll ?
Please help me...
Julien.
"Norman Yuan" <
[email protected]> a écrit dans le message de (e-mail address removed)...
Assume you are talking Windows Form App, and you have done necessary
security setting changes that allows your Windows app can be loaded
from
a
network share (by default, .NET windows app is not allowed to run from
a
network share).
From what I see, at least you did not handle possible exception at
MSPapp = New MSProject.Application
That means, if this line od code cannot create "MSPrioject.Application"
object, the routine will go on (since On Error Resume Next
instruction),
and
you will get Nothing for MSProject. So, the code just did what you
expect
it
doing correctly. As for why MSPapp = New MSProject.Application not
working,
I do not know (bad reference, maybe?).
However, since you mentioned it works from local drive, not from
network
drive, I suspect that the function you though causing problem may
not
be
the
source of problem, it is the security thing + a general "On Error
Resume
Next" on the higher level causes problem and the code in the
function
did
not get run at all. By the way, why on the earth do you use "On
Error
Resume
Next", instead of more powerful "Try...Catch..."?
Hello,
I have a dotnet dll file.
This dll is to use MS Project by VB.
When I am launching my application from a local drive (c:\mylocapp) :
no
problem
The Problem is when I am trying to launch my application from a
network
drive : my "W:" is "\\Server\Testappli"
I am using this code :
public function CreateProject(byval pstr_ProjName as string) as string
On Error Resume Next
Err.Clear()
MSPapp = GetObject(, "MSProject.Application")
If Err.Number <> 0 Then
Err.Clear()
MSPapp = New MSProject.Application
End If
If IsNothing(MSPapp) Then
CreateProject = "FALSE¤CREATION"
End If
...etc
end function
if I use the debugger, MSPapp is nothing... I can not understand
the
problem...
Please help me...
Thank you.
JULIEN.