Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > C# and C > C# 1.0 > BOOK: Professional C#, 2nd and 3rd Editions
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: Professional C#, 2nd and 3rd Editions
This is the forum to discuss the Wrox book Professional C#, 3rd Edition by Simon Robinson, Christian Nagel, Karli Watson, Jay Glynn, Morgan Skinner, Bill Evjen; ISBN: 9780764557590
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional C#, 2nd and 3rd Editions section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old August 18th, 2003, 12:12 PM
Registered User
 
Join Date: Aug 2003
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default System.Security.SecurityException

In your remoting section there is a callback example which explains how to have two way remote conversations with delegates. In .Net 1.0 it runs fine. In 1.1 it produces the following error: An unhandled exception of type 'System.Security.SecurityException' occurred in mscorlib.dll

Additional information: Type System.DelegateSerializationHolder and the types derived from it (such as System.DelegateSerializationHolder) are not permitted to be deserialized at this security level.

I understand that 1.1 has changed the way security is handled with remoting, but I haven't been able to get your example to run by adding TypeFilterLevels. Is there a way you can show me how to get your example to run under version 1.1?

Thanks,
Darren Pastore
  #2 (permalink)  
Old October 9th, 2003, 05:48 AM
Registered User
 
Join Date: Oct 2003
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
quote:Originally posted by pastoda
 In your remoting section there is a callback example which explains how to have two way remote conversations with delegates. In .Net 1.0 it runs fine. In 1.1 it produces the following error: An unhandled exception of type 'System.Security.SecurityException' occurred in mscorlib.dll
Hello, I am get this trouble too. And I found answer on this question in discussion
http://www.thinkdotnet.com/default.a...ic&TopicID=149
This is more complete guide, but a simle instructions include in message of James Wu :
"Starting with .NET Framework v1.1, the remoting infrastructure doesn't automatically deserialize certain types on the server. You must set the server's deserialization level to Full to support automatic deserialization of all types that remoting supports in all situations.

