Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
DB Engine
SQL ServerMSDESQL Server CE
Services
Analysis (Data Mining)Analysis (OLAP)DTSIntegration ServicesNotification ServicesReporting Services
Programming
CLRConnectivitySQLXML
Other Technologies
ClusteringEnglish QueryFull-Text SearchReplicationService Broker
General
Data WarehousingPerformanceSecuritySetupSQL Server ToolsOther SQL Server Topics
DirectoryUser Groups
Related Topics
MS AccessOther DB ProductsMS Server Products.NET DevelopmentVB DevelopmentJava DevelopmentMore Topics ...

SQL Server Forum / General / Security / January 2008

Tip: Looking for answers? Try searching our database.

SQL CLR permissions needed after deployment to target server (not

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
theartiststillknownasgarvin - 26 Jan 2008 19:22 GMT
I am working on my first CLR project, having progressed to the point where I
have a working version in VS2008.

Project is set to "external", and the assembly is signed with a PFX file.

On both servers, I am running in the role of sysadmin, and would like my
permissions to apply in the execution environment. I am aware that with CLR,
it is the code that needs permission, rather than user-based.

The app does NOT run on the target server (below) and I need to find out how
to do something as simple (extravagant?) as apply "full trust" to the app.

What is my next step?
......................................
System.Security.SecurityException: Request for the permission of type
'System.Data.SqlClient.SqlClientPermission, System.Data, Version=2.0.0.0,
Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.
System.Security.SecurityException:
Charles Wang[MSFT] - 28 Jan 2008 06:32 GMT
Hi,

Thank you for posting here!

I notice that you have posted the same question in our
microsoft.public.sqlserver. programming newsgroup, which I have already
responded. So please check my answer there and if you need any further
assistance on this particular issue, please reply to me in that thread so I
can follow up with you in time.

For your convenience, I have included my reply as follows:

------------------
I understand that you encounter the permission issue when you run your CLR
assemblies on your server side.
If I have misunderstood, please let me know.

It seemed that EXTERNAL_ACCESS was not granted to your assembly. I
recommend that you try setting your database to trustworthy and then
elevate the PERMISSION_SET of your assembly to EXTERNAL_ACCESS, such as:
ALTER DATABASE YourDatabaseName SET TRUSTWORTHY ON
Go
ALTER ASSEMBLY YourAssemblyName WITH PERMISSION_SET = EXTERNAL_ACCESS
Go

Also I would like to let you know that the current assembly
System.Data.SqlClient is not a supported assembly for SQL Server. Please
carefully test it to see if there is any issue after you deploy it. You may
refer to this KB article:
Support policy for untested .NET Framework assemblies in the SQL Server
2005 CLR-hosted environment
http://support.microsoft.com/default.aspx?scid=kb;EN-US;922672

Hope this helps. Please feel free to let me know if you have any other
questions or concerns.
------------------

Thank you and have a nice day!

Best regards,
Charles Wang
Microsoft Online Community Support

======================================================
When responding to posts, please "Reply to Group" via
your newsreader so that others may learn and benefit
from this issue.
======================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
======================================================
theartiststillknownasgarvin - 28 Jan 2008 14:22 GMT
Thanks.

Not really sure which group this type of question should be posted in, since
it covers both programming and security.

> Hi,
>
[quoted text clipped - 46 lines]
> This posting is provided "AS IS" with no warranties, and confers no rights.
> ======================================================
 
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



©2009 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.