Unable To Load An Assembly With Permission Set = EXTERNAL ACCESS

Jul 20, 2007

Hi



I've loaded a C# assembly into my database with External Access (the dll contains a routine

that accesses Environment.MachineName).



I am now unable to invoke any of the entry points in this assembly. I get the error message



'An error occured trying to load assembly Id XYZ. System.IO.FileLoadException.....'



I have set the database Trustworthy flag to ON and the assembly does not have a strong name.



Can anyone tell me what I've done wrong?



Thanks

Steve



P.S. I am calling the assembly from SQL code residing in a different database than the one

the assembly has been loaded into.

View 3 Replies


ADVERTISEMENT

Severe Error Occurring When Creating Assembly With External Access Permission

Jul 11, 2006

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 3 Replies View Related

Could Not Load File Or Assembly Microsoft.ReportingServices.ProcessingCore Or One Of Its Dependencies. Access Is Denied.

Mar 15, 2007


My reporting server 2005 frequently throws error below.
The PC hosting reporting server has .net framework 1.1 and 2.0 installed, and it does not have SQL server installed. The 2 databases used by reporting server are in another PC.
Please help.
w3wp!webserver!1!3/14/2007-07:01:35:: i INFO: Reporting Web Server started
w3wp!library!1!3/14/2007-07:01:35:: i INFO: Initializing ConnectionType to '0' as specified in Configuration file.
w3wp!library!1!3/14/2007-07:01:35:: i INFO: Initializing IsSchedulingService to 'True' as specified in Configuration file.
w3wp!library!1!3/14/2007-07:01:35:: i INFO: Initializing IsNotificationService to 'True' as specified in Configuration file.
w3wp!library!1!3/14/2007-07:01:35:: i INFO: Initializing IsEventService to 'True' as specified in Configuration file.
w3wp!library!1!3/14/2007-07:01:35:: i INFO: Initializing PollingInterval to '10' second(s) as specified in Configuration file.
w3wp!library!1!3/14/2007-07:01:35:: i INFO: Initializing WindowsServiceUseFileShareStorage to 'False' as specified in Configuration file.
w3wp!library!1!3/14/2007-07:01:35:: i INFO: Initializing MemoryLimit to '60' percent as specified in Configuration file.
w3wp!library!1!3/14/2007-07:01:35:: i INFO: Initializing RecycleTime to '720' minute(s) as specified in Configuration file.
w3wp!library!1!3/14/2007-07:01:35:: i INFO: Initializing MaximumMemoryLimit to '80' percent as specified in Configuration file.
w3wp!library!1!3/14/2007-07:01:35:: i INFO: Initializing MaxAppDomainUnloadTime to '30' minute(s) as specified in Configuration file.
w3wp!library!1!3/14/2007-07:01:35:: i INFO: Initializing MaxQueueThreads to '0' thread(s) as specified in Configuration file.
w3wp!library!1!3/14/2007-07:01:35:: i INFO: Initializing IsWebServiceEnabled to 'True' as specified in Configuration file.
w3wp!library!1!3/14/2007-07:01:35:: i INFO: Initializing MaxActiveReqForOneUser to '20' requests(s) as specified in Configuration file.
w3wp!library!1!3/14/2007-07:01:35:: i INFO: Initializing MaxScheduleWait to '5' second(s) as specified in Configuration file.
w3wp!library!1!3/14/2007-07:01:35:: i INFO: Initializing DatabaseQueryTimeout to '120' second(s) as specified in Configuration file.
w3wp!library!1!3/14/2007-07:01:35:: i INFO: Initializing ProcessRecycleOptions to '0' as specified in Configuration file.
w3wp!library!1!3/14/2007-07:01:35:: i INFO: Initializing RunningRequestsScavengerCycle to '60' second(s) as specified in Configuration file.
w3wp!library!1!3/14/2007-07:01:35:: i INFO: Initializing RunningRequestsDbCycle to '60' second(s) as specified in Configuration file.
w3wp!library!1!3/14/2007-07:01:35:: i INFO: Initializing RunningRequestsAge to '30' second(s) as specified in Configuration file.
w3wp!library!1!3/14/2007-07:01:35:: i INFO: Initializing CleanupCycleMinutes to '10' minute(s) as specified in Configuration file.
w3wp!library!1!3/14/2007-07:01:35:: i INFO: Initializing DailyCleanupMinuteOfDay to default value of '120' minutes since midnight because it was not specified in Configuration file.
w3wp!library!1!3/14/2007-07:01:35:: i INFO: Initializing WatsonFlags to '1064' as specified in Configuration file.
w3wp!library!1!3/14/2007-07:01:35:: i INFO: Initializing WatsonDumpOnExceptions to 'Microsoft.ReportingServices.Diagnostics.Utilities.InternalCatalogException,Microsoft.ReportingServices.Modeling.InternalModelingException' as specified in Configuration file.
w3wp!library!1!3/14/2007-07:01:35:: i INFO: Initializing WatsonDumpExcludeIfContainsExceptions to 'System.Data.SqlClient.SqlException,System.Threading.ThreadAbortException' as specified in Configuration file.
w3wp!library!1!3/14/2007-07:01:35:: i INFO: Initializing SecureConnectionLevel to '0' as specified in Configuration file.
w3wp!library!1!3/14/2007-07:01:35:: i INFO: Initializing DisplayErrorLink to 'True' as specified in Configuration file.
w3wp!library!1!3/14/2007-07:01:35:: i INFO: Initializing WebServiceUseFileShareStorage to 'False' as specified in Configuration file.
w3wp!resourceutilities!1!3/14/2007-07:01:35:: i INFO: Reporting Services starting SKU: Standard
w3wp!resourceutilities!1!3/14/2007-07:01:35:: i INFO: Evaluation copy: 0 days left
w3wp!resourceutilities!1!3/14/2007-07:01:35:: i INFO: Running on 2 physical processors, 4 logical processors
w3wp!runningjobs!1!3/14/2007-07:01:35:: i INFO: Database Cleanup (Web Service) timer enabled: Next Event: 600 seconds. Cycle: 600 seconds
w3wp!runningjobs!1!3/14/2007-07:01:35:: i INFO: Running Requests Scavenger timer enabled: Next Event: 60 seconds. Cycle: 60 seconds
w3wp!runningjobs!1!3/14/2007-07:01:35:: i INFO: Running Requests DB timer enabled: Next Event: 60 seconds. Cycle: 60 seconds
w3wp!runningjobs!1!3/14/2007-07:01:35:: i INFO: Memory stats update timer enabled: Next Event: 60 seconds. Cycle: 60 seconds
w3wp!library!1!03/14/2007-07:01:35:: i INFO: Catalog SQL Server Edition = Standard
w3wp!library!1!3/14/2007-07:01:36:: e ERROR: Throwing Microsoft.ReportingServices.Diagnostics.Utilities.InternalCatalogException: An internal error occurred on the report server. See the error log for more details., ;
Info: Microsoft.ReportingServices.Diagnostics.Utilities.InternalCatalogException: An internal error occurred on the report server. See the error log for more details. ---> System.IO.FileLoadException: Could not load file or assembly 'Microsoft.ReportingServices.ProcessingCore, Version=9.0.242.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' or one of its dependencies. Access is denied.
File name: 'Microsoft.ReportingServices.ProcessingCore, Version=9.0.242.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91'
at Microsoft.ReportingServices.Library.CreateNewSessionAction.Save()
at Microsoft.ReportingServices.WebServer.ReportExecutionService.LoadReport(String Report, String HistoryID, ExecutionInfo& executionInfo)
at Microsoft.Reporting.WebForms.ServerReport.GetExecutionInfo()
at Microsoft.Reporting.WebForms.ServerReport.SetParameters(NameValueCollection parameters)
at Microsoft.ReportingServices.WebServer.ReportViewerHost.OnLoad(EventArgs e)



WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLMSoftwareMicrosoftFusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLMSoftwareMicrosoftFusion!EnableLog].

--- End of inner exception stack trace ---
w3wp!library!1!3/14/2007-07:01:36:: i INFO: Exception dumped to: C:Program FilesMicrosoft SQL ServerMSSQL.1Reporting ServicesLogFiles flags= ReferencedMemory, AllThreads, SendToWatson
w3wp!library!a!3/14/2007-07:11:35:: i INFO: Cleaned 0 batch records, 0 policies, 0 sessions, 0 cache entries, 0 snapshots, 0 chunks, 0 running jobs, 0 persisted streams
w3wp!library!9!3/14/2007-07:21:35:: i INFO: Cleaned 0 batch records, 0 policies, 0 sessions, 0 cache entries, 0 snapshots, 0 chunks, 0 running jobs, 0 persisted streams
w3wp!library!1!3/14/2007-07:31:35:: i INFO: Cleaned 0 batch records, 0 policies, 0 sessions, 0 cache entries, 0 snapshots, 0 chunks, 0 running jobs, 0 persisted streams
w3wp!library!8!3/14/2007-07:33:55:: e ERROR: Throwing Microsoft.ReportingServices.Diagnostics.Utilities.InternalCatalogException: An internal error occurred on the report server. See the error log for more details., ;
Info: Microsoft.ReportingServices.Diagnostics.Utilities.InternalCatalogException: An internal error occurred on the report server. See the error log for more details. ---> System.IO.FileLoadException: Could not load file or assembly 'Microsoft.ReportingServices.ProcessingCore, Version=9.0.242.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' or one of its dependencies. Access is denied.
File name: 'Microsoft.ReportingServices.ProcessingCore, Version=9.0.242.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91'
at Microsoft.ReportingServices.Library.CreateNewSessionAction.Save()
at Microsoft.ReportingServices.WebServer.ReportExecutionService.LoadReport(String Report, String HistoryID, ExecutionInfo& executionInfo)
at Microsoft.Reporting.WebForms.ServerReport.GetExecutionInfo()
at Microsoft.Reporting.WebForms.ServerReport.SetParameters(NameValueCollection parameters)
at Microsoft.ReportingServices.WebServer.ReportViewerHost.OnLoad(EventArgs e)

WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLMSoftwareMicrosoftFusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLMSoftwareMicrosoftFusion!EnableLog].

--- End of inner exception stack trace ---
w3wp!library!8!3/14/2007-07:34:25:: i INFO: Exception dumped to: C:Program FilesMicrosoft SQL ServerMSSQL.1Reporting ServicesLogFiles flags= ReferencedMemory, AllThreads, SendToWatson
w3wp!library!1!3/14/2007-07:41:35:: i INFO: Cleaned 0 batch records, 0 policies, 0 sessions, 0 cache entries, 0 snapshots, 0 chunks, 0 running jobs, 0 persisted streams
w3wp!library!a!3/14/2007-07:42:44:: e ERROR: Throwing Microsoft.ReportingServices.Diagnostics.Utilities.InternalCatalogException: An internal error occurred on the report server. See the error log for more details., ;
Info: Microsoft.ReportingServices.Diagnostics.Utilities.InternalCatalogException: An internal error occurred on the report server. See the error log for more details. ---> System.IO.FileLoadException: Could not load file or assembly 'Microsoft.ReportingServices.ProcessingCore, Version=9.0.242.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' or one of its dependencies. Access is denied.
File name: 'Microsoft.ReportingServices.ProcessingCore, Version=9.0.242.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91'
at Microsoft.ReportingServices.Library.CreateNewSessionAction.Save()
at Microsoft.ReportingServices.WebServer.ReportExecutionService.LoadReport(String Report, String HistoryID, ExecutionInfo& executionInfo)
at Microsoft.Reporting.WebForms.ServerReport.GetExecutionInfo()
at Microsoft.Reporting.WebForms.ServerReport.SetParameters(NameValueCollection parameters)
at Microsoft.ReportingServices.WebServer.ReportViewerHost.OnLoad(EventArgs e)

WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLMSoftwareMicrosoftFusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLMSoftwareMicrosoftFusion!EnableLog].

--- End of inner exception stack trace ---

View 6 Replies View Related

Failed To Load Expression Host Assembly. Details: StrongName Cannot Have An Empty String For The Assembly Name.

Jan 12, 2006

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 7 Replies View Related

Assembly.Load Can't Load My Custom Assembly From The GAC.

Mar 7, 2007

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 1 Replies View Related

Problem In Registering External Dll Using Create Assembly

Aug 18, 2005

Hi,

View 12 Replies View Related

Transact SQL :: Getting Data From External Assembly Into Temp Table Inside Stored Procedure

Oct 8, 2015

I have a Custom .net assembly which retrieves some data, basically just a set of data containing, ID, value,

I need my stored procedure to return this data as a table.

My question what/how is fastest way to do this, my assembly can return anything you want, a datatable, a hashtable, list of(class) etc..

View 3 Replies View Related

Reporting Services :: External Assembly Reference Same DB Data Source As Calling Report?

Aug 25, 2015

I have a SSRS 2012 report which references a custom c# assembly.   This report exists in multiple environments (alpha, beta and  production ) which are each associated with different data sources.

Is there a way for the assembly to determine the datasource used by the calling report so it can also connect to it?

View 2 Replies View Related

ALTER ASSEMBLY Needs Special Permission

Feb 20, 2008

Hello again,

I get an error message every time I want to alter an assembly in the Management Studio. The message goes something like this:

