V
venner
Hi group,
I am currently developing two websites that will work together, but for
several reasons are seperated into two projects. I am developing in
ASP.NET 2.0 using VS2005. In my solution I have 3 projects: the two
web sites and a class library that contains some code shared by both
websites.
I have noticed that if I try to use certain libraries (notably
System.Net.Mail and System.Data.SqlClient) I get a Security Exception.
The text of the exeption for System.Net.Mail follows:
System.Security.SecurityException: Request for the permission of type
'System.Net.Mail.SmtpPermission, System, Version=2.0.0.0,
Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.
I have played around with Attributes trying to get the CLR to grant the
assembly the required permissions I added the following line to the
class where I have the call to the SmtpClient object, but to no avail:
[assembly:
SmtpPermission(System.Security.Permissions.SecurityAction.RequestOptional,
Unrestricted=true)]
Does anybody know how I can make use of System.Net.Mail from a class
library?
Thanks,
Eric
I am currently developing two websites that will work together, but for
several reasons are seperated into two projects. I am developing in
ASP.NET 2.0 using VS2005. In my solution I have 3 projects: the two
web sites and a class library that contains some code shared by both
websites.
I have noticed that if I try to use certain libraries (notably
System.Net.Mail and System.Data.SqlClient) I get a Security Exception.
The text of the exeption for System.Net.Mail follows:
System.Security.SecurityException: Request for the permission of type
'System.Net.Mail.SmtpPermission, System, Version=2.0.0.0,
Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.
I have played around with Attributes trying to get the CLR to grant the
assembly the required permissions I added the following line to the
class where I have the call to the SmtpClient object, but to no avail:
[assembly:
SmtpPermission(System.Security.Permissions.SecurityAction.RequestOptional,
Unrestricted=true)]
Does anybody know how I can make use of System.Net.Mail from a class
library?
Thanks,
Eric