473,395 Members | 1,629 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Security Policy

Hello.

I have written a little program that uses some unmanaged code -
[DllImport("....dll")].
I´ve send this program to a friend of mine and now he gets a security error.

Two questions about that:

1)
How can I test my application for security errors?
Because I can´t reproduce this error it is very hard to get rid of it...

2)
What do I have to do to get the code running?
I think I remember something like creating a strong name key and enter that
key in the assembly file.
Unfortunately I don´t remember much more...

Any help, links or tips?
Thanks a lot in advance!

Greetings,
Tim.
Nov 16 '05 #1
7 1699


"Tim Bücker" <ti*************@web.de> wrote in message
news:c7***********@news.uni-koblenz.de...
Hello.

I have written a little program that uses some unmanaged code -
[DllImport("....dll")].
I´ve send this program to a friend of mine and now he gets a security
error.


Could you post the exact exception message?

Willy.
Nov 16 '05 #2
"Willy Denoyette [MVP]" <wi*************@pandora.be> schrieb im Newsbeitrag
news:uL*************@TK2MSFTNGP11.phx.gbl...

"Tim Bücker" wrote

I have written a little program that uses some unmanaged code -
[DllImport("....dll")].
I´ve send this program to a friend of mine and now he gets a security
error.


Could you post the exact exception message?


Sorry, no. I´ve no contact with my friend at the moment. That was the reason
for my first questin - how can I test a security based problem?
But I think that it has to do something with this unmanaged code and shared
assemblies...

Thanks for answering!
Greetings, Tim.
Nov 16 '05 #3
Hard to tell without knowing the exact security error message, one
possibility is that your friend loads this from a network share, but it
could also relate to the unmanaged code that requires security privileges
not held by the user running the code.

Willy.

"Tim Bücker" <ti*************@web.de> wrote in message
news:c7***********@news.uni-koblenz.de...
"Willy Denoyette [MVP]" <wi*************@pandora.be> schrieb im
Newsbeitrag
news:uL*************@TK2MSFTNGP11.phx.gbl...

"Tim Bücker" wrote
>
> I have written a little program that uses some unmanaged code -
> [DllImport("....dll")].
> I´ve send this program to a friend of mine and now he gets a security
> error.


Could you post the exact exception message?


Sorry, no. I´ve no contact with my friend at the moment. That was the
reason
for my first questin - how can I test a security based problem?
But I think that it has to do something with this unmanaged code and
shared
assemblies...

Thanks for answering!
Greetings, Tim.

Nov 16 '05 #4
"Willy Denoyette [MVP]" <wi*************@pandora.be> schrieb im Newsbeitrag
news:OU**************@TK2MSFTNGP10.phx.gbl...
Hard to tell without knowing the exact security error message, one
possibility is that your friend loads this from a network share


Loading the program from a network share I get a
"System.Security.Permissions.FileIOPermission, mscorlib, ..." exception
opening a OpenFileDialog.
So how is it done to allow the program being executed from a network share?

Thanks a lot!
Tim.
Nov 16 '05 #5

"Tim Bücker" <ti*************@web.de> wrote in message
news:c7**********@news.uni-koblenz.de...
"Willy Denoyette [MVP]" <wi*************@pandora.be> schrieb im
Newsbeitrag
news:OU**************@TK2MSFTNGP10.phx.gbl...
Hard to tell without knowing the exact security error message, one
possibility is that your friend loads this from a network share


Loading the program from a network share I get a
"System.Security.Permissions.FileIOPermission, mscorlib, ..." exception
opening a OpenFileDialog.
So how is it done to allow the program being executed from a network
share?

Thanks a lot!
Tim.

I see this is a Code Access Permission error, code loaded from a network
share (local intranet zone) has no FileIOPermission.
The Framework provides the .NET Framework Configuration Management Console
(Mscorcfg.msc) or a command line batch utility Caspol.exe to alter the
currently defined security policy.
For example, using Caspol.exe the following command enables FullTrust
permissions to the share (Full access to all resources):

caspol -machine -addgroup 1. -url \\server\share\* Fulltrust

You should take a look at
http://msdn.microsoft.com/library/de...ycaspolexe.asp
for details about Code access security in .NET.

Willy.
Nov 16 '05 #6

"Willy Denoyette [MVP]" <wi*************@pandora.be> schrieb im Newsbeitrag
news:Oe******************@TK2MSFTNGP09.phx.gbl...
I see this is a Code Access Permission error, code loaded from a network
share (local intranet zone) has no FileIOPermission.
The Framework provides the .NET Framework Configuration Management Console
(Mscorcfg.msc) or a command line batch utility Caspol.exe to alter the
currently defined security policy.
For example, using Caspol.exe the following command enables FullTrust
permissions to the share (Full access to all resources):

caspol -machine -addgroup 1. -url \\server\share\* Fulltrust

You should take a look at

http://msdn.microsoft.com/library/de...ycaspolexe.asp for details about Code access security in .NET.


Thanks! I think that´s it!
And this security policy has to be altered on every computer I want to run
the software, right?

Thanks a lot for your help!
Greetings,
Tim.
Nov 16 '05 #7
Thanks! I think that´s it!
And this security policy has to be altered on every computer I want to run
the software, right?

That's right, on every computer loading assemblies from the intranet (file
shares).

Willy.


Nov 16 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Lorenzo | last post by:
hi you all, first of all apologies for having cross-posted this message but really i did not know where to post it. please let me know what ng you consider the most suitable for the described...
0
by: Namratha Shah \(Nasha\) | last post by:
Hey Guys, Today we are going to look at Code Access Security. Code access security is a feature of .NET that manages code depending on its trust level. If the CLS trusts the code enough to...
16
by: Marina | last post by:
Hi, I am trying to find the minimum security settings to allow a windows control embedded in IE have full trust. If I give the entire Intranet zone full trust, this works. However, this is...
0
by: Namratha Shah \(Nasha\) | last post by:
Hey Guys, Today we are going to look at Code Access Security. Code access security is a feature of .NET that manages code depending on its trust level. If the CLS trusts the code enough to...
5
by: Henry Stock | last post by:
I am trying to understand the following error: Any thing you can tell me about this is appreciated. Security Exception Description: The application attempted to perform an operation not allowed...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.