"An error occurred in the Microsoft .NET Framework while trying to load assembly id 65610. The server may be running out of resources, or the assembly may not be trusted with PERMISSION_SET = EXTERNAL_ACCESS or UNSAFE. Run the query again, or check documentation to see how to solve the assembly trust issues."
I've already found this article on Microsoft support which mentions two possible workarounds. Could you possibly explain me, how do they work? I've tried both methods by 'registering' my windows login, with and without the domain, but none of them seemed to work. I've also set the TRUSTWORTHY property before using these workarounds.

So, do you have any ideas what could possibly went wrong? Thanks in advance for your time and help!

View 8 Replies View Related

Can't Deploy Unsafe Assembly, Permission Problem(?)

Sep 19, 2007

Hello,

I think I have some kind of permission problem. But first things first:

I have code which I would like to run in SQL Server (CLR Integration). First thing is that my code uses third-party-dll. I have to deploy my code as unsafe because of

"

CREATE ASSEMBLY failed because method "add_FunctionAdd" on type "USP.Express.Pro.FunctionsCollection" in safe assembly "USP.Express.Pro.2.0" has a synchronized attribute. Explicit synchronization is not allowed in safe assemblies.
"

Of course I can not create "asymmetric key" for third-party-dll (Or can I?).


So, I tried to use trustworthy DB. But I get all the time error Msg 10327: "Assembly is not authorised for PERMISSION_SET=UNSAFE"

I am using Windows Login to log on Sql Server. Login is granted "Unsafe assembly" and DB has trustworthy setting "on".

Login has server roles "sysadmin" and "securityadmin".
Login is mapped with DB User who has same name ( DOMAINUserName ) and has default schema "dbo".
Login has DB memberships "db_owner" and "db_securityadmin".
DB user owns schemas "db_owner" and "db_securityadmin".

Am I missing something?

Interesting thing is that I can do deployment (as unsafe assembly) in master-database. But not in the other databases.

Questions are:
- Is there other way to authorise third-party-dll than using trustworthy?
- Why deployment can be done in master-database?

And finally:
- Why deployment can not be done in other database?

View 9 Replies View Related

Could Not Load File Or Assembly

Jul 14, 2015

I try backup database but this error message pop up: could not load file or assembly 'SqlManagerUi, Culture=neutral, PublicKeyToken= 89845dcd 8080cc91' oe one of its dependencies. Method signature has invalid calling convention. (Exception from HRESULT: 0x80131239)(mscorlib)

View 2 Replies View Related

Could Not Load File Or Assembly

Feb 27, 2006

I am receiving the following message when I try to create an SSIS project in Visual Studio 2005 Team Suite:

Could not load file or assembly "Microsoft.AnalysisServices.Controls" Version=9.0.242.0, Culture=neutral, Public Key Token = 89845dcd8080cc91 or one of it's dependencies. Strong name validation failed (Exception from HRESULT: 0x8013141A)

Thank you

Larry Geiger

View 4 Replies View Related

Could Not Load File Or Assembly

Mar 26, 2008



I have downloaded the project from http://mattberseth.com/blog/2007/10/theming_the_ajaxcontroltoolkit.html.
When i built and run athe application i get the error

Could not load file or assembly 'System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified. C:Documents and SettingsJingaMy DocumentsVisual Studio 2005Projectscalendar_themeweb.config 30

Line 30 in web.config

<add assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>


How do i solve this.

Thanks.
JInga

View 1 Replies View Related

Could Not Load System.EnterpriseServices Assembly

Nov 1, 2007

Guys, this the first time I got this message

TITLE: Connection Manager
------------------------------
Test connection failed because of an error in initializing provider. Could not load file or assembly 'System.EnterpriseServices.Wrapper.dll' or one of its dependencies. The system cannot find the file specified.

This happens whenever I press "Test Connection" button in the Connection Manager dialog. I'm wondering if this has something to do with the installation of the .NET Framework. I'm using a new machine and so far I havent had any problem with .NET applications. Do I need to add this assembly somewhere?

View 1 Replies View Related

Could Not Load File Or Assembly 'ReportingServicesWebServer'

Dec 19, 2007



Hi,

My report runs from the Report Manager, but when I try to run it from the ReportServer, thats when I get this message.

Any help on how to fix it?

Thanks.

Ekjon

View 3 Replies View Related

Analysis :: Could Not Load File Or Assembly

Oct 20, 2015

I have deployed an MVC web app/SSAS database to our PROD machine and receive the following error:

Could not load file or assembly 'Microsoft. Analysis Services.AdomdClient, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' or one of its dependencies.

The system cannot find the file specified. The OLAP database has been processed and contains data. Also, the MVC app contains a reference to Microsoft. AnalysisServices. AdomdClient.