For delegate callbacks working properly, the client's type information or metadata must be present on the server during run-time. Here I just copy the client assembly to the server root directory for convenience. A better solution for that would be creating an EventShim as described in Mike Woodring's sample page(http://staff.develop.com/woodring/dotnet/#RemoteEvents).

Here is the procedure:

Step 1 - Update the channel element in JobClient\JobClient.exe.config to:

channel ref="http" port="0"
serverProviders
formatter ref="binary" typeFilterLevel="Full" /
/serverProviders
clientProviders
formatter ref="binary" /
/clientProviders
/channel

Step 2 - Update the channel element in JobServer\JobServer.exe.config to:

channel ref="http" port="4000"
serverProviders
formatter ref="binary" typeFilterLevel="Full" /
/serverProviders
clientProviders
formatter ref="binary" /
/clientProviders
/channel

Step 3 - Copy JobClient\bin\Debug\JobClient.exe to JobServer\bin\Debug\ "

I am run this f$%@g example from Chapter 3 after changin configuration files and "Step 3". I am ready send my config files for you, if need.

Thank you for attention.

Best regards,

cyber soft

  #3 (permalink)  
Old December 16th, 2003, 06:59 AM
Registered User
 
Join Date: Dec 2003
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to calsoft
Default

System.Security.SecurityException: Request for the permission of type System.Security.Permissions.SecurityPermission, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 failed.
   at System.Security.CodeAccessSecurityEngine.CheckToke nBasedSetHelper(Boolean ignoreGrants, TokenBasedSet grants, TokenBasedSet denied, TokenBasedSet demands)
   at System.Security.CodeAccessSecurityEngine.CheckSetH elper(PermissionSet grants, PermissionSet denied, PermissionSet demands)
   at System.Runtime.Remoting.RemotingConfiguration.Conf igure(String filename)


Suga
  #4 (permalink)  
Old March 10th, 2004, 10:53 PM
Registered User
 
Join Date: Mar 2004
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

example configs.

client:
<?xml version="1.0"?>
<configuration>
    <system.runtime.remoting>
        <application>
            <channels>
                <channel ref="tcp" port="0">
                    <clientProviders>
                        <formatter ref="binary"/>
                    </clientProviders>
                    <serverProviders>
                        <formatter ref="binary" typeFilterLevel="Full"/>
                    </serverProviders>
                </channel>
            </channels>

            <client>
                <wellknown
                    type="ClientClassLibrary.PA145, ClientClassLibrary"
                    url="tcp://localhost:9999/Server/Types"
                />
            </client>
        </application>
    </system.runtime.remoting>
</configuration>


server:


<?xml version="1.0"?>
<configuration>
    <system.runtime.remoting>
        <application name="Server">
            <channels>
                <channel ref="tcp" port="9999">
                    <clientProviders>
                        <formatter ref="binary"/>
                    </clientProviders>
                    <serverProviders>
                        <formatter ref="binary" typeFilterLevel="Full"/>
                    </serverProviders>
                </channel>
            </channels>
            <service>
                <wellknown
                    type="ClientClassLibrary.PA145, ClientClassLibrary"
                    mode="Singleton"
                    objectUri="Types"
                />
            </service>
        </application>
    </system.runtime.remoting>
</configuration>


  #5 (permalink)  
Old October 8th, 2004, 01:49 PM
Registered User
 
Join Date: Oct 2004
Location: Anchorage, AK, USA.
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to jshae
Default

I am trying to learn how to use Shell functionality to launch an application or open a file. I keep getting this:
 System.Security.SecurityException: Request for the permission of type System.Security.Permissions.SecurityPermission, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 failed.
   at System.Security.CodeAccessSecurityEngine.CheckToke nBasedSetHelper(Boolean ignoreGrants, TokenBasedSet grants, TokenBasedSet denied, TokenBasedSet demands)
   at System.Security.CodeAccessSecurityEngine.CheckSetH elper(PermissionSet grants, PermissionSet denied, PermissionSet demands)
   at System.Runtime.Remoting.RemotingConfiguration.Conf igure(String filename)

I've checked around for solutions, one of which is to download service pack 1.1 - already have it.

Any ideas?
Jesica
  #6 (permalink)  
Old November 11th, 2004, 08:15 PM
Registered User
 
Join Date: Nov 2004
Location: , , .
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

there is a very easy way to fix this problem
go to control panels
then go to admin tools
click on Microsoft .Net framework 1.1 wizard
then click on trust an accembley
then click next till u get to the browes part
find the .exe file
click on that and then next
then change the trust to full
then finish
this will allow you to use this on a network drive

hope it fixes the problem

  #7 (permalink)  
Old May 10th, 2005, 12:04 PM
Registered User
 
Join Date: May 2005
Location: , , .
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I wrote a SQL Server powered application and it worked fine on my machine.
I tried to run it on a team members machine and I got the:

System.Security.SecurityException: Request for the permission of type System.Security.Permissions.SecurityPermission, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 failed.
   at System.Security.CodeAccessSecurityEngine.CheckToke nBasedSetHelper(Boolean ignoreGrants, TokenBasedSet grants, TokenBasedSet denied, TokenBasedSet demands)
   at System.Security.CodeAccessSecurityEngine.CheckSetH elper(PermissionSet grants, PermissionSet denied, PermissionSet demands)
   at System.Runtime.Remoting.RemotingConfiguration.Conf igure(String filename)

The app runs but none of the sql server functionality is there.
Do I just follow step 1 (above).

a bit confused.

Pete.
  #8 (permalink)  
Old July 31st, 2005, 08:49 AM
Registered User
 
Join Date: May 2005
Location: , , .
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Re: problem.

I just set up a new code group child and gave it permissions for total world domination and it works now!
I also found running a .Net .msi for your app is a good thing.
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Getting System.Security.SecurityException Sunnys ASP.NET 2.0 Professional 0 March 14th, 2007 04:13 AM
System.Security.SecurityException: Security error coolcatjk Pro VB.NET 2002/2003 4 March 2nd, 2006 06:00 PM
System.Security.SecurityException davepruce ADO.NET 1 May 10th, 2005 11:20 AM
'System.Security.SecurityException' Jesus VB.NET 2002/2003 Basics 0 November 4th, 2004 02:20 AM
'System.Security.SecurityException' mrinal ADO.NET 3 August 11th, 2004 07:16 AM



All times are GMT -4. The time now is 07:02 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.