Error 6522 Trying To Run Assembly From Database
Hi,
I am attempting to load an assembly that has been stored in a table as a byte array. I have created a c# class called AssemblyLoader that takes in 2 parameters, the assembly name and the parameters for the assembly (just a query string).
From this it returns the assembly byte array using a simple sql statement within the class using the assembly name to select the assembly bytes to return from the database.
The returned byte array of the assembly is loaded using:
Assembly assembly = Assembly.Load(assemblyBytes);
This seems to be the line that SQL Server 2005 is erroring on. Do I need to add some extra assemblies to the database and if so which ones.
Error:
Msg 6522, Level 16, State 1, Procedure ClientInterface, Line 0
A .NET Framework error occurred during execution of user defined routine or aggregate 'ClientInterface':
System.IO.FileLoadException: LoadFrom(), LoadFile(), Load(byte[]) and LoadModule() have been disabled by the host.
System.IO.FileLoadException:
at System.Reflection.Assembly.nLoadImage(Byte[] rawAssembly, Byte[] rawSymbolStore, Evidence evidence, StackCrawlMark& stackMark, Boolean fIntrospection)
at System.Reflection.Assembly.Load(Byte[] rawAssembly)
at Reflector.runQuery(String query, String parameter)
Thanks for your help.
View Complete Forum Thread with Replies
Sponsored Links:
Related Messages:
Error &&"Msg 6522, Level 16, State 1&&" Receives When Call The Assembly From Store Procedure To Create A Text File And To Write Text
Hi, I want to create a text file and write to text it by calling its assembly from Stored Procedure. Full Detail is given below I write a code in class to create a text file and write text in it. 1) I creat a class in Visual Basic.Net 2005, whose code is given below: Imports System Imports System.IO Imports Microsoft.VisualBasic Imports System.Diagnostics Public Class WLog Public Shared Sub LogToTextFile(ByVal LogName As String, ByVal newMessage As String) Dim w As StreamWriter = File.AppendText(LogName) LogIt(newMessage, w) w.Close() End Sub Public Shared Sub LogIt(ByVal logMessage As String, ByVal wr As StreamWriter) wr.Write(ControlChars.CrLf & "Log Entry:") wr.WriteLine("(0) {1}", DateTime.Now.ToLongTimeString(), DateTime.Now.ToLongDateString()) wr.WriteLine(" :") wr.WriteLine(" :{0}", logMessage) wr.WriteLine("---------------------------") wr.Flush() End Sub Public Shared Sub LotToEventLog(ByVal errorMessage As String) Dim log As System.Diagnostics.EventLog = New System.Diagnostics.EventLog log.Source = "My Application" log.WriteEntry(errorMessage) End Sub End Class 2) Make & register its assembly, in SQL Server 2005. 3)Create Stored Procedure as given below: CREATE PROCEDURE dbo.SP_LogTextFile ( @LogName nvarchar(255), @NewMessage nvarchar(255) ) AS EXTERNAL NAME [asmLog].[WriteLog.WLog].[LogToTextFile] 4) When i execute this stored procedure as Execute SP_LogTextFile 'C:Test.txt','Message1' 5) Then i got the following error Msg 6522, Level 16, State 1, Procedure SP_LogTextFile, Line 0 A .NET Framework error occurred during execution of user defined routine or aggregate 'SP_LogTextFile': System.UnauthorizedAccessException: Access to the path 'C:Test.txt' is denied. System.UnauthorizedAccessException: at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy) at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, ileOptions options) at System.IO.StreamWriter.CreateFile(String path, Boolean append) at System.IO.StreamWriter..ctor(String path, Boolean append, Encoding encoding, Int32 bufferSize) at System.IO.StreamWriter..ctor(String path, Boolean append) at System.IO.File.AppendText(String path) at WriteLog.WLog.LogToTextFile(String LogName, String newMessage)
View Replies !
View Related
ALTER ASSEMBLY Error Msg 6509 An Error Occurred While Gathering Metadata From Assembly ‘&&<Assembly Name&&>’ With HRESULT 0x1.
I work with February CTP of SqlServer 2008. I have an Assembly with several UDTs inside. Version of assembly is 1.0.* I use CREATE ASSEMBLY statement to register this assembly, and it runs without any errors. Then I rebuild CLR solution without doing any changes in source code. In that case the only difference between new and old assemblies is version (difference in fourth part of version). Then I try to update assembly in SqlServer. I use ALTER ASSEMBLY <name> FROM <path> WITH PERMISSION_SET = UNSAFE, UNCHECKED DATA statement for this. Statement runs with error: Msg 6509An error occurred while gathering metadata from assembly €˜<Assembly name>€™ with HRESULT 0x1. I found the list of condition for ALTER ASSEMBLY in MSDN: ALTER ASSEMBLY statement cannot be used to change the following: · The signatures of CLR functions, aggregate functions, stored procedures, and triggers in an instance of SQL Server that reference the assembly. ALTER ASSEMBLY fails when SQL Server cannot rebind .NET Framework database objects in SQL Server with the new version of the assembly. · The signatures of methods in the assembly that are called from other assemblies. · The list of assemblies that depend on the assembly, as referenced in the DependentList property of the assembly. · The indexability of a method, unless there are no indexes or persisted computed columns depending on that method, either directly or indirectly. · The FillRow method name attribute for CLR table-valued functions. · The Accumulate and Terminate method signature for user-defined aggregates. · System assemblies. · Assembly ownership. Use ALTER AUTHORIZATION (Transact-SQL) instead. Additionally, for assemblies that implement user-defined types, ALTER ASSEMBLY can be used for making only the following changes: · Modifying public methods of the user-defined type class, as long as signatures or attributes are not changed. · Adding new public methods. · Modifying private methods in any way. But I haven€™t done any changes in source code, so new version of assembly satisfies all this conditions. What could be the reason for such behavior? P.S. I€™ve got the same error, if I add or change any method in assembly before rebuilding.
View Replies !
View Related
CLR Function Error 6522 Using System.IO Namespace
I created a clr proc that gets the most recent file within a directory based on the creation time property, see code below. I have attempted to replicate this within a clr scalar valued function in order to assign the resulting value to a variable within SQL server. I am getting the error message: Msg 6522, Level 16, State 2, Line 1 A .NET Framework error occurred during execution of user-defined routine or aggregate "clr_fn_recentfile": System.InvalidOperationException: Data access is not allowed in this context. Either the context is a function or method not marked with DataAccessKind.Read or SystemDataAccessKind.Read, is a callback to obtain data from FillRow method of a Table Valued Function, or is a UDT validation method. System.InvalidOperationException: at System.Data.SqlServer.Internal.ClrLevelContext.CheckSqlAccessReturnCode(SqlAccessApiReturnCode eRc) at System.Data.SqlServer.Internal.ClrLevelContext.GetCurrentContext(SmiEventSink sink, Boolean throwIfNotASqlClrThread, Boolean fAllowImpersonation) at Microsoft.SqlServer.Server.InProcLink.GetCurrentContext(SmiEventSink eventSink) at Microsoft.SqlServer.Server.SmiContextFactory.GetCurrentContext() at Microsoft.SqlServer.Server.SqlContext.get_CurrentContext() at Microsoft.SqlServer.Server.SqlContext.get_Pipe() at clr_fn_recentfile.clr_fn_recentfile.clr_fn_recentfile(SqlString Filepath) After trying to troubleshoot this I am aware that this error is rather generic and have not been able to find any specific documenation regardint the use of file system objects with clr functions. I am at a loss. Any help would be appreciated! STORED PROC CODE WORKS Code Snippet Imports System Imports System.Data Imports System.Data.SqlClient Imports System.Data.SqlTypes Imports Microsoft.SqlServer.Server Imports System.IO Partial Public Class clr_recentfile _ Public Shared Sub clr_recentfile(ByVal Filepath As SqlString) Dim strFile As String Dim sp As SqlPipe = SqlContext.Pipe() Dim maxDate As Date Dim fil As String Dim qry As New SqlCommand() Try If Directory.Exists(Filepath.ToString) Then For Each strFile In Directory.GetFiles(Filepath.ToString) Path.GetFileName(strFile) fil = Path.GetFileName(strFile).ToString Dim fi As New FileInfo(strFile) If maxDate = Nothing Then maxDate = fi.CreationTime fil = fi.FullName.ToString Else If maxDate < fi.CreationTime Then maxDate = fi.CreationTime End If End If Next Else sp.Send("Directory does not exist") Return End If If fil <> Nothing Then qry.CommandText = " SELECT '" & fil & "'" 'Execute the query and pass the result set back to SQL sp.ExecuteAndSend(qry) sp.Send(qry.CommandText.ToString) End If Catch ex As Exception sp.Send(ex.Message.ToString) End Try End Sub End Class FUNCTION CODE DOES NOT WORK WITH ABOVE ERROR Code Snippet Imports System Imports System.Data Imports System.Data.SqlClient Imports System.Data.SqlTypes Imports Microsoft.SqlServer.Server Imports System.IO Partial Public Class clr_fn_recentfile <Microsoft.SqlServer.Server.SqlFunction()> _ Public Shared Function clr_fn_recentfile(ByVal Filepath As SqlString) As SqlString Dim strFile As String Dim sp As SqlPipe = SqlContext.Pipe() Dim maxDate As Date Dim fil As String Dim qry As New SqlCommand() Try If Directory.Exists(Filepath.ToString) Then For Each strFile In Directory.GetFiles(Filepath.ToString) Path.GetFileName(strFile) fil = Path.GetFileName(strFile).ToString Dim fi As New FileInfo(strFile) If maxDate = Nothing Then maxDate = fi.CreationTime fil = fi.FullName.ToString Else If maxDate < fi.CreationTime Then maxDate = fi.CreationTime End If End If Next Else sp.Send("Directory does not exist") Exit Function End If If fil <> Nothing Then Return fil End If Catch ex As Exception sp.Send(ex.Message.ToString) End Try End Function End Class
View Replies !
View Related
Error Registering Assembly Using CREATE ASSEMBLY
We have written a test CRL stored procedure to test replacing one of our complex stored procedures but can€™t get it deployed to our SQL server that hosts a mirrored configuration of our production database (very locked down). It works fine on our development instances (not very locked down). It only references the default assemblies that were added when we created the project. All it does is use Context Connection=true to get data, loops though some records and returns the data using SQLContext. CLR is enabled on SQL server, the assembly is strongly signed, and we tried deploy using the binary string with the SAFE setting. CREATE ASSEMBLY for assembly 'SQLCLRTest2' failed because assembly 'SQLCLRTest2' failed verification. Check if the referenced assemblies are up-to-date and trusted (for external_access or unsafe) to execute in the database. CLR Verifier error messages if any will follow this message [ : SQLCLRTest2.StoredProcedures::GetLift][mdToken=0x600001e] Type load failed. [token 0x02000008] Type load failed.
View Replies !
View Related
Error: CREATE ASSEMBLY For Assembly
I am trying to deploy a Database Project with Visual Studio 2005 and SQL Server 2005 Standard. I import €œSystem.IO€? and have therefore set the permission levels to EXTERNAL_ACCESS. I am receiving the same error message that many folks have received. CREATE ASSEMBLY for assembly 'Images' failed because assembly 'Images' is not authorized for PERMISSION_SET = EXTERNAL_ACCESS. The assembly is authorized when either of the following is true: the database owner (DBO) has EXTERNAL ACCESS ASSEMBLY permission and the database has the TRUSTWORTHY database property on; or the assembly is signed with a certificate or an asymmetric key that has a corresponding login with EXTERNAL ACCESS ASSEMBLY permission. If you have restored or attached this database, make sure the database owner is mapped to the correct login on this server. If not, use sp_changedbowner to fix the problem. Images. My CLR access is €œon€? I have tried 1) From master run: GRANT EXTERNAL ACCESS ASSEMBLY to [BuiltinAdministrators]. 2) From master run: GRANT EXTERNAL ACCESS ASSEMBLY to €œMy Windows Authentication ID€?. 3) Run ALTER DATABASE MYDATABASE SET TRUSTWORTHY ON 4) In Visual Studio .NET 2005 Set the permission levels to €˜external€™ 5) Tried BuiltinAdministrators and my SQL Server Windows Authenticated Login ID for the ASSEMBLY OWNER. I can compile BUT NOT DEPLOY Any help would be greatly appreciated. Regards Steve
View Replies !
View Related
Security Assembly Interrogating Database Via MDX Query Returns EnvironmentPermissions Error To Report Manager
Hi, I've got a Security assembly implemented in .net 2.0, which returns the results of an MDX query to a report viewed in Report Manager. This is the error: Request for the permission of type 'System.Security.Permissions.EnvironmentPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed If I cut out the code that asserts the need for unlimited FileIOPermissions, then the error changes to: Unable to retrieve security descriptor for this frame So I can't get away with just asserting less permissions. I assume that this is something to do with using MDX in this way. Clearly the permissions on the assembly are inadequate, so I tried updating the rssrvpolicy.config file: <configuration> <mscorlib> <security> <policy> <PolicyLevel version="1"> <SecurityClasses> <SecurityClass Name="AllMembershipCondition" Description="System.Security.Policy.AllMembershipCondition, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/> <SecurityClass Name="AspNetHostingPermission" Description="System.Web.AspNetHostingPermission, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/> <SecurityClass Name="DnsPermission" Description="System.Net.DnsPermission, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/> <SecurityClass Name="EnvironmentPermission" Description="System.Security.Permissions.EnvironmentPermission, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/> <SecurityClass Name="FileIOPermission" Description="System.Security.Permissions.FileIOPermission, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/> <SecurityClass Name="FirstMatchCodeGroup" Description="System.Security.Policy.FirstMatchCodeGroup, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/> <SecurityClass Name="IsolatedStorageFilePermission" Description="System.Security.Permissions.IsolatedStorageFilePermission, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/> <SecurityClass Name="NamedPermissionSet" Description="System.Security.NamedPermissionSet"/> <SecurityClass Name="PrintingPermission" Description="System.Drawing.Printing.PrintingPermission, System.Drawing, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/> <SecurityClass Name="ReflectionPermission" Description="System.Security.Permissions.ReflectionPermission, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/> <SecurityClass Name="RegistryPermission" Description="System.Security.Permissions.RegistryPermission, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/> <SecurityClass Name="SecurityPermission" Description="System.Security.Permissions.SecurityPermission, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/> <SecurityClass Name="SocketPermission" Description="System.Net.SocketPermission, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/> <SecurityClass Name="SqlClientPermission" Description="System.Data.SqlClient.SqlClientPermission, System.Data, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/> <SecurityClass Name="StrongNameMembershipCondition" Description="System.Security.Policy.StrongNameMembershipCondition, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/> <SecurityClass Name="UnionCodeGroup" Description="System.Security.Policy.UnionCodeGroup, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/> <SecurityClass Name="UrlMembershipCondition" Description="System.Security.Policy.UrlMembershipCondition, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/> <SecurityClass Name="WebPermission" Description="System.Net.WebPermission, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/> <SecurityClass Name="ZoneMembershipCondition" Description="System.Security.Policy.ZoneMembershipCondition, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/> </SecurityClasses> <NamedPermissionSets> <PermissionSet class="NamedPermissionSet" version="1" Unrestricted="true" Name="FullTrust" Description="Allows full access to all resources" /> <PermissionSet class="NamedPermissionSet" version="1" Name="Nothing" Description="Denies all resources, including the right to execute" /> <PermissionSet class="NamedPermissionSet" version="1" Name="Execution"> <IPermission class="SecurityPermission" version="1" Flags="Execution" /> </PermissionSet> <PermissionSet class="DirectoryServicesPermissionSet" version="1" Name="DSPermissionSet" Description="A special permission set that grants browse access to DirectoryServices"> <IPermission class="DirectoryServicesPermission" version="1" Browse=""/> <IPermission class="SecurityPermission" version="1" Flags="Assertion, Execution"/> </PermissionSet> </NamedPermissionSets> <CodeGroup class="FirstMatchCodeGroup" version="1" PermissionSetName="Nothing"> <IMembershipCondition class="AllMembershipCondition" version="1" /> <CodeGroup class="UnionCodeGroup" version="1" PermissionSetName="Execution" Name="Report_Expressions_Default_Permissions" Description="This code group grants default permissions for code in report expressions and Code element. "> <IMembershipCondition class="StrongNameMembershipCondition" version="1" PublicKeyBlob="0024000004800000940000000602000000240000525341310004000001000100512C8E872E28569E733BCB123794DAB55111A0570B3B3D4DE3794153DEA5EFB7C3FEA9F2D8236CFF320C4FD0EAD5F677880BF6C181F296C751C5F6E65B04D3834C02F792FEE0FE452915D44AFE74A0C27E0D8E4B8D04EC52A8E281E01FF47E7D694E6C7275A09AFCBFD8CC82705A06B20FD6EF61EBBA6873E29C8C0F2CAEDDA2" /> </CodeGroup> <CodeGroup class="FirstMatchCodeGroup" version="1" PermissionSetName="Execution" Description="This code group grants MyComputer code Execution permission. "> <IMembershipCondition class="ZoneMembershipCondition" version="1" Zone="MyComputer" /> <CodeGroup class="UnionCodeGroup" version="1" PermissionSetName="FullTrust" Name="Microsoft_Strong_Name" Description="This code group grants code signed with the Microsoft strong name full trust. "> <IMembershipCondition class="StrongNameMembershipCondition" version="1" PublicKeyBlob="002400000480000094000000060200000024000052534131000400000100010007D1FA57C4AED9F0A32E84AA0FAEFD0DE9E8FD6AEC8F87FB03766C834C99921EB23BE79AD9D5DCC1DD9AD236132102900B723CF980957FC4E177108FC607774F29E8320E92EA05ECE4E821C0A5EFE8F1645C4C0C93C1AB99285D622CAA652C1DFAD63D745D6F2DE5F17E5EAF0FC4963D261C8A12436518206DC093344D5AD293" /> </CodeGroup> <CodeGroup class="UnionCodeGroup" version="1" PermissionSetName="FullTrust" Name="Ecma_Strong_Name" Description="This code group grants code signed with the ECMA strong name full trust. "> <IMembershipCondition class="StrongNameMembershipCondition" version="1" PublicKeyBlob="00000000000000000400000000000000" /> </CodeGroup> <CodeGroup class="UnionCodeGroup" version="1" PermissionSetName="FullTrust" Name="Report_Server_Strong_Name" Description="This code group grants Report Server code full trust. "> <IMembershipCondition class="StrongNameMembershipCondition" version="1" PublicKeyBlob="0024000004800000940000000602000000240000525341310004000001000100272736AD6E5F9586BAC2D531EABC3ACC666C2F8EC879FA94F8F7B0327D2FF2ED523448F83C3D5C5DD2DFC7BC99C5286B2C125117BF5CBE242B9D41750732B2BDFFE649C6EFB8E5526D526FDD130095ECDB7BF210809C6CDAD8824FAA9AC0310AC3CBA2AA0523567B2DFA7FE250B30FACBD62D4EC99B94AC47C7D3B28F1F6E4C8" /> </CodeGroup> <CodeGroup class="UnionCodeGroup" version="1" PermissionSetName="FullTrust"> <IMembershipCondition class="UrlMembershipCondition" version="1" Url="$CodeGen$/*" /> </CodeGroup> <CodeGroup class="UnionCodeGroup" version="1" PermissionSetName="FullTrust" Name="SharePoint_Server_Strong_Name" Description="This code group grants SharePoint Server code full trust. "> <IMembershipCondition class="StrongNameMembershipCondition" version="1" PublicKeyBlob="0024000004800000940000000602000000240000525341310004000001000100AFD4A0E7724151D5DD52CB23A30DED7C0091CC01CFE94B2BCD85B3F4EEE3C4D8F6417BFF763763A996D6B2DFC1E7C29BCFB8299779DF8785CDE2C168CEEE480E570725F2468E782A9C2401302CF6DC17E119118ED2011937BAE9698357AD21E8B6DFB40475D16E87EB03C744A5D32899A0DBC596A6B2CFA1E509BE5FBD09FACF" /> </CodeGroup> <CodeGroup class="UnionCodeGroup" version="1" PermissionSetName="FullTrust" Name="MyCompany.MIS.Security" Description="A special code group for my custom assembly."> <IMembershipCondition class="StrongNameMembershipCondition" version="1" PublicKeyBlob="00240000048000009400000006020000002400005253413100040000010001003F099786BD0BDCD36FF941A6EC9E6612103F15D0D34DF124FF4792C237EF88E88C23C3BAD09A57FAD1C3364003C4C27E7EFA206520286982563134566247AFCFFFDCA1B91B9AA0EBAEA81F20A3BB6769037D882DFB38F9D7FFE2F19B8975C18CED382BC2BB911C7D4B8484B39EE3AC651530A1DDD21DCE50A24EEED613CF8DBA" Name="MyCompany.MIS.Security" AssemblyVersion="3.0.0.4"/> </CodeGroup> </CodeGroup> </PolicyLevel> </policy> </security> </mscorlib> </configuration> I've added 'Full Trust' to my specific assembly. The new clause there was generated using caspol.exe so I think it should be correct. However, this made no difference at all to the error! However, if I upgrade Report_Expressions_Default_Permissions (see above) to Full Trust, the problem is 'solved'. Unfortunately giving Full Trust to any and all Report Expressions is not an option. Can anyone help? Dr. Bunsen
View Replies !
View Related
Msg 6573 Method, Property Or Field In Assembly Is Not Static. VB.Net Assembly In SQL Server Problem
I am trying to get a function I created in VB 5 for Access and Excel to work in SQL 2005. I was able to update the old VB code to work in VB 2005. I compiled and made a .dll, and I was able to register the new Assembly in SQL Server. When I try to create the Function, I get an error: CREATE FUNCTION dbo.Temperature(@FluidName char, @InpCode Char, @Units Char, @Prop1 varchar, @Prop2 varChar) RETURNS VarChar AS EXTERNAL NAME FluidProps.[FluidProps.FluidProperties.Fluids].Temperature Error returned: Msg 6573, Level 16, State 1, Procedure Temperature, Line 21 Method, property or field 'Temperature' of class 'FluidProps.FluidProperties.Fluids' in assembly 'FluidProps' is not static. Here is the code (part of it) in the VB class: Header: Imports Microsoft.SqlServer.Server Imports System.Data.SqlClient Imports System.Runtime.InteropServices Imports System.Security Imports System.Security.Permissions Namespace FluidProperties 'Option Strict Off 'Option Explicit On Public Partial Class Fluids Function: Function Temperature(ByRef FluidName As Object, ByRef InpCode As Object, ByRef Units As Object, ByRef Prop1 As Object, Optional ByRef Prop2 As Object = Nothing) As Object Call CalcProp(FluidName, InpCode, Units, Prop1, Prop2) Temperature = ConvertUnits("-T", Units, T, 0) End Function If I change the Function Temperature to Static, I get an error that functions cannot be Static. Its been a long time since I created the code and am having a hard time in my older age of getting the cobwebs out to make it work. I have no problem getting the function to work if I call it from a VB form....so what do I need to do to get it to work on data in my SQL server? Thanks Buck
View Replies !
View Related
Creating A System.Management Assembly In Order For My Own Assembly To Work?
Hi I am a bit paranoid about what I just did to my SQL Server 2005 with this CLR experiment. I created a Class Lib in C# called inLineLib that has a class Queue which represents an object with an ID field. in another separate namespace called inLineCLRsql, I created a class called test which will hold the function to be accessed from DB, I referenced and created an instances of the Queue class, and retrieve it's ID in a function called PrintMessage. namespace inlineCLRsql{ public static class test{ public static void PrintMessage(){ inLineLib.Queue q = new inLineLib.Queue(); int i = q.queueId ; Microsoft.SqlServer.Server.SqlContext.Pipe.Send(i.ToString()); } } } to access this from the db, I attempted to create an assembley referencing inLineCLRsql.dll. This didn't work as it complained about inLineLib assembly not existing in the db. I then attempted to create an assembley for inLineLib but it barfed saying System.Management assembly not created. so what I did is (and this is where I need to know if I just ruined sql server or not): 1- ALTER DATABASE myDB SET TRUSTWORTHY ON;. 2- CREATE ASSEMBLY SystemManagement FROM 'C:WINDOWSMicrosoft.NETFrameworkv2.0.50727System.Management.dll' WITH PERMISSION_SET = UNSAFE 3- CREATE ASSEMBLY inLineLibMaster FROM 'D:inLineServerinLineLibinDebuginLineLib.dll' WITH PERMISSION_SET = unsafe 4- and finally CREATE ASSEMBLY inLineLib FROM 'D:inLineServerCLRSQLinlineCLRsqlinDebuginlineCLRsql.dll' WITH PERMISSION_SET = SAFE Everything works after those steps (which took some trial and error). I can create a sproc like: CREATE PROC sp_test AS EXTERNAL NAME inLineLib.[inlineCLRsql.test].PrintMessage and it returns the Queue ID Is there anything unadvisable about the steps above? Thanks for your help M
View Replies !
View Related
Error While Creating Assembly
I am trying to create an assembly on a sql server 2005 machine but it gives me following error: Msg 33009, Level 16, State 2, Line 2 The database owner SID recorded in the master database differs from the database owner SID recorded in database 'XYZ'. You should correct this situation by resetting the owner of database 'XYZ' using the ALTER AUTHORIZATION statement. I tried using the alter authorization statement to change the owner. It did not work. I am able to create same assembly on another test database but can not create it on this database. Is this because of orphan logins? Thanks for the help. Harshal.
View Replies !
View Related
Error Creating Assembly
I encountered something strange, deploying the following assemblies CREATE ASSEMBLY [Sentry] AUTHORIZATION [dbo] FROM 'c:clrSentry.dll' WITH PERMISSION_SET = EXTERNAL_ACCESS; GO CREATE ASSEMBLY [Sentry.XmlSerializers] AUTHORIZATION [dbo] FROM 'C:clrSentry.XmlSerializers.dll' WITH PERMISSION_SET = SAFE; GO Sentry.XmlSerializers errored out with: Msg 6218, Level 16, State 2, Line 2 CREATE ASSEMBLY for assembly 'Sentry.XmlSerializers' failed because assembly 'Sentry.XmlSerializers' failed verification. Check if the referenced assemblies are up-to-date and trusted (for external_access or unsafe) to execute in the database. CLR Verifier error messages if any will follow this message [ : Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializerContract::CanSerialize][mdToken=0x600006e][offset 0x00000001][token 0x01000019]System.TypeLoadException: Could not load type 'Sentry.SentryDataService.SentryDataService' from assembly 'Sentry, Version=1.0.2764.18017, Culture=neutral, PublicKeyToken=null'. Type load failed. The interesting thing is that when I deploy this locally on my machine, there are no problems whatsoever. Using sp_configure the servers appear to be set up the same way. The database also has trustworthy set on for both. Anything, I could be missing? Thanks
View Replies !
View Related
Error When Loading Assembly
Hi, i have sql server 2005.i have one assembly which created using VS 2005 (c#). i want to load this assembly on server from management studio. sql statements are CREATE ASSEMBLY [AMEX] FROM 'C:Documents and SettingschrautMy DocumentsVisual Studio 2005ProjectsSqlServerProject1SqlServerProject1inDebugSqlServerProject1.dll' WITH PERMISSION_SET = EXTERNAL_ACCESS GO after that i am getting error. CREATE ASSEMBLY for assembly 'SqlServerProject1' failed because assembly 'SqlServerProject1' is not authorized for PERMISSION_SET = EXTERNAL_ACCESS. The assembly is authorized when either of the following is true: the database owner (DBO) has EXTERNAL ACCESS ASSEMBLY permission and the database has the TRUSTWORTHY database property on; or the assembly is signed with a certificate or an asymmetric key that has a corresponding login with EXTERNAL ACCESS ASSEMBLY permission. If you have restored or attached this database, make sure the database owner is mapped to the correct login on this server. If not, use sp_changedbowner to fix the problem. can anyone help me out regarding to this. thanks, Chetan S. Raut.
View Replies !
View Related
CREATE ASSEMBLY ERROR: Msg 701
Hello there, i have the following problem. I need to get some .dll's into MS SQL-Server 2005, that i need to get a own made .dll installed. When i try to: Code Block CREATE ASSEMBLY SystemWeb FROM 'C:WINDOWSMicrosoft.NETFrameworkv2.0.50727System.Web.dll' WITH PERMISSION_SET = UNSAFE; i get the following message: Code Block Warning: The Microsoft .Net frameworks assembly 'system.web, version=2.0.0.0, culture=neutral, publickeytoken=b03f5f7f11d50a3a, processorarchitecture=x86.' you are registering is not fully tested in SQL Server hosted environment. Warning: The Microsoft .Net frameworks assembly 'system.enterpriseservices, version=2.0.0.0, culture=neutral, publickeytoken=b03f5f7f11d50a3a, processorarchitecture=x86.' you are registering is not fully tested in SQL Server hosted environment. Warning: The Microsoft .Net frameworks assembly 'system.runtime.remoting, version=2.0.0.0, culture=neutral, publickeytoken=b77a5c561934e089, processorarchitecture=msil.' you are registering is not fully tested in SQL Server hosted environment. Warning: The Microsoft .Net frameworks assembly 'system.design, version=2.0.0.0, culture=neutral, publickeytoken=b03f5f7f11d50a3a, processorarchitecture=msil.' you are registering is not fully tested in SQL Server hosted environment. Msg 701, Level 17, State 13, Line 1 There is insufficient system memory to run this query. When i try to create one of the another assemblies ( system.enterpriseservices, system.runtime.remoting, system.design ) i get the same message. I looked for this Error and found only this BUG-report: BUG#: 58267 (SQLBUG_70) Article ID: 274030 http://support.microsoft.com/kb/274030/en-us But this does not solve my problem. As far as i know we use MS SQL-Server 2005 without any Service-Packs. Question: is there any Table/View to find out the Versionnumber/Service-Pack In the moment i am waiting for our admin to install SP2 for SQL-Server, hoping that this will fix the problem. Greetings
View Replies !
View Related
CREATE ASSEMBLY ERROR
I am using this code to create dll : Execute.cs using System; using Microsoft.SqlServer.Dts.Runtime; public class Execute { public static void Package(string dtsxPath) { try { Package pkg; Application app; DTSExecResult pkgResults; app = new Application(); pkg = app.LoadPackage(dtsxPath, null); pkgResults = pkg.Execute(); } catch (System.Exception ex) { throw ex; } } } Then this c:Program FilesMicrosoft Visual Studio 8VC>csc /target:library C:SSISSSISE xecute.cs /reference:C:SSISSSISMicrosoft.SqlServer.ManagedDTS.dll It creates Execute.dll but when I run this is sql server CREATE ASSEMBLY ssid from 'c:Program FilesMicrosoft Visual Studio 8VCExecute.dll' WITH PERMISSION_SET = UNSAFE I am getting Error Warning: The SQL Server client assembly 'microsoft.sqlserver.manageddts, version=9.0.242.0, culture=neutral, publickeytoken=89845dcd8080cc91, processorarchitecture=msil.' you are registering is not fully tested in SQL Server hosted environment. Warning: The SQL Server client assembly 'microsoft.sqlserver.dtsruntimewrap, version=9.0.242.0, culture=neutral, publickeytoken=89845dcd8080cc91, processorarchitecture=msil.' you are registering is not fully tested in SQL Server hosted environment. Msg 10301, Level 16, State 1, Line 1 Assembly 'Execute' references assembly 'system.windows.forms, version=2.0.0.0, culture=neutral, publickeytoken=b77a5c561934e089.', which is not present in the current database. SQL Server attempted to locate and automatically load the referenced assembly from the same location where referring assembly came from, but that operation has failed (reason: 2(The system cannot find the file specified.)). Please load the referenced assembly into the current database and retry your request. I don't see any place I am using System.window.forms Any idea why? Thanks - Ashok --------------------------------------------------------- I changed my location to to CSC C:WINNTMicrosoft.NETFrameworkv2.0.50727> Now I get this error Warning: The SQL Server client assembly 'microsoft.sqlserver.manageddts, version=9.0.242.0, culture=neutral, publickeytoken=89845dcd8080cc91, processorarchitecture=msil.' you are registering is not fully tested in SQL Server hosted environment. Warning: The SQL Server client assembly 'microsoft.sqlserver.dtsruntimewrap, version=9.0.242.0, culture=neutral, publickeytoken=89845dcd8080cc91, processorarchitecture=msil.' you are registering is not fully tested in SQL Server hosted environment. Warning: The Microsoft .Net frameworks assembly 'system.windows.forms, version=2.0.0.0, culture=neutral, publickeytoken=b77a5c561934e089, processorarchitecture=msil.' you are registering is not fully tested in SQL Server hosted environment. Warning: The Microsoft .Net frameworks assembly 'system.drawing, version=2.0.0.0, culture=neutral, publickeytoken=b03f5f7f11d50a3a, processorarchitecture=msil.' you are registering is not fully tested in SQL Server hosted environment. Warning: The Microsoft .Net frameworks assembly 'accessibility, version=2.0.0.0, culture=neutral, publickeytoken=b03f5f7f11d50a3a, processorarchitecture=msil.' you are registering is not fully tested in SQL Server hosted environment. Warning: The Microsoft .Net frameworks assembly 'system.runtime.serialization.formatters.soap, version=2.0.0.0, culture=neutral, publickeytoken=b03f5f7f11d50a3a, processorarchitecture=msil.' you are registering is not fully tested in SQL Server hosted environment. Msg 10301, Level 16, State 1, Line 1 Assembly 'Execute1' references assembly 'microsoft.sqlserver.msxml6_interop, version=6.0.0.0, culture=neutral, publickeytoken=89845dcd8080cc91.', which is not present in the current database. SQL Server attempted to locate and automatically load the referenced assembly from the same location where referring assembly came from, but that operation has failed (reason: 2(The system cannot find the file specified.)). Please load the referenced assembly into the current database and retry your request. --------------------------------------------- I managed to found this DLL Microsoft.SQLServer.msxml6_interop.dll so I copied to same location Now It's looking for microsoft.sqlserver.sqltdiagm - Which I am not able to find any place .......................
View Replies !
View Related
Error While Trying To Load Assembly
Hi, I have created an assembly in my database with permission set unsafe and created a function that uses a method defined inside the assembly. In my test environment everything went smooth, both creation of the assembly as well as the actual execution of the stored procedure that uses the method. Now, moving to production, the creation part all went fine too. But whenever I try to execute the stored procedure that uses the method I get this annoying error: "An error occurred in the Microsoft .NET framework while trying to load assembly id 65538. The server may be running out of resources, or the assembly may not be trusted with PERMISSION_SET = EXTERNAL_ACCESS or UNSAFE." The server resources are fine, and the assembly has been succesfully created with permission set unsafe. I have tried deleting the method/assembly and creting them again a couple of times without any success. The permissions for the .dll are Unrestricted for all levels before being created in the database. I don't know if this matter at all, but since its permissions unrestricted it should not be the problem anyway. The .dll is signed before being created in the database. I have read this article http://support.microsoft.com/default.aspx/kb/918040 and even though the attach/detach is not the scenario here, I've tried to the process of creating the assembly with different dbo's. I have also tried the solution found at http://forums.microsoft.com/TechNet/ShowPost.aspx?PostID=1724171&SiteID=17 and executed sn.exe -Vr <assembly>,<publictoken> followed by a restart of the SQL Server but the error is still there. Some suggestions on how to go on from here will be very helpful.
View Replies !
View Related
Error: OdbcPermission In Assembly
Hello, I have an assembly used in a report (.rdl). The assembly enables to connect to Database via ODBC. Also, it had been signed (.snk) using the VS designer. In development platform, the following error was outputted when RUN the report (** PREVIEW is no error ** ) Error: ============================================================ 'RSReportHost.exe' (Managed): Loaded 'C:WINDOWSassemblyGAC_32mscorlib2.0.0.0__b77a5c561934e089mscorlib.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'RSReportHost.exe' (Managed): Loaded 'C:Program FilesMicrosoft Visual Studio 8Common7IDEPrivateAssembliesRSReportHost.exe', No symbols loaded. 'RSReportHost.exe' (Managed): Loaded 'C:WINDOWSassemblyGAC_MSILSystem.Windows.Forms2.0.0.0__b77a5c561934e089System.Windows.Forms.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'RSReportHost.exe' (Managed): Loaded 'C:WINDOWSassemblyGAC_MSILSystem2.0.0.0__b77a5c561934e089System.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'RSReportHost.exe' (Managed): Loaded 'C:WINDOWSassemblyGAC_MSILSystem.Drawing2.0.0.0__b03f5f7f11d50a3aSystem.Drawing.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'RSReportHost.exe' (Managed): Loaded 'C:Program FilesMicrosoft Visual Studio 8Common7IDEPrivateAssembliesReportingServicesLibrary.dll', No symbols loaded. 'RSReportHost.exe' (Managed): Loaded 'C:Program FilesMicrosoft Visual Studio 8Common7IDEPrivateAssembliesMicrosoft.ReportingServices.Diagnostics.dll', No symbols loaded. 'RSReportHost.exe' (Managed): Loaded 'C:WINDOWSassemblyGAC_MSILSystem.Configuration2.0.0.0__b03f5f7f11d50a3aSystem.Configuration.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'RSReportHost.exe' (Managed): Loaded 'C:WINDOWSassemblyGAC_MSILSystem.Xml2.0.0.0__b77a5c561934e089System.Xml.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'RSReportHost.exe' (Managed): Loaded 'C:WINDOWSassemblyGAC_32System.Web2.0.0.0__b03f5f7f11d50a3aSystem.Web.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'RSReportHost.exe' (Managed): Loaded 'C:Program FilesMicrosoft Visual Studio 8Common7IDEPrivateAssembliesMicrosoft.ReportingServices.Interfaces.dll', No symbols loaded. 'RSReportHost.exe' (Managed): Loaded 'C:Program FilesMicrosoft Visual Studio 8Common7IDEPrivateAssembliesReportingServicesNativeClient.dll', No symbols loaded. 'RSReportHost.exe' (Managed): Loaded 'C:WINDOWSWinSxSx86_Microsoft.VC80.CRT_1fc8b3b9a1e18e3b_8.0.50727.762_x-ww_6b128700msvcm80.dll', No symbols loaded. 'RSReportHost.exe' (Managed): Loaded 'C:Program FilesMicrosoft Visual Studio 8Common7IDEPrivateAssembliesMicrosoft.ReportingServices.Designer.dll', No symbols loaded. 'RSReportHost.exe' (Managed): Loaded 'C:Program FilesMicrosoft Visual Studio 8Common7IDEPrivateAssembliesMicrosoft.ReportingServices.ReportPreview.dll', No symbols loaded. 'RSReportHost.exe' (Managed): Loaded 'C:Program FilesMicrosoft Visual Studio 8Common7IDEPrivateAssembliesMicrosoft.ReportingServices.ProcessingCore.dll', No symbols loaded. 'RSReportHost.exe' (Managed): Loaded 'C:WINDOWSassemblyGAC_MSILSystem.Web.Services2.0.0.0__b03f5f7f11d50a3aSystem.Web.Services.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'RSReportHost.exe' (Managed): Loaded 'C:WINDOWSassemblyGAC_32System.Data2.0.0.0__b77a5c561934e089System.Data.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'RSReportHost.exe' (Managed): Loaded 'C:Program FilesMicrosoft Visual Studio 8Common7IDEPrivateAssembliesMicrosoft.ReportingServices.ProcessingObjectModel.dll', No symbols loaded. 'RSReportHost.exe' (Managed): Loaded 'C:Program FilesMicrosoft Visual Studio 8Common7IDEPrivateAssembliesMicrosoft.ReportingServices.XmlRendering.dll', No symbols loaded. 'RSReportHost.exe' (Managed): Loaded 'C:Program FilesMicrosoft Visual Studio 8Common7IDEPrivateAssembliesMicrosoft.ReportingServices.CsvRendering.dll', No symbols loaded. 'RSReportHost.exe' (Managed): Loaded 'C:Program FilesMicrosoft Visual Studio 8Common7IDEPrivateAssembliesMicrosoft.ReportingServices.ImageRendering.dll', No symbols loaded. 'RSReportHost.exe' (Managed): Loaded 'C:Program FilesMicrosoft Visual Studio 8Common7IDEPrivateAssembliesMicrosoft.ReportingServices.HtmlRendering.dll', No symbols loaded. 'RSReportHost.exe' (Managed): Loaded 'C:Program FilesMicrosoft Visual Studio 8Common7IDEPrivateAssembliesMicrosoft.ReportingServices.ExcelRendering.dll', No symbols loaded. 'RSReportHost.exe' (Managed): Loaded 'C:Program FilesMicrosoft Visual Studio 8Common7IDEPrivateAssembliesConnDB.dll', Symbols loaded. 'RSReportHost.exe' (Managed): Loaded 'expression_host_58bcf01c1a8442c3bbe45e4c4847f210', No symbols loaded. 'RSReportHost.exe' (Managed): Loaded 'C:WINDOWSassemblyGAC_32System.Transactions2.0.0.0__b77a5c561934e089System.Transactions.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. Connection Failure. Request for the permission of type 'System.Data.Odbc.OdbcPermission, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed. A first chance exception of type 'System.Security.SecurityException' occurred in System.Data.dll A first chance exception of type 'System.NullReferenceException' occurred in ConnDB.dll A first chance exception of type 'System.Security.SecurityException' occurred in System.Data.dll Error: Failed to retrieve the required data from the DataBase. Object reference not set to an instance of an object. Connection Failure. Request for the permission of type 'System.Data.Odbc.OdbcPermission, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed. The thread 0x12c8 has exited with code 0 (0x0). The program '[3388] RSReportHost.exe: Managed' has exited with code 0 (0x0). ============================================================ Any idea for me? thanks a lot!
View Replies !
View Related
Error In Custom Assembly
When I add a custom assembly I am trying to pass certain fields in dataset I am getting the following error invalid fields i.e. that is fields that I passed are invalid. It also says multi path identifier for microsft.reportingservices.reportobjectmodel.fieldimpl cud not be found. Thanks Sai
View Replies !
View Related
Error When Trying To Create Assembly
Hi, I ran the following in the management studio: CREATE ASSEMBLY MyCLRAssembly from 'c: empMyCLRAssembly.dll' WITH PERMISSION_SET = SAFE Go For some reason I get the following error: Msg 6517, Level 16, State 1, Line 1 Failed to create AppDomain 'AdventureWorks.dbo[ddl].22'. I tried to google this error, but couldn't find it... I would appreciate it if someone can tell me what I'm doing wrong. Ohad.
View Replies !
View Related
Error While Creating Assembly
I am trying to create an assembly on a sql server 2005 machine but it gives me following error: Msg 33009, Level 16, State 2, Line 2 The database owner SID recorded in the master database differs from the database owner SID recorded in database 'XYZ'. You should correct this situation by resetting the owner of database 'XYZ' using the ALTER AUTHORIZATION statement. I tried using the alter authorization statement to change the owner. It did not work. The same assembly is created on another test database but can not create it on this database. Is this because of orphan logins? Thanks for the help. Harshal.
View Replies !
View Related
Possible To Encrypt Database Assembly?
Hello. I've built a simple Visual Basic .NET project containing the following code... Imports System Imports System.Data Imports System.Data.SqlClient Imports System.Data.SqlTypes Imports Microsoft.SqlServer.Server Partial Public Class StoredProcedures <Microsoft.SqlServer.Server.SqlProcedure()> _ Public Shared Sub WhoAmI() Using connection As New SqlConnection("context connection=true") connection.Open() Dim command As New SqlCommand("SELECT SUSER_SNAME()", connection) SqlContext.Pipe.ExecuteAndSend(command) End Using End Sub End Class From Visual Studio, I want to encrypt the contents of this assembly, as a proof-of-concept. Even though assembly contents are stored as varbinary(MAX) in the database, converting to varchar(MAX) will expose the code. However, the Dotfuscator Community Edition reports the following error: "Dotfuscator Community Edition cannot operate on SQL Server applications.... please try Standard or Professional Edition." Has anyone tried encrypting a database assembly and deploying to the database? A good test would be to issue the following TSQL script against the database holding the assembly... -- Does the sample code above run? EXEC dbo.WhoAmI GO -- Is the code readable? SELECT * , Convert(varchar(MAX), content) FROM sys.assembly_files
View Replies !
View Related
CREATE ASSEMBLY Gets Msg 6513 Error
I have an issue where we went to enable CLR in our production system this morning and ran into some trouble. The actual enabling went fine but when we ran the assembly code we got the following: .Net SqlClient Data Provider: Msg 6513, Level 16, State 27, Line 10 Failed to initialize the Common Language Runtime (CLR) v2.0.50727 due to memory pressure. Please restart SQL server in Address Windowing Extensions (AWE) mode to use CLR integration features. We're running 32 bit SQL2005 SP2 and Windows Server 2003, and AWE is already enabled (using 29 GB out of the 32 GB total). I looked at another thread that somewhat covered this (http://forums.microsoft.com/TechNet/ShowPost.aspx?PostID=1178135&SiteID=17), unfortunately there wasn't a post about how things worked out. That post suggested that the virtual address space was too fragmented for SQLCLR to load. I have about a week before we hit our maintenance window and reboot the server and I'm hoping that if the first thing we do when the box comes back up is create the assembly, we'll solve our issue. As far as the inevitable comment that we should go to x64: I realize that would probably solve my problem but it's not going to happen in the next 6 months, much less 6 days. Any insight into this would be greatly appreciated.
View Replies !
View Related
Stored Procedure Assembly Error
Hello there, I am having trouble with the following and appreciate any help.Thanks in advanced. I have created an assembly to delete records in exchange (which works fine when testing it in debug mode). I then create the assembly in SQL server 2005(tried both unsafe and external access btw), and then i create a stored procedure calling the assembly. Now my error occurs when i try to execute this stored procedure in SQL Server. I get the following... Msg 6522, Level 16, State 1, Procedure sp_DeleteExchApp, Line 0A .NET Framework error occurred during execution of user defined routine or aggregate 'sp_DeleteExchApp': System.Security.SecurityException: System.Security.Permissions.SecurityPermissionSystem.Security.SecurityException: at App_Delete.eSay.AppointmentDelete.DeleteAppointment(Guid GUID).(1 row(s) affected) Now when i have looked around the web, i have come accross people saying that it is to do with the assembly trying to access something it does not have permission for. But i cant figure out what that is or why it is throwing an error. The code for the assembly is as follows: Public Shared Sub DeleteAppointment(ByVal GUID As System.Guid) Dim CalendarURL As String Dim ItemURL As String Dim Rs As New ADODB.Recordset Dim Rec As New ADODB.Record Dim Conn As New ADODB.Connection Dim iAppt As New Appointment Dim Target As String Dim strCRMGUID As String Dim strGUID As String Dim sSQL As String Dim Check As String strCRMGUID = GUID.ToString 'Using the Exchange OLE DB provider CalendarURL = "file://./backofficestorage/esay-solutions.co.uk/public folders/Office Diary" 'Open a recordset for the items in the calendar folder Rec.Open(CalendarURL) Rs.ActiveConnection = Rec.ActiveConnection sSQL = "SELECT ""DAV:href"", " & _ " ""urn:schemas:calendar:location"", " & _ " ""urn:schemas:calendar:dtstart"", " & _ " ""urn:schemas:calendar:dtend"", " & _ " ""urn:schemas:httpmail:textdescription"" " & _ "from scope('shallow traversal of """ & CalendarURL & """')" Rs.Open(sSQL, Rec.ActiveConnection, CursorTypeEnum.adOpenUnspecified, LockTypeEnum.adLockOptimistic, 1) 'Enumerate the recordset, checking each item's location If Rs.RecordCount > 0 Then Rs.MoveFirst() Do Until Rs.EOF 'get the location of each item Check = Rs.Fields(CdoHTTPMail.cdoTextDescription).Value strGUID = StripGUID(Check) 'test for desired location If (strGUID = strCRMGUID) Then Rs.Delete() End If Rs.MoveNext() Loop End If End Sub Private Shared Function StripGUID(ByVal i_strAppDescription As String) As String 'Function to strip the GUID from the message field Dim r As Integer Dim SearchChar As String Dim testPos As Integer Dim GUID As String SearchChar = "**¦" testPos = InStr(i_strAppDescription, SearchChar) testPos = testPos + 3 If testPos > 0 Then GUID = Mid(i_strAppDescription, testPos) End If StripGUID = GUID End Function End ClassEnd Namespace Thanks again for any help.
View Replies !
View Related
Error Adding Assembly To SQL 2005
I have a clr assembly that access the internet via Sockets and file access. This require me to set the Assembly permissions level to External. There are lots of messages on the net regarding this issue. none have worked for me. Currently I'm trying to install the assembly with "sign the assembly" checked, createing a strong name key file. When I run the installation I get the following message from the server "Create failed for SqlAssembly 'xxx'.(Microsoft.sqlServer.Smo) an exception occured while executing a Transact-SQL statement or batch (Microsoft.SqlServer.ConnectionInfo) A severe error occured in the current command. The results, if any, should be discarded. This is the messag I get. The following link does not display any usefull information. TITLE: Microsoft SQL Server Management Studio ------------------------------ Create failed for SqlAssembly 'KBTTriggers'. (Microsoft.SqlServer.Smo) For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=9.00.1399.00&EvtSrc=Microsoft.SqlServer.Management.Smo.ExceptionTemplates.FailedOperationExceptionText&EvtID=Create+SqlAssembly&LinkId=20476 ------------------------------ ADDITIONAL INFORMATION: An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo) ------------------------------ A severe error occurred on the current command. The results, if any, should be discarded. A severe error occurred on the current command. The results, if any, should be discarded. (Microsoft SQL Server, Error: 0) For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&EvtSrc=MSSQLServer&EvtID=0&LinkId=20476 ------------------------------ BUTTONS: OK ------------------------------
View Replies !
View Related
Error In SQL Server 2005 CLR Assembly
In the past we've days we've had an assembly that had worked previously which now fails with the error: Failed to open malformed assembly 'System.Data' with HRESULT 0x80070008. There have been no changes to the .NET framework at the server level, all other assemblies on the server continue to function and the assemly does work when deployed to another server. The assembly has been recreeated from scratch yet the error persisted. In another attempt to narrow down the cause we moved the system.data.dll to another server in an attempt to see if the particular DLL was the issue, however the other server had no issues. I'm assuming that the error we're getting has some cause other than with System.Data.dll.Does anyone have any ideas what could be causing this or how to proceed in troubleshooting this issue? Thanks Bill
View Replies !
View Related
CREATE ASSEMBLY Error: Could Not Be Installed
I ran the following: CREATE ASSEMBLY A3rdPartyDLL FROM 'C:Program Files3rdPartyComponents3rdParty.dll' WITH PERMISSION_SET = EXTERNAL_ACCESS and got the following error message: Assembly 'A3rdPartyDLL' could not be installed because existing policy would keep it from being used. How can I change the 'existing policy'?
View Replies !
View Related
Cannot Find File Or Assembly Error.....
I created an assembly to access my SSRS web service in a Script task. The package runs fine on my machine but gets the following error from the production box..... The script threw an exception: Could not load file or assembly 'Microsoft.SqlServer.ReportingServices2005, Version=0.0.0.0, Culture=neutral, PublicKeyToken=3bd4760abc5efbcb' or one of its dependencies. The system cannot find the file specified. I followed the exact same procedures for creating the .dll on the production box as I did developing on my machine...strong name, load to gac etc....but it still cannot find it. My production SQL Server is 64 bit so perhaps there is another step I need to take? Anyone have a clue as to what I may be missing? TIA
View Replies !
View Related
Error: Assembly Is Not Marked As Serilizable
We have developed a Custom Data Flow Destination Component for Oracle along with its own Connection Manager. We tried to use it programmatically.(i.e. creating Data Flow Task programmatically with Flat File Source and Orcale Bulk Load Destination) In that when we assign a Connection Manager to Oracle Bulk Destination Component RunTimeConnectionCollection, we have to typecast it from ConnectionManager to ConnectionManager90. After that we set Oracle Bulk Load Destination Component properties and add path to it from Flat File Source. Then when we call AcquireConnection(null) method with Oracle Destination's instance, it throws the error: " The Connection Manager assembly is not marked as Serializable". In overrided AcquireConnection() method we convert the Oracle Destination's RunTimeConnectionManager from ConnectionManager90 to ConnectionManager to get its innerobject. From innerobject we get the Connection Manager's custom properties and their values. The most Strange thing is that the code works fine in every application (i.e. Console, Windows...) except TestProject. Please let me know what might going wrong.
View Replies !
View Related
Error Registering A Third Party Assembly
Help. When I try to CREATE/Register a third party assembly (dtsearchNetApi2) within SQL server I am getting an error (see below). I have the source code for dtsearchNetApi2 but it is in C++ and I would like to avoid having to extend/modify it if that is avoidable. I have written a 'wrapper' class in C# but sine it references dtsearchNetApi2.dll I can't register that dll either. CREATE ASSEMBLY DBSEARCHNETAPI FROM 'C:TempdtsearchNetApi2.dll' WITH PERMISSION_SET = UNSAFE Msg 6218, Level 16, State 3, Line 2 CREATE ASSEMBLY for assembly 'dtSearchNetApi2' failed because assembly 'dtSearchNetApi2' failed verification. Check if the referenced assemblies are up-to-date and trusted (for external_access or unsafe) to execute in the database. CLR Verifier error messages if any will follow this message dtsearchNetApi2 has references to unmanaged code. The dtSearchNetApi2.dll is a .NET 2.0 wrapper around C++ objects exported in dten600.dll. It is implemented in MSVC++ with Managed Extensions is implemented in C++/CLI 2.0.
View Replies !
View Related
Need To Prevent Database Assembly Creation
On certain servers, I don't want developers to be able to create assemblies. Unfortunately, the command sp_configure 'clr enabled', 0 only prevents the CLR-type from being executed, not its creation. I am unable to rename nor put triggers on sys.assemblies, sys.assembly_modules, sys.assembly_files, and sys.assembly_references . I would prefer the user know the boundaries well before implementation. Has anyone succeeded at this?
View Replies !
View Related
How To Solve Assembly Error On The SQL Server 2005?
Hi all, In the SQL 2005, I want to use CLR,so I write the following query,however,when I execute it, I get the error "CREATE ASSEMBLY for assembly 'SendScheduleJob' failed because assembly 'SendScheduleJob' is not authorized for PERMISSION_SET = UNSAFE. The assembly is authorized when either of the following is true: the database owner (DBO) has UNSAFE ASSEMBLY permission and the database has the TRUSTWORTHY database property on; or the assembly is signed with a certificate or an asymmetric key that has a corresponding login with UNSAFE ASSEMBLY permission." It seems some security problem. Anyone know how to fix it? Thanks in advance. Anyway, I already run the query to enable clr. CREATE ASSEMBLY asmSendScheduleJobAUTHORIZATION dboFROM 'C:SendScheduleJob.dll'WITH PERMISSION_SET = UNSAFEGO
View Replies !
View Related
Assembly Load Error Using Replication In VB Code
Hi, I'm trying to develop a custom conflict resolver and I get the following message: Error loading custom class "HQ.MemberHandler" from custom assembly "C:shareConflictHandler.dll", Error : "Could not load type 'HQ.MemberHandler' from assembly 'ConflictHandler, Version=1.0.0.0, Culture=neutral, PublicKeyToken=42ba9b913dccf3a9'."." The resolver is register in the GAC. I checked with sp_enumcustomresolvers that it is register in SQL. The sync is working fine if I'm not using the resolver. Here's the code of the resolver: Imports System Imports System.Text Imports System.Data Imports System.Data.Common Imports Microsoft.SqlServer.Replication.BusinessLogicSupport Namespace HQ Public Class MemberHandler Inherits BusinessLogicModule ' Variables to hold server names. Private publisherName As String Private subscriberName As String ' Implement the Initialize method to get publication ' and subscription information. Public Overrides Sub Initialize( _ ByVal publisher As String, _ ByVal subscriber As String, _ ByVal distributor As String, _ ByVal publisherDB As String, _ ByVal subscriberDB As String, _ ByVal articleName As String _ ) ' Set the Publisher and Subscriber names. publisherName = publisher subscriberName = subscriber End Sub ' Declare what types of row changes, conflicts, or errors to handle. Public Overrides ReadOnly Property HandledChangeStates() As ChangeStates Get ' Handle Subscriber inserts, updates and deletes. Return (ChangeStates.SubscriberInserts Or _ ChangeStates.SubscriberUpdates Or ChangeStates.SubscriberDeletes) End Get End Property Public Overrides Function InsertHandler(ByVal insertSource As SourceIdentifier, _ ByVal insertedDataSet As DataSet, ByRef customDataSet As DataSet, _ ByRef historyLogLevel As Integer, ByRef historyLogMessage As String) _ As ActionOnDataChange If insertSource = SourceIdentifier.SourceIsSubscriber Then ' Build a line item in the audit message to log the Subscriber insert. Dim AuditMessage As StringBuilder = New StringBuilder() AuditMessage.Append(String.Format("A new member was entered at {0}. " + _ "The ID for the member is :", subscriberName)) AuditMessage.Append(insertedDataSet.Tables(0).Rows(0)("memb_seq").ToString()) AuditMessage.Append("Member Name :") AuditMessage.Append(insertedDataSet.Tables(0).Rows(0)("memb_pnom").ToString()) ' Set the reference parameter to write the line to the log file. historyLogMessage = AuditMessage.ToString() ' Set the history log level to the default verbose level. historyLogLevel = 1 ' Accept the inserted data in the Subscriber's data set and ' apply it to the Publisher. Return ActionOnDataChange.AcceptData Else Return MyBase.InsertHandler(insertSource, insertedDataSet, customDataSet, _ historyLogLevel, historyLogMessage) End If End Function Public Overrides Function UpdateHandler(ByVal updateSource As SourceIdentifier, _ ByVal updatedDataSet As DataSet, ByRef customDataSet As DataSet, _ ByRef historyLogLevel As Integer, ByRef historyLogMessage As String) _ As ActionOnDataChange If updateSource = SourceIdentifier.SourceIsPublisher Then ' Build a line item in the audit message to log the Subscriber update. Dim AuditMessage As StringBuilder = New StringBuilder() AuditMessage.Append(String.Format("An existing member was updated at {0}. " + _ "The ID for the member is ", subscriberName)) AuditMessage.Append(updatedDataSet.Tables(0).Rows(0)("memb_seq").ToString()) AuditMessage.Append("Member Name :") AuditMessage.Append(updatedDataSet.Tables(0).Rows(0)("memb_nom").ToString()) ' Set the reference parameter to write the line to the log file. historyLogMessage = AuditMessage.ToString() ' Set the history log level to the default verbose level. historyLogLevel = 1 ' Accept the updated data in the Subscriber's data set and apply it to the Publisher. Return ActionOnDataChange.AcceptData Else Return MyBase.UpdateHandler(updateSource, updatedDataSet, _ customDataSet, historyLogLevel, historyLogMessage) End If End Function Public Overrides Function DeleteHandler(ByVal deleteSource As SourceIdentifier, _ ByVal deletedDataSet As DataSet, ByRef historyLogLevel As Integer, _ ByRef historyLogMessage As String) As ActionOnDataDelete If deleteSource = SourceIdentifier.SourceIsSubscriber Then ' Build a line item in the audit message to log the Subscriber deletes. ' Note that the rowguid is the only information that is ' available in the dataset. Dim AuditMessage As StringBuilder = New StringBuilder() AuditMessage.Append(String.Format("An existing member was deleted at {0}. " + _ "The rowguid for the member is ", subscriberName)) AuditMessage.Append(deletedDataSet.Tables(0).Rows(0)("rowguid").ToString()) ' Set the reference parameter to write the line to the log file. historyLogMessage = AuditMessage.ToString() ' Set the history log level to the default verbose level. historyLogLevel = 1 ' Accept the delete and apply it to the Publisher. Return ActionOnDataDelete.AcceptDelete Else Return MyBase.DeleteHandler(deleteSource, deletedDataSet, _ historyLogLevel, historyLogMessage) End If End Function End Class End Namespace Here's the SQL query to register the resolver: DECLARE @publication AS sysname; DECLARE @article AS sysname; DECLARE @friendlyname AS sysname; DECLARE @assembly AS nvarchar(500); DECLARE @class AS sysname; SET @publication = N'memb'; SET @article = N'memb'; SET @friendlyname = N'TestConlictResolver'; SET @assembly = N'C:shareConflictHandler.dll'; SET @class = N'HQ.MemberHandler'; -- Register the business logic handler at the Distributor. EXEC sys.sp_registercustomresolver @article_resolver = @friendlyname, @resolver_clsid = NULL, @is_dotnet_assembly = N'true', @dotnet_assembly_name = @assembly, @dotnet_class_name = @class; -- Add an article that uses the business logic handler -- at the Publisher. EXEC sp_changemergearticle @publication = @publication, @article = @article, @property = N'article_resolver', @value = @friendlyname, @force_invalidate_snapshot = 0, @force_reinit_subscription = 0; GO Any clues?? Thanks
View Replies !
View Related
VS2008 Pro Report Viewer Assembly Error
Parser Error Message: Could not load file or assembly 'Microsoft.ReportViewer.WebForms, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified. I'm not sure what to do to fix this. I've downloaded the redistributable for the report viewer. Please help, I need to have this before the weekend is over. Thanks,
View Replies !
View Related
Msg 6522, Level 16, State 2, Line 1: System.InvalidCastException: Conversion From Type 'SqlBoolean' To Type 'Boolean' Is Not Val
I created a function called Temperature in VB to be used as a UDF in SQL2005. I get the error listed below. Any thoughts? CREATE FUNCTION Temperature(@FluidName SQL_variant, @InpCode SQL_variant, @Units SQL_variant, @Prop1 SQL_variant, @Prop2 SQL_variant) RETURNS Float AS EXTERNAL NAME Fluids_VB6.[Fluids_VB6.FluidProperties.Fluids].Temperature Then ran function: select dbo.temperature('R22','t','e','225.6','0') Got this: Msg 6522, Level 16, State 2, Line 1 A .NET Framework error occurred during execution of user defined routine or aggregate 'Temperature': System.InvalidCastException: Conversion from type 'SqlBoolean' to type 'Boolean' is not valid. System.InvalidCastException: at Microsoft.VisualBasic.CompilerServices.Conversions.ToBoolean(Object Value) at Fluids_VB6.FluidProperties.Fluids.Setup(Object& FluidName) at Fluids_VB6.FluidProperties.Fluids.CalcSetup(Object& FluidName, Object& InpCode, Object& Units, Object& Prop1, Object& Prop2) at Fluids_VB6.FluidProperties.Fluids.CalcProp(Object& FluidName, Object& InpCode, Object& Units, Object& Prop1, Object& Prop2) at Fluids_VB6.FluidProperties.Fluids.Temperature(Object FluidName, Object InpCode, Object Units, Object Prop1, Object Prop2) Thanks Buck
View Replies !
View Related
&&"Failed To Load Expression Host Assembly. Details: StrongName Cannot Have An Empty String For The Assembly Name. &&"
I previously had an ASP.NET 1.1 site running on my IIS 6.0 server (not the default website) with Reporting Services running in a subdirectory of that website. I recently upgraded to ASP.NET 2.0 for my website and was greeted with an error when trying to view a report. The error was very non-descript, but when I checked the server logs, it recorded the details as "It is not possible to run two different versions of ASP.NET in the same IIS process. Please use the IIS Administration Tool to reconfigure your server to run the application in a separate process." First of all, I could not figure out where and how to do this. Secondly, I decided to try to also change the Reporting Services folders to run ASP.NET 2.0 and when I did, I was greeted with the following message when attempting to view a report: "Failed to load expression host assembly. Details: StrongName cannot have an empty string for the assembly name." Please help.
View Replies !
View Related
CREATE ASSEMBLY Using Assembly Binary?!?!
I was trying to understand how VS.NET2005 was deploying .NET CLR assemblies to SQL2005 so I ran a trace and found some interesting results. VS.NET creates some SQL that looks pretty interesting: CREATE ASSEMBLY [AssemblyNameHere] FROM 0x4D5A90000300000004000000FFFF000......<continue binary data> WITH PERMISSION_SET = EXTERNAL_ACCESS Boy howdy! I have tried to reproduce this and create my own deployment application but I cant figure out how they create this binary stream. The info in BOL is not much help and I have not found any samples anywhere on how to create this stream in c#. Anyone out there been able to get this to work? -Ben
View Replies !
View Related
CREATE ASSEMBLY ERROR -- An Implicit Reference Of Some Kind ???
When I run this ... CREATE ASSEMBLY asmRANDRTCalendaringGateway FROM 'E:sqlRANDRTCalendaringGateway.dll' WITH PERMISSION_SET = UNSAFE I get this error ... Msg 10301, Level 16, State 1, Line 1 Assembly 'RANDRTCalendaringGateway' references assembly 'system.web, version=2.0.0.0, culture=neutral, publickeytoken=b03f5f7f11d50a3a.', which is not present in the current database. SQL Server attempted to locate and automatically load the referenced assembly from the same location where referring assembly came from, but that operation has failed (reason: 2(The system cannot find the file specified.)). Please load the referenced assembly into the current database and retry your request. Even though I do not explicity refer to system.web in the DLL's code ... using Microsoft.Win32; using System; using System.Data.Sql; using System.Data.SqlClient; using System.Collections.Generic; using System.Configuration; using System.Text; using log4net; using ADODB; using MAPI; using CDO; using System.Runtime.InteropServices; Is the problem just staring me in the face ? cheers
View Replies !
View Related
Calling A .Net Assembly From Script Component Giving Error
Hi, I am trying to access a .Net assembly in script component, which internally uses Microsoft Enterpise library dll's. The problem I am facing is when I copy the config sections needed for the Enterprise library from web.config to dtsdebughost.exe.config file and run the package, It ends in failure with below message "Error: The script files failed to load." My dtsdebughost.exe.config looks like below: Code Snippet <configuration> <startup> <requiredRuntime version="v2.0.50727"/> </startup> <configSections> <section name="loggingConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.LoggingSettings, Microsoft.Practices.EnterpriseLibrary.Logging, Version=3.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> <section name="exceptionHandling" type="Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Configuration.ExceptionHandlingSettings, Microsoft.Practices.EnterpriseLibrary.ExceptionHandling, Version=3.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> </configSections> <loggingConfiguration name="Logging Application Block" tracingEnabled="true" defaultCategory="" logWarningsWhenNoCategoriesMatch="true"> <listeners> <add fileName="LogMedtrack-Error.log" rollSizeKB="5000" timeStampPattern="dd-MMM-yyyy" rollFileExistsBehavior="Overwrite" rollInterval="Day" formatter="Default Formatter" header="----------------------------------------" footer="----------------------------------------" listenerDataType="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.RollingFlatFileTraceListenerData, Microsoft.Practices.EnterpriseLibrary.Logging, Version=3.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" traceOutputOptions="None" type="Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners.RollingFlatFileTraceListener, Microsoft.Practices.EnterpriseLibrary.Logging, Version=3.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" name="Rolling Flat File Trace Listener" /> </listeners> <formatters> <add template="Timestamp: {timestamp}
Message: {message}
Category: {category}
Priority: {priority}
EventId: {eventid}
Severity: {severity}
Title:{title}
Machine: {machine}
Application Domain: {appDomain}
Process Id: {processId}
Process Name: {processName}
Win32 Thread Id: {win32ThreadId}
Thread Name: {threadName}
Extended Properties: {dictionary({key} - {value}
)}" type="Microsoft.Practices.EnterpriseLibrary.Logging.Formatters.TextFormatter, Microsoft.Practices.EnterpriseLibrary.Logging, Version=3.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" name="Default Formatter" /> </formatters> <logFilters> <add categoryFilterMode="AllowAllExceptDenied" type="Microsoft.Practices.EnterpriseLibrary.Logging.Filters.CategoryFilter, Microsoft.Practices.EnterpriseLibrary.Logging, Version=3.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" name="Category Filter" /> <add minimumPriority="0" maximumPriority="2147483647" type="Microsoft.Practices.EnterpriseLibrary.Logging.Filters.PriorityFilter, Microsoft.Practices.EnterpriseLibrary.Logging, Version=3.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" name="Priority Filter" /> </logFilters> <categorySources> <add switchValue="All" name="Tracing"> <listeners> <add name="Rolling Flat File Trace Listener" /> </listeners> </add> </categorySources> <specialSources> <allEvents switchValue="All" name="All Events"> <listeners> <add name="Rolling Flat File Trace Listener" /> </listeners> </allEvents> <notProcessed switchValue="All" name="Unprocessed Category" /> <errors switchValue="All" name="Logging Errors & Warnings" /> </specialSources> </loggingConfiguration> <exceptionHandling> <exceptionPolicies> <add name="Business Policy"> <exceptionTypes> <add type="System.Exception, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" postHandlingAction="NotifyRethrow" name="Exception"> <exceptionHandlers> <add logCategory="Tracing" eventId="100" severity="Error" title="Agility Application Log." formatterType="Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.TextExceptionFormatter, Microsoft.Practices.EnterpriseLibrary.ExceptionHandling, Version=3.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" priority="0" type="Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Logging.LoggingExceptionHandler, Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Logging, Version=3.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" name="Logging Handler" /> </exceptionHandlers> </add> </exceptionTypes> </add> </exceptionPolicies> </exceptionHandling> </configuration> Please let me konw, If there is anything wrong I am doing or is there any other way to handle the situation Regards, Kalyan
View Replies !
View Related
Error While Merging Snapshot Containing A CLR Assembly Schema At The Subscriber
Hi , I urgently need a solution for this. I have configured merge replication between a webhoster and a local machine and it is working perfectly but when I am adding an article (table) which has a CLR assembly associated with it, the merge replication is failing saying it cannot apply the schema of the CLR assembly at the client. I think Microsoft supposedly says in it's documentation that merge replication supports CLR assemblies. I have recreated the snapshot after selecting the table (article) and I have reinitialised the subscription also but it is just not working. It is the simplest of replication with just one publisher and one subscriber. Thanks, Andy
View Replies !
View Related
Assembly MyAssembly Was Not Found In The SQL Catalog Of Database MyDB
I€™m trying to register my CLR UDF in SQL 2005 using this code CREATE FUNCTION GetSomething() RETURNS INT AS EXTERNAL NAME MyAssembly.MyFunction.MyMethod When I run it against my DB I get this error: Assembly MyAssembly was not found in the SQL catalog of database MyDB I€™ve successfully registered my custom assembly in the DB (I see it under Assemblies folder), and I€™ve set CRL Enabled to 1 in my DB. What am I doing wrong? Thanks in advance
View Replies !
View Related
Null Reference Error When Using A Custom Assembly That Uses An App.config File
I have a custom assembly that uses a config file to obtain database connection settings. This dll is then used by my sql report. I have added refrerenced to all the required dll's in my report and added the required code groups to all the necessary files. I have also placed my app.config file in C:Program FilesMicrosoft SQL ServerMSSQL.3Reporting ServicesReportServer and C:Program FilesMicrosoft Visual Studio 8Common7IDEPrivateAssemblies However when I actually run the report in the designer (vs2005) I am receiving Null reference exceptions when my code tries to read my config file because it is reading the machine.config file and not my app.config file. If I hard code my connection string everything works fine. Can anyone tell me why the machine.config file would be referenced instead of my app.config file and how I can stop it from doing this?
View Replies !
View Related
Install Error System.data.sqlserverce Not In Global Assembly Cache
I have built a small application in vs2005 (vb) using system.data.slqserverce building in the mobile sql engine into my app. I intend to run this on desktop. The app works fine on my development laptop machine, when i publish it (to a hard disk folder) and run it on another laptop, i get: 'unable to install or run the application. The application requires that assembly system.data.sqlserverce version 9.0.242.0 be installed in the Global Assembly Cache (GAC) first.' This is my first app in .net so not sure what this means. I thought all i had to do was reference the file (which i have done in the project) and VS would take care of stuff like this? Framework 2.0 is installed on the target machine. Hope im in the right forum for this! if not i apologise Any help most appreciated. Chris Anderson
View Replies !
View Related
Severe Error Occurring When Creating Assembly With External Access Permission
I had created a CLR function in my db and was able to execute it successfully a couple of months ago. But when I tried to execute it today it was throwing errors saying there was something wrong with the permissions on the assembly. So I decided to drop everything and recreate it except I can not longer create the assembly with EXTERNAL ACCESS permissions. Whenever I try to create the assembly I get the followng error: Msg 0, Level 11, State 0, Line 0 A severe error occurred on the current command. The results, if any, should be discarded. Msg 0, Level 20, State 0, Line 0 A severe error occurred on the current command. The results, if any, should be discarded. I also tried to create the assembly with Unsafe permissions and got the same error. Does anyone know why this error would be occurring now? I tried creating the same assembly on a different SQL 2005 server and it creates successfully and can be executed successfully. Any help would be greatly appreciated!! Thanks! GN
View Replies !
View Related
Error Attempting To PREVIEW In OLE DB Source Editor - Could Not Load File Or Assembly
Please... any ideas? Is this a footprint config issue? TITLE: Microsoft Visual Studio There was an error displaying the preview. ADDITIONAL INFORMATION: Could not load file or assembly 'Microsoft.SqlServer.SQLTaskConnectionsWrap, Version=9.3.242.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' or one of its dependencies. The system cannot find the file specified. (Microsoft.DataTransformationServices.Design) BUTTONS: OK =================================== There was an error displaying the preview. (Microsoft Visual Studio) =================================== Could not load file or assembly 'Microsoft.SqlServer.SQLTaskConnectionsWrap, Version=9.3.242.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' or one of its dependencies. The system cannot find the file specified. (Microsoft.DataTransformationServices.Design) ------------------------------ Program Location: at Microsoft.DataTransformationServices.Design.PipelineUtils.ShowDataPreview(String sqlStatement, ConnectionManager connectionManager, Control parentWindow, IServiceProvider serviceProvider, IDTSExternalMetadataColumnCollection90 externalColumns) at Microsoft.DataTransformationServices.DataFlowUI.DataFlowConnectionPage.previewButton_Click(Object sender, EventArgs e)
View Replies !
View Related
Can I Apply A Database Function Or Assembly Call In An Expression For Filter Data?
I need to translate a user€™s regional setting into one of our own language codes before I send it through as a filter to the model query. If our language codes were the same, the filter would look like this in the report filter - Language Code = GetUserCulture() Which translates to this in the database query (for us english) - table.language_code = 'EN-us' And of course I need it to look like this - table.language_code = 'ENG' I would like the logic to be globally available to all report writers (ie not forcing each report writer to have an iif or case stataement). I was thinking custom assemblies or maybe a database function, but at this level of the filter, I cannot seem to figure out how to embed a database function call to apply to the filter criteria like this Language Code = dbo.ConvertFcnIWrote(GetUserCulture()) Or how I would access the custom assembly in the filter expression. Do you have a recommended implementation for this situation? Thanks, Toni Fielder
View Replies !
View Related
Calling VB Based SQLCLR Function Failed With Error Can't Load System.Web Assembly
I created a CLR function based on following VB code: Imports Microsoft.SqlServer.Server Public Partial Class SqlClrVB <Microsoft.SqlServer.Server.SqlFunction()> _ Public Shared Function GetTotalPhysicalMemory() As Integer GetTotalPhysicalMemory = My.Computer.Info.TotalPhysicalMemory End Function End Class The VB code was complied into a DLL called totalmem.dll and call following TSQL to map it into a SQL function: create assembly totalmem from '!WORKINGDIR! otalmem.dll' WITH PERMISSION_SET=UNSAFE go create function fnGetTotalMem() returns int as external name totalmem.SqlClrVB.GetTotalPhysicalMemory go When I call this function, it returned following error: select dbo.fnGetTotalMem() Msg 6522, Level 16, State 2, Line 0 A .NET Framework error occurred during execution of user defined routine or aggregate 'fnGetTotalMem': System.IO.FileNotFoundException: Could not load file or assembly 'System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified. System.IO.FileNotFoundException: at Microsoft.VisualBasic.MyServices.Internal.ContextValue`1.get_Value() at My.MyProject.ThreadSafeObjectProvider`1.get_GetInstance() at SqlClrVB.GetTotalPhysicalMemory() . Anyone knows why I'm hitting this error? I didn't reference any System.Web interface why it needs to load System.Web assembly? The same code runs OK if I compile it as a separate VB application out side of SQL Server 2005. Thanks much, Zhiqiang
View Replies !
View Related
.NET Permissions Error In Reporting Services When Not Using A Custom Assembly (Smiley Faces Are Not Under My Control)
.NET Permissions Error in Reporting Services when not using a custom assembly: I need help resolving a permissions error I€™m taking in a SQL RS 2005 report. I have a report that that is includes the following code fragment in Report Properties -> Code: Function rtf2text(ByVal rtf As String) As String Dim rtfcontrol As New System.Windows.Forms.RichTextBox Try rtfcontrol.Rtf = rtf Return rtfcontrol.Text Catch ex as Exception Return ex.Message End Try End Function I reference the .NET System.Windows.Forms DLL under Report Properties -> References -> References, Assembly Name (heading): System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 I have a text box with the following expression: =code.rtf2text(First(Fields!EndingQuoteComment.Value, "QuoteHeader")) And I€™ve verified, by removing the code.rtf2text command that is populated with the following: { tf1ansiansicpg1252deff0deflang1033{fonttbl{f0fromanfprq2fcharset0 Times New Roman;}{f1fnilfcharset0 Arial;}} viewkind4uc1pardif0fs32 ** Ending Quote Comments **par 0i0f1fs17par } When I run the preview in Visual Studio is correctly strips the RTF and displays just €œ** Ending Quote Comments **€?. When I €˜RUN€™ locally or deploy to a SQL RS 2005 Server and run the report I take the following error: Request for the permission of type 'System.Security.Permissions.UIPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed. I€™ve tried everything that I can think of on the server to make this work. I finally put together a Win 2003 box with SQL 2005, IIS, and RS 2005 running on it in a virtual machine to be 100% sure I had a standard clean install and deployed the report and I€™m getting the same error. Below I€™ve included a basic standalone RDL file that demonstrates my issue. I get the error referenced above when I deploy the RDL below. Any ideas or suggestions are greatly appreciated? <?xml version="1.0" encoding="utf-8"?> <Report xmlns="http://schemas.microsoft.com/sqlserver/reporting/2005/01/reportdefinition" xmlns:rd="http://schemas.microsoft.com/SQLServer/reporting/reportdesigner"> <BottomMargin>0.25in</BottomMargin> <RightMargin>0.25in</RightMargin> <PageWidth>7.75in</PageWidth> <rdrawGrid>true</rdrawGrid> <InteractiveWidth>7.75in</InteractiveWidth> <rdnapToGrid>true</rdnapToGrid> <Body> <ReportItems> <Textbox Name="textbox21"> <Left>0.25in</Left> <Top>0.25in</Top> <rdefaultName>textbox21</rdefaultName> <Width>6.375in</Width> <Style> <PaddingLeft>2pt</PaddingLeft> <PaddingBottom>2pt</PaddingBottom> <FontSize>7.5pt</FontSize> <PaddingRight>2pt</PaddingRight> <PaddingTop>2pt</PaddingTop> </Style> <CanGrow>true</CanGrow> <Height>1.375in</Height> <Value>=code.rtf2text("{ tf1ansiansicpg1252deff0deflang1033{fonttbl{f0fromanfprq2fcharset0 Times New Roman;}{f1fnilfcharset0 Arial;}} viewkind4uc1pardif0fs32 ** Ending Quote Comments **par 0i0f1fs17par } ")</Value> </Textbox> </ReportItems> <Height>5.25in</Height> </Body> <rd:ReportID>8804486c-882f-493c-8dfb-b2f778a24b21</rd:ReportID> <LeftMargin>0.25in</LeftMargin> <CodeModules> <CodeModule>System.Windows.Forms, Version=2.0.50727.42, Culture=neutral, PublicKeyToken=b77a5c561934e089</CodeModule> </CodeModules> <Code>Function rtf2text(ByVal rtf As String) As String Dim rtfcontrol As New System.Windows.Forms.RichTextBox Try rtfcontrol.Rtf = rtf Return rtfcontrol.Text Catch ex as Exception Return ex.Message End Try End Function </Code> <Width>7.25in</Width> <InteractiveHeight>10in</InteractiveHeight> <Language>en-US</Language> <TopMargin>0.25in</TopMargin> <PageHeight>10in</PageHeight> </Report>
View Replies !
View Related
.net Security Assembly Returns Results Of An MDX Query To A Report Viewed In Report Manager - EnvironmentPermissions Error
Hi, I've got a Security assembly implemented in .net 2.0, which returns the results of an MDX query to a report viewed in Report Manager. This is the error: Request for the permission of type 'System.Security.Permissions.EnvironmentPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed If I cut out the code that asserts the need for unlimited FileIOPermissions, then the error changes to: Unable to retrieve security descriptor for this frame So I can't get away with just asserting less permissions. I assume that this is something to do with using MDX in this way. Clearly the permissions on the assembly are inadequate, so I tried updating the rssrvpolicy.config file: <configuration> <mscorlib> <security> <policy> <PolicyLevel version="1"> <SecurityClasses> <SecurityClass Name="AllMembershipCondition" Description="System.Security.Policy.AllMembershipCondition, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/> <SecurityClass Name="AspNetHostingPermission" Description="System.Web.AspNetHostingPermission, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/> <SecurityClass Name="DnsPermission" Description="System.Net.DnsPermission, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/> <SecurityClass Name="EnvironmentPermission" Description="System.Security.Permissions.EnvironmentPermission, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/> <SecurityClass Name="FileIOPermission" Description="System.Security.Permissions.FileIOPermission, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/> <SecurityClass Name="FirstMatchCodeGroup" Description="System.Security.Policy.FirstMatchCodeGroup, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/> <SecurityClass Name="IsolatedStorageFilePermission" Description="System.Security.Permissions.IsolatedStorageFilePermission, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/> <SecurityClass Name="NamedPermissionSet" Description="System.Security.NamedPermissionSet"/> <SecurityClass Name="PrintingPermission" Description="System.Drawing.Printing.PrintingPermission, System.Drawing, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/> <SecurityClass Name="ReflectionPermission" Description="System.Security.Permissions.ReflectionPermission, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/> <SecurityClass Name="RegistryPermission" Description="System.Security.Permissions.RegistryPermission, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/> <SecurityClass Name="SecurityPermission" Description="System.Security.Permissions.SecurityPermission, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/> <SecurityClass Name="SocketPermission" Description="System.Net.SocketPermission, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/> <SecurityClass Name="SqlClientPermission" Description="System.Data.SqlClient.SqlClientPermission, System.Data, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/> <SecurityClass Name="StrongNameMembershipCondition" Description="System.Security.Policy.StrongNameMembershipCondition, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/> <SecurityClass Name="UnionCodeGroup" Description="System.Security.Policy.UnionCodeGroup, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/> <SecurityClass Name="UrlMembershipCondition" Description="System.Security.Policy.UrlMembershipCondition, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/> <SecurityClass Name="WebPermission" Description="System.Net.WebPermission, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/> <SecurityClass Name="ZoneMembershipCondition" Description="System.Security.Policy.ZoneMembershipCondition, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/> </SecurityClasses> <NamedPermissionSets> <PermissionSet class="NamedPermissionSet" version="1" Unrestricted="true" Name="FullTrust" Description="Allows full access to all resources" /> <PermissionSet class="NamedPermissionSet" version="1" Name="Nothing" Description="Denies all resources, including the right to execute" /> <PermissionSet class="NamedPermissionSet" version="1" Name="Execution"> <IPermission class="SecurityPermission" version="1" Flags="Execution" /> </PermissionSet> <PermissionSet class="DirectoryServicesPermissionSet" version="1" Name="DSPermissionSet" Description="A special permission set that grants browse access to DirectoryServices"> <IPermission class="DirectoryServicesPermission" version="1" Browse=""/> <IPermission class="SecurityPermission" version="1" Flags="Assertion, Execution"/> </PermissionSet> </NamedPermissionSets> <CodeGroup class="FirstMatchCodeGroup" version="1" PermissionSetName="Nothing"> <IMembershipCondition class="AllMembershipCondition" version="1" /> <CodeGroup class="UnionCodeGroup" version="1" PermissionSetName="Execution" Name="Report_Expressions_Default_Permissions" Description="This code group grants default permissions for code in report expressions and Code element. "> <IMembershipCondition class="StrongNameMembershipCondition" version="1" PublicKeyBlob="0024000004800000940000000602000000240000525341310004000001000100512C8E872E28569E733BCB123794DAB55111A0570B3B3D4DE3794153DEA5EFB7C3FEA9F2D8236CFF320C4FD0EAD5F677880BF6C181F296C751C5F6E65B04D3834C02F792FEE0FE452915D44AFE74A0C27E0D8E4B8D04EC52A8E281E01FF47E7D694E6C7275A09AFCBFD8CC82705A06B20FD6EF61EBBA6873E29C8C0F2CAEDDA2" /> </CodeGroup> <CodeGroup class="FirstMatchCodeGroup" version="1" PermissionSetName="Execution" Description="This code group grants MyComputer code Execution permission. "> <IMembershipCondition class="ZoneMembershipCondition" version="1" Zone="MyComputer" /> <CodeGroup class="UnionCodeGroup" version="1" PermissionSetName="FullTrust" Name="Microsoft_Strong_Name" Description="This code group grants code signed with the Microsoft strong name full trust. "> <IMembershipCondition class="StrongNameMembershipCondition" version="1" PublicKeyBlob="002400000480000094000000060200000024000052534131000400000100010007D1FA57C4AED9F0A32E84AA0FAEFD0DE9E8FD6AEC8F87FB03766C834C99921EB23BE79AD9D5DCC1DD9AD236132102900B723CF980957FC4E177108FC607774F29E8320E92EA05ECE4E821C0A5EFE8F1645C4C0C93C1AB99285D622CAA652C1DFAD63D745D6F2DE5F17E5EAF0FC4963D261C8A12436518206DC093344D5AD293" /> </CodeGroup> <CodeGroup class="UnionCodeGroup" version="1" PermissionSetName="FullTrust" Name="Ecma_Strong_Name" Description="This code group grants code signed with the ECMA strong name full trust. "> <IMembershipCondition class="StrongNameMembershipCondition" version="1" PublicKeyBlob="00000000000000000400000000000000" /> </CodeGroup> <CodeGroup class="UnionCodeGroup" version="1" PermissionSetName="FullTrust" Name="Report_Server_Strong_Name" Description="This code group grants Report Server code full trust. "> <IMembershipCondition class="StrongNameMembershipCondition" version="1" PublicKeyBlob="0024000004800000940000000602000000240000525341310004000001000100272736AD6E5F9586BAC2D531EABC3ACC666C2F8EC879FA94F8F7B0327D2FF2ED523448F83C3D5C5DD2DFC7BC99C5286B2C125117BF5CBE242B9D41750732B2BDFFE649C6EFB8E5526D526FDD130095ECDB7BF210809C6CDAD8824FAA9AC0310AC3CBA2AA0523567B2DFA7FE250B30FACBD62D4EC99B94AC47C7D3B28F1F6E4C8" /> </CodeGroup> <CodeGroup class="UnionCodeGroup" version="1" PermissionSetName="FullTrust"> <IMembershipCondition class="UrlMembershipCondition" version="1" Url="$CodeGen$/*" /> </CodeGroup> <CodeGroup class="UnionCodeGroup" version="1" PermissionSetName="FullTrust" Name="SharePoint_Server_Strong_Name" Description="This code group grants SharePoint Server code full trust. "> <IMembershipCondition class="StrongNameMembershipCondition" version="1" PublicKeyBlob="0024000004800000940000000602000000240000525341310004000001000100AFD4A0E7724151D5DD52CB23A30DED7C0091CC01CFE94B2BCD85B3F4EEE3C4D8F6417BFF763763A996D6B2DFC1E7C29BCFB8299779DF8785CDE2C168CEEE480E570725F2468E782A9C2401302CF6DC17E119118ED2011937BAE9698357AD21E8B6DFB40475D16E87EB03C744A5D32899A0DBC596A6B2CFA1E509BE5FBD09FACF" /> </CodeGroup> <CodeGroup class="UnionCodeGroup" version="1" PermissionSetName="FullTrust" Name="MyCompany.MIS.Security" Description="A special code group for my custom assembly."> <IMembershipCondition class="StrongNameMembershipCondition" version="1" PublicKeyBlob="00240000048000009400000006020000002400005253413100040000010001003F099786BD0BDCD36FF941A6EC9E6612103F15D0D34DF124FF4792C237EF88E88C23C3BAD09A57FAD1C3364003C4C27E7EFA206520286982563134566247AFCFFFDCA1B91B9AA0EBAEA81F20A3BB6769037D882DFB38F9D7FFE2F19B8975C18CED382BC2BB911C7D4B8484B39EE3AC651530A1DDD21DCE50A24EEED613CF8DBA" Name="MyCompany.MIS.Security" AssemblyVersion="3.0.0.4"/> </CodeGroup> </CodeGroup> </PolicyLevel> </policy> </security> </mscorlib> </configuration> I've added 'Full Trust' to my specific assembly. The new clause there was generated using caspol.exe so I think it should be correct. However, this made no difference at all to the error! However, if I upgrade Report_Expressions_Default_Permissions (see above) to Full Trust, the problem is 'solved'. Unfortunately giving Full Trust to any and all Report Expressions is not an option. Can anyone help? Dr. Bunsen
View Replies !
View Related
Assembly.Load Can't Load My Custom Assembly From The GAC.
Hi there. I have an assembly, call it A1, that I've deployed to a SQL Server 2005 database. I can use the managed stored procedures from A1 in SQL Server no problem. In A1 there is a bit of code which uses the Assembly.Load() method, so load another assembly and use instances of class found in that external assembly. However, when I run the managed stored proc in A1 that uses Assembly.Load() I get the error: Could not load file or assembly 'A1, Version=1.0.0.0, Culture=neutral,PublicKeyToken='????' or one of its dependencies. The system cannot find the file specified. (note: for security I've changed some of the above line). So I changed the Assembly.Load() to use System.Data,Version=2.0.0.0,Culture=neutral,PublicKeyToken=b77a5c561934e089 I re-built the project, re-deployed it and ran the code in SQL Server - it worked. I could create an instance of a System.Data.DataSet for example. So why can't I load my own custom assembly? My assembly does have a strong name and it's installed in the GAC. I wrote a console app to try and Assembly.Load() my custom assembly and that worked fine (it was also running on the same server as the SQL Server). So it's defiantely the SQL Server that can't 'see' my customer assembly. What do I need to do this assembly so that SQL Server will allow me to Assembly.Load it, just as it can with System.Data? Thanks Jas.
View Replies !
View Related
SQL CLR Assembly Update
Hi, I had recently created an SP that references a .NET assembly. This worked fine and is all OK.CREATE ASSEMBLY [MY_SQLCLR_ASSEMBLY] FROM 'E:CLRIMY_SQLCLR_ASSEMBLY.dll'GOCREATE PROCEDURE dbo.SQLCLR_SP_ONE( @Param nvarchar(1024))AS EXTERNAL NAME MY_SQLCLR_ASSEMBLY.[MY_NAMESPACE.MY_CLASS].My_MethodGO I have now extended the functionality of this .NET assembly and wish to create another SP to reference the new method in the assembly. Firstly I tried to do this: CREATE PROCEDURE dbo.SQLCLR_SP_TWO ( @Param nvarchar(1024) ) AS EXTERNAL NAME MY_SQLCLR_ASSEMBLY.[MY_NAMESPACE.MY_CLASS].My_NEW_Method GOBut I got this error message: "Could not find method 'My_NEW_Method' for type 'MY_NAMESPACE.MY_CLASS' in assembly 'MY_SQLCLR_ASSEMBLY'"Fair enough, So I then attempted to drop the current Assembly and Re-create it as below: IF EXISTS(SELECT name FROM sys.assemblies WHERE name = 'MY_SQLCLR_ASSEMBLY') DROP ASSEMBLY [MY_SQLCLR_ASSEMBLY];GOCREATE ASSEMBLY [MY_SQLCLR_ASSEMBLY] FROM 'E:CLRIMY_SQLCLR_ASSEMBLY.dll'GOBut I get this error:DROP ASSEMBLY failed because 'MY_SQLCLR_ASSEMBLY' is referenced by object 'dbo.SQLCLR_SP_ONE'. Also fair enough - but does this mean that any change I make to the .NET assembly, I would have to...drop every SP (that references the assembly),then drop the assembly, then re-create the assembly, then re-create each SP(that references the assembly)? This seems to be a bit of a pain... Is there not a better way to do this?? Any answers gratefully recieved.Devaliew
View Replies !
View Related
SQL 2005 && CLR Assembly
Hi. One of my databases has an assembly that uses system.web. Therefore, in the deploy script, the developer has put in a create assembly for it like so Create Assembly [System.Web] FROM 'C:WINDOWSMicrosoft.NETFrameworkv2.0.50727System.Web.dll' WITH PERMISSION_SET = UNSAFE followed by the create assembly statements for the actual bespoke assemblies. The deploy script all works fine, as do the assemblies it creates. However, when SQL restarts, the calls to the assemblies no longer work, and the only way to get them to is to run the deploy script (which drops them if they exist and recreates them) again. Not particularly familiar with 2005 & CLR. Is this normal behaviour (I would have expected that once deployed, they were there after re-boot). If it's not how things are supposed to work, what's wrong, and how do I fix it? Thanks
View Replies !
View Related
|