I have also tried installing the SQL_AS_ADOMD.msi from: URL....

View 6 Replies View Related

Could Not Load File Or Assembly SQLXMLBULKLOADLib

May 30, 2006

Greetings,

I'm in the process of migrating several SQL Server 2000 DTS packages to Integration Services packages. One of the old 2000 DTS packages used the SQLXML Bulk Loader component. In order to use the new SQLXML 4 COM object in my Script Task (to initiate the Bulk Loader using .NET code) I've used the tlbimp.exe tool to create a .NET wrapper DLL. I've placed the DLL in the appropriate directory (C:Program FilesMicrosoft SQL Server90SDKAssemblies), successfully added it to my project (with Intellisense working), but when I run the package it fails with the following error:

Could not load file or assembly 'SQLXMLBULKLOADLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.

Note: I also tried placing the DLL in C:WINDOWSMicrosoft.NETFrameworkv2.0.50727 with no prevail.

I've confirm the file exists (and any dependencies) in their appropriate locations. Has anyone else run into this? Any help is much appreciated.

Thanks, Shaun

View 6 Replies View Related

Could Not Load File Or Assembly To Server

Nov 29, 2007

Hi,
I have a custom library (ReportLibary.dll) and ı added it as a reference to the report (Report.rdl). I also copied the dll file to ..IDEPrivateAssemblies. The report uses a methot from the dll to get some data.
When ı run the report from my local computer there is no problem, the data is generated from the dll. But when I depoy it to the sever an exception occurs.

"Error while loading code module: €˜ReportLibary, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null€™. Details: Could not load file or assembly 'ReportLibary, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. Can not find the file. d:...Report.rdl"

I hope ı can find a solution to my problem. Thanks in advance.

View 4 Replies View Related

Load Assembly From Stored Procedure

Jan 26, 2006

Hi,

Is it possible to load an assembly either from a byte array or from the disk at runtime from a CLR stored procedure.

I
have created a stored procedure that needs to load different assemblies
depending on a query and then invokes a method (called execute() passing a string query as a parameter).



From debugging the CLR stored procedure in .NET I have found that it is this line that creates an error:



    Assembly myAssembly= Assembly.Load()  

It
doesnt matter if I attempt to load the assembly from it's byte array or
from a file location, it always gives the following error:


Msg 6522, Level 16, State 1, Procedure runQuery, Line 0A .NET Framework error occurred during execution of user defined routine or aggregate 'runQuery': 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 ClientInterface.RunInterface(String queryName, String parameters, String& returnValue)



It works perfectly if I run it using a mock up front end app it just seems to be sql server that doesnt like it.

Anybody have any ideas?

View 3 Replies View Related

Assembly Load Error Using Replication In VB Code

Sep 28, 2007



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 2 Replies View Related

Cannot Load Dynamically Generated Serialization Assembly

Feb 14, 2008

I am getting the following error when executing a CLR stored procedure. I have set generate serialization assembly to 'ON' with no effect. The error is:


System.InvalidOperationException: Cannot load dynamically generated serialization assembly. In some hosting environments assembly load functionality is restricted, consider using pre-generated serializer. Please see inner exception for more information. ---> 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, Byte[] rawSymbolStore, Evidence securityEvidence)

at Microsoft.CSharp.CSharpCodeGenerator.FromFileBatch(CompilerParameters options, String[] fileNames)

