Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / C# / March 2008

Tip: Looking for answers? Try searching our database.

SerialPort.Open() Exception

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Christian Havel - 11 Mar 2008 10:25 GMT
Hi,

I have a problem calling serialPort.Open(). The customer receives a message
like:

Die Anwendung hat einen Vorgang versucht, der von der Sicherheitsrichtlinie
nicht zugelassen ist ...
...verwenden Sie das Microsoft .NET Framework-Konfigurationstool.

Fehler bei der Anforderung des Berechtigungstyps
System.Security.Permissions.SecurityPermission, mscorlib,
Version=2.0.0.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089

I found the .NET Framework configurationstool. What do I have to configure?
Christian
Michael Nemtsev [MVP] - 11 Mar 2008 12:01 GMT
Hello Christian,

see there http://episteme.arstechnica.com/eve/forums/a/tpc/f/6330927813/m/888002201831

---
WBR,
Michael  Nemtsev [.NET/C# MVP] :: blog: http://spaces.live.com/laflour 

"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangelo

CH> System.Security.Permissions.SecurityPermission, mscorlib,
CH> Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
CH>
Christian Havel - 11 Mar 2008 14:10 GMT
Hi Michael,

thanks for your help!

We try it. Well, do not you think that it is necessary to set some options
in the .NET configuration tool?

Christian

> Hello Christian,
>
[quoted text clipped - 10 lines]
> CH> Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
> CH>
Christian Havel - 12 Mar 2008 09:04 GMT
Hi Michael,

the reason was, that the user started the app from a network folder => peng.

Christian

> Hello Christian,
>
[quoted text clipped - 10 lines]
> CH> Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
> CH>
Chris Dunaway - 12 Mar 2008 19:38 GMT
On Mar 12, 3:04 am, Christian Havel
<ChristianHa...@discussions.microsoft.com> wrote:
> Hi Michael,
>
[quoted text clipped - 16 lines]
> > CH> Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
> > CH>

Please be careful with using the SerialPort under VS2008.  It appears
to be very buggy and could result in a locked up serial port which
can't be unlocked.

See this:

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=2635314&SiteID=1

Chris
Ben Voigt [C++ MVP] - 11 Mar 2008 14:53 GMT
> Hi,
>
[quoted text clipped - 12 lines]
> I found the .NET Framework configurationstool. What do I have to
> configure? Christian

Looks like the application was started from a network drive.  You can either
enable full trust for that network location, or copy the executables
locally.
Christian Havel - 11 Mar 2008 15:56 GMT
Hi Ben,

thanks for your help. I got a screenshot and have following informations:

(Translated from german):
"The type from the first permission on which a error occurs:
System.Security.Permission.SecurityPermission
The zone of the assembly on which a error occured: Intranet"

Any more idea?
Christian

> > Hi,
> >
[quoted text clipped - 16 lines]
> enable full trust for that network location, or copy the executables
> locally.
Ben Voigt [C++ MVP] - 11 Mar 2008 16:39 GMT
> Hi Ben,
>
[quoted text clipped - 5 lines]
> System.Security.Permission.SecurityPermission
> The zone of the assembly on which a error occured: Intranet"

"Intranet" instead of "Local Computer" appearing here confirms my guess.
.NET security prevents applications running over the network from accessing
local hardware, like the serial port.  The easiest thing to do is install
the application locally.

> Any more idea?
> Christian
[quoted text clipped - 19 lines]
>> can either enable full trust for that network location, or copy the
>> executables locally.
Christian Havel - 11 Mar 2008 17:02 GMT
Hi Ben,

thanks for your help again. I wait on the users feedback.
Christian

> > Hi Ben,
> >
[quoted text clipped - 34 lines]
> >> can either enable full trust for that network location, or copy the
> >> executables locally.
Christian Havel - 12 Mar 2008 09:03 GMT
Hi Ben,

your are fantastic :-)

The user really tried to start the app from a network folder.

Now it works.
Thanks a lot.
Christian

> > Hi Ben,
> >
[quoted text clipped - 34 lines]
> >> can either enable full trust for that network location, or copy the
> >> executables locally.

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.