at Microsoft.CSharp.CSharpCodeGenerator.FromSourceBatch(CompilerParameters options, St

...

System.InvalidOperationException:

at System.Xml.Serialization.Compiler.Compile(Assembly parent, String ns, XmlSerializerCompilerParameters xmlParameters, Evidence evidence)

at System.Xml.Serialization.TempAssembly.GenerateAssembly(XmlMapping[] xmlMappings, Type[] types, String defaultNamespace, Evidence evidence, XmlSerializerCompilerParameters parameters, Assembly assembly, Hashtable assemblies)

at System.Xml.Serialization.TempAssembly..ctor(XmlMapping[] xmlMappings, Type[] types, String defaultNamespace, String location, Evidence evidence)

at System.Xml.Serialization.XmlSerializer.GenerateTempAssembly(XmlMapping xmlMapping, Type type, String defaultNamespace)

at System.Xml.Serialization.XmlSerializer..ctor(Type type, String defaultNamespace)

at System.Xml.Serialization.XmlSerializer..ctor(Type type)

at SoftBrands.FourthShift.Transaction.FSTIError..ctor(String XMLErrorString)

at SoftBrands.FourthShift.Transaction.FSTIClient.ProcessTransaction(String sTrxn)

at SoftBrands.FourthShift.Transaction.FSTIClient.ProcessId(...

My code is:


Partial Public Class StoredProcedures

<Microsoft.SqlServer.Server.SqlProcedure()> _

Public Shared Sub SpPICK00()

Dim DbCon As New SqlConnection("context connection=true")

Dim DbSql As New SqlCommand("SELECT TOP 1 * FROM TblTransactions", DbCon)

Dim TransactionID As Int64

DbSql.Connection.Open()

Dim DbRs As SqlDataReader

DbRs = DbSql.ExecuteReader

While DbRs.Read

TransactionID = DbRs("TransactionID")

End While

DbRs.Close()

Dim MenuID As Int16

Dim MONumber As String

Dim LineNumber As String

Dim PTUse As String

Dim SEQN As String

Dim WorkCentre As String

Dim Stock As String

Dim Bin As String

Dim Qty As Double



DbSql = New SqlCommand("SELECT * FROM VwPickList WHERE TransactionID = @TransactionID", DbCon)

DbSql.Parameters.Add("@TransactionID", SqlDbType.BigInt).Value = TransactionID

DbRs = DbSql.ExecuteReader

If DbRs.Read Then

MenuID = DbRs("MenuID")

MONumber = DbRs("MONumber")

LineNumber = DbRs("LineNumber")

PTUse = DbRs("PT_USE")

SEQN = DbRs("SEQN")

WorkCentre = DbRs("WorkCentre")

Stock = DbRs("Stock")

Bin = DbRs("Bin")

Qty = DbRs("Hours")

End If

DbRs.Close()

DbSql.Connection.Close()

DbCon.Dispose()

DbSql.Dispose()

Dim FSClient As New FSTIClient

FSClient.InitializeByConfigFile("\FPTESTFShiftMfgsysfs.cfg", False, False)

SqlContext.Pipe.Send("Config file initialized")

If FSClient.IsLogonRequired Then

FSClient.Logon("VBS", "visib", "")

End If

SqlContext.Pipe.Send("FSTI logged in")

If MenuID = 2 Then

Dim Pck As New PICK08

Pck.OrderType.Value = "M"

Pck.IssueType.Value = "I"

Pck.OrderNumber.Value = MONumber

Pck.LineNumber.Value = LineNumber

Pck.PointOfUseID.Value = PTUse

Pck.OperationSequenceNumber.Value = SEQN

Pck.ItemNumber.Value = WorkCentre

Pck.Stockroom.Value = Stock

Pck.Bin.Value = Bin

Pck.IssuedQuantity.Value = Qty

SqlContext.Pipe.Send("ready to process")

If FSClient.ProcessId(Pck) Then

SqlContext.Pipe.Send("process ok")

Else

SqlContext.Pipe.Send("process error: " & FSClient.TransactionError.Description)

End If

SqlContext.Pipe.Send("processed")

ElseIf MenuID = 1 Then

Dim Pck As New PICK04

Pck.OrderType.Value = "M"

Pck.IssueType.Value = "I"

Pck.OrderNumber.Value = MONumber

Pck.LineNumber.Value = LineNumber

Pck.PointOfUseID.Value = PTUse

Pck.OperationSequenceNumber.Value = SEQN

Pck.ItemNumber.Value = WorkCentre

Pck.IssuedQuantity.Value = Qty

SqlContext.Pipe.Send("ready to process")

If FSClient.ProcessId(Pck) Then

SqlContext.Pipe.Send("process ok")

Else

SqlContext.Pipe.Send("process error: " & FSClient.TransactionError.Description)

End If

SqlContext.Pipe.Send("processed")

End If

FSClient.Terminate()

End Sub

End Class

Any help anybody can provide on this would be fantastic.

View 2 Replies View Related

External Component Has Thrown An Exception - Can't Load .dtsx Files!

Apr 2, 2008

Help,

I get the following exception anytime I attempt to open a .dtsx file in the SSIS project in VS2005:

"External component has thrown an exception. (System.Windows.Forms)"

I haven't made any changes to this project and it was up and running fine a week or so ago. Any ideas? Help.

Thanks - Wayde

View 5 Replies View Related

Could Not Load File Or Assembly ADODB, Version=7.0.3300.0

Jan 26, 2006

I have an application broadly deployed
(about 10 computers). As of yesterday, two of these computers are
unable to start the application, and failing with the error below. All
other computers run the application just fine.



System.IO.FileNotFoundException: Could not load file or
assembly 'ADODB, Version=7.0.3300.0, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot
find the file specified.
File name: 'ADODB, Version=7.0.3300.0,
Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'



I checked and ADODB.dll version 7.0.3300.0 is in the GAC in the deployment target machines.



I find ADODB.dll in my C:Program FilesMicrosoft.NETPrimary Interop
Assemblies folder (development computer), but this is version
7.10.3077.0 (file properties version)



I see ADODB.dll as a project reference, but this shows version
7.0.3300.0, and shows the path to the PIA folder. I have no clue why
these are not showing the same version number. Local Copy is false.



Installing MDAC 2.8 on the failing deployment target machines did not help.



Any clues or ideas or things to try??

View 34 Replies View Related

Could Not Load File Or Assembly 'Microsoft.Data.Odbc...

Nov 9, 2006

I have developed an application in C#, and it uses both a SQL server database, and as part of its operation it opens up a Foxpro database. I am using Odbc to connect to the fox pro database and everything wortks just fine on my devleopment machine. However when I deploy my application I am getting the following error text when ever I create the form that does the Odbc work.

************** Exception Text **************
System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.Data.Odbc, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its dependencies. The system cannot find the file specified.
File name: 'Microsoft.Data.Odbc, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'

I have absolutely no clue why I am getting this error. I have insured that the latest MDAC was installed ( it is XP Pro so no updates there ) I have made sure that I have the latest Fox Pro Odbc driver installed as well and I can create the DSN just fine.

Can anyone point me where to look next ? Im truly stumped here.



Thanks in advance for any and all input!!!

View 1 Replies View Related

Could Not Load File Or Assembly 'System.Data.SqlServerCe'...

Nov 30, 2005

I am trying to use SQL Mobile 2005 with Visual Studio 2005.  I have a simple sql mobile db i created and am trying to test connectivity to the DB in a simple app.  I added the reference to the SqlServerCE and the verison # that is shown in properties is 3.0.3600.0, but when i look at the physical DLL in explorer (found at C:Program FilesMicrosoft Visual Studio 8SmartDevicesSDKSQL ServerMobilev3.0) the version # is 3.0.5206.0, so when i compile and run the test, I get :

View 7 Replies View Related

Cannot Load Dynamically Generated Serialization Assembly SQLCLR

Apr 10, 2008



In article http://support.microsoft.com/kb/913668 it says to generate a serialization assembly and pop this into the database along side the assembly with the serialized type. All well and good, but how doe the XmlSerializer know to look in the database for the assembly - does it use the name of the assembly + XmlSerializer?

It is certainly ambiguous in the aforementioned kb article. In one place it generates an assembly in the database called

CREATE ASSEMBLY [MyTest.XmlSerializers] from
'C:CLRTestMyTestMyTestinDebugMyTest.XmlSerializers.dll'
WITH permission_set = SAFE

and in another it uses

USE dbTest
GO
CREATE ASSEMBLY [MyTest] from 'C:CLRTestMyTest.dll'
GO
CREATE ASSEMBLY [MyTest.XmlSerializers.dll] from 'C:CLRTestMyTest.XmlSerializers.dll'
GO

I can't get either to work, and I've tried various combinations, this and the fact that the kb artice uses two different naming conventions suggests to me that there must be "something else" which links the assembly with the serialization assembly.

Any ideas?

Thanks,

Dan

View 18 Replies View Related

Could Not Load File Or Assembly 'System.Data.SqlServerCe, Version 3.5.0.0

May 8, 2008

We just upgraded our applications from VS 2005 to VS 2008 and discovered we had to convert our SQL Server CE databases. So I did that. I then included the sqlce...35.dlls in the application directory on my test computer as well as the System.Data.SqlServerCe.dll version 3.5.

sqlceca35.dll
sqlcecompact35.dll
sqlceer35EN.dll
sqlceme35.dll
sqlceoledb35.dll
sqlceqp35.dll
sqlcese35.dll

When I run the app and it tries to load the System.Data.SqlServerCe.dll I get the following error:
System.IO.FileLoadException: Could not load file or assembly 'System.Data.SqlServerCe, Version 3.5.0.0...or one of its dependencies. The located assembly's manifest definition does not match the assembly reference.

We have the application targeting the .NET Framework 2.0 and need to keep it that way for awhile.

Any ideas on how to resolve the error?

View 5 Replies View Related

After Instalation The Report Server Returns:Attempted To Load A 64-bit Assembly On A 32-bit Platform

Jun 19, 2007

Our server is 64 bits OS. After SQL instalation we try to load the Reports web site and the server return the following error, can anyone help us?:



Attempted to load a 64-bit assembly on a 32-bit platform. Use ReflectionOnlyLoad() instead if trying to load for reflection purposes.Server
Error in '/Reports' Application.


Attempted to load a 64-bit assembly on a 32-bit platform. Use
ReflectionOnlyLoad() instead if trying to load for reflection purposes.
Description: An unhandled exception occurred during the execution of the current
web request. Please review the stack trace for more information about the error
and where it originated in the code.

Exception Details: System.BadImageFormatException: Attempted to load a 64-bit
assembly on a 32-bit platform. Use ReflectionOnlyLoad() instead if trying to
load for reflection purposes.

Source Error:

An unhandled exception was generated during the execution of the current
web request. Information regarding the origin and location of the
exception can be identified using the exception stack trace below.

Stack Trace:


[BadImageFormatException: Attempted to load a 64-bit assembly on a 32-bit platform. Use ReflectionOnlyLoad() instead if trying to load for reflection purposes.]
System.Reflection.Assembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection) +0
System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +211
System.Reflection.Assembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +141
System.Reflection.Assembly.Load(String assemblyString) +25
System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +32

[ConfigurationErrorsException: Attempted to load a 64-bit assembly on a 32-bit platform. Use ReflectionOnlyLoad() instead if trying to load for reflection purposes.]
System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +596
System.Web.Configuration.CompilationSection.LoadAllAssembliesFromAppDomainBinDirectory() +3479065
System.Web.Configuration.CompilationSection.LoadAssembly(AssemblyInfo ai) +46
System.Web.Compilation.BuildManager.GetReferencedAssemblies(CompilationSection compConfig) +177
System.Web.Compilation.BuildProvidersCompiler..ctor(VirtualPath configPath, Boolean supportLocalization, String outputAssemblyName) +180
System.Web.Compilation.ApplicationBuildProvider.GetGlobalAsaxBuildResult(Boolean isPrecompiledApp) +3446645
System.Web.Compilation.BuildManager.CompileGlobalAsax() +51
System.Web.Compilation.BuildManager.EnsureTopLevelFilesCompiled() +462

[HttpException (0x80004005): Attempted to load a 64-bit assembly on a 32-bit platform. Use ReflectionOnlyLoad() instead if trying to load for reflection purposes.]
System.Web.Compilation.BuildManager.ReportTopLevelCompilationException() +57
System.Web.Compilation.BuildManager.EnsureTopLevelFilesCompiled() +612
System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters) +456

[HttpException (0x80004005): Attempted to load a 64-bit assembly on a 32-bit platform. Use ReflectionOnlyLoad() instead if trying to load for reflection purposes.]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +3426871
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +88
System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr) +149




Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET
Version:2.0.50727.42

View 1 Replies View Related

Integration Services :: Send CSV Files To Secure FTP - Could Not Load File Or Assembly

Aug 3, 2015

Task- To Send csv files to Secure FTP.

Problem: Script Task using Third Party DLL for Secure FTP mainly "Eldos" is not able to load dll ,when deployed on integration server.

Resolution: Usually i Follow and it works even : Copy and Paste Dll in below location depending on Server Configuration.

If Server is Window 32 Bit
"C:Program Files (x86)Microsoft SQL Server100DTSBinn"
If Server is Window 64 Bit
"C:Program FilesMicrosoft SQL Server100DTSBinn"

Tried Another Resolution:

If Server is Window 32 Bit
"C:Program Files (x86)Microsoft SQL Server100SDKAssemblies"
If Server is Window 64 Bit
"C:Program FilesMicrosoft SQL Server100SDKAssemblies"

View 4 Replies View Related

Error Attempting To PREVIEW In OLE DB Source Editor - Could Not Load File Or Assembly

Feb 28, 2007

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 1 Replies View Related

Database Schemas And This Statement Has Attempted To Access Data Whose Access Is Restricted By The Assembly.

Jul 14, 2005

Hello.

View 5 Replies View Related

Unable To Send Database Mail To External User

Jul 13, 2015

I have two domains. forest domain abc which has the exchange infrastructure. forest domain xyz which does not have exchange. There is a two way trust set up.

I have set up database mail which sends internally but not externally on the xyz domain its uses mailrelay address to comunicate with exchange. The receive connector is set up correctly on exchange on domain abc as I have managed to send email from a sql server to external contact in the abc domain.

The IP addresses are correct on the receive connector.

The problem is I am unable to send to an external contact from the sql server in the xyz domain. Not sure if this an exchange issue or database mail.

View 2 Replies View Related

Calling VB Based SQLCLR Function Failed With Error Can't Load System.Web Assembly

Apr 20, 2007

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 2 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved