How can I create assembly reference for mscorlib.dll ver 5 in SQL Server 2012 - sql

I Use SQL Server 2012 and I want create CLR
I want execute this command in SQL Server 2012
CREATE ASSEMBLY AndishCSSCommon FROM 'C:\Andish.CSS.Common.dll'
WITH PERMISSION_SET=EXTERNAL_ACCESS
But I get this error
Msg 10301, Level 16, State 1, Line 1
Assembly 'Andish.CSS.Common' references assembly 'mscorlib, version=5.0.5.0,
culture=neutral, publickeytoken=7cec85d7bea7798e.', 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.
and in my debug folder not exist mscorlib.dll
how can I CREATE ASSEMBLY for mscorlib.dll before CREATE ASSEMBLY AndishCSSCommon FROM 'C:\Andish.CSS.Common.dll'

You could try to set the target framework to a more recent one from your project's
Properties -> Application -> Target framework.

Related

SQL Server 2012 - facing installation error

I was trying to install SQL Server 2012 but I get an error
Could not load file or assembly ‘Microsoft.VisualC, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a’ or one of its dependencies. The system cannot find the file specified. Error code 0x84B10001.
Any idea how to solve this?

ASP.NET Register Assembly error

I am WAY out of my league here, so I apologize if I'm asking a duplicate question, but I don't know where to start on this one.
I recently migrated an SQL database from SERVER1, where it was collocated with IIS hosting the web interface to access the database, to SERVER2. The web interface is now accessing the database properly, and through some application features I can access the data properly, with no error. However, when I try to run a report, I get this error:
How do I fix this?
Server Error in '/' Application.
--------------------------------------------------------------------------------
Parser Error
Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.
Parser Error Message: Could not load file or assembly 'Microsoft.ReportViewer.WebForms, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
Source Error:
Line 5: Namespace="AjaxControlToolkit"
Line 6: TagPrefix="ajaxToolkit" %>
Line 7: <%# Register Assembly="Microsoft.ReportViewer.WebForms, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
Line 8: Namespace="Microsoft.Reporting.WebForms" TagPrefix="rsweb" %>
Line 9:
Source File: /source/Report5.aspx Line: 7
Assembly Load Trace: The following information can be helpful to determine why the assembly 'Microsoft.ReportViewer.WebForms, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' could not be loaded.
WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!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 [HKLM\Software\Microsoft\Fusion!EnableLog].
--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.3603; ASP.NET Version:2.0.50727.4028
UPDATE
I turned on logging and got this more detailed error:
=== Pre-bind state information ===
LOG: User = AURORAFCS\raj
LOG: DisplayName = Microsoft.ReportViewer.WebForms, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
(Fully-specified)
LOG: Appbase = file:///C:/Family/
LOG: Initial PrivatePath = C:\Family\bin
Calling assembly : (Unknown).
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: C:\Family\web.config
LOG: Using host configuration file: \\?\c:\windows\microsoft.net\framework\v2.0.50727\aspnet.config
LOG: Using machine configuration file from c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\config\machine.config.
LOG: Post-policy reference: Microsoft.ReportViewer.WebForms, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
LOG: Attempting download of new URL file:///c:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/Temporary ASP.NET Files/root/dc46260e/807e5b0d/Microsoft.ReportViewer.WebForms.DLL.
LOG: Attempting download of new URL file:///c:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/Temporary ASP.NET Files/root/dc46260e/807e5b0d/Microsoft.ReportViewer.WebForms/Microsoft.ReportViewer.WebForms.DLL.
LOG: Attempting download of new URL file:///C:/Family/bin/Microsoft.ReportViewer.WebForms.DLL.
LOG: Attempting download of new URL file:///C:/Family/bin/Microsoft.ReportViewer.WebForms/Microsoft.ReportViewer.WebForms.DLL.
LOG: Attempting download of new URL file:///c:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/Temporary ASP.NET Files/root/dc46260e/807e5b0d/Microsoft.ReportViewer.WebForms.EXE.
LOG: Attempting download of new URL file:///c:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/Temporary ASP.NET Files/root/dc46260e/807e5b0d/Microsoft.ReportViewer.WebForms/Microsoft.ReportViewer.WebForms.EXE.
LOG: Attempting download of new URL file:///C:/Family/bin/Microsoft.ReportViewer.WebForms.EXE.
LOG: Attempting download of new URL file:///C:/Family/bin/Microsoft.ReportViewer.WebForms/Microsoft.ReportViewer.WebForms.EXE.
UPDATE2
Using fusion logger, I have this more detailed message, which shoes it a is a "File Cannot Be Found" error. However, I have installed the redistributables, so why can it not find the DLL?
*** Assembly Binder Log Entry (11/21/2014 # 4:00:35 PM) ***
The operation failed.
Bind result: hr = 0x80070002. The system cannot find the file specified.
Assembly manager loaded from: c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\mscorwks.dll
Running under executable c:\windows\system32\inetsrv\w3wp.exe
--- A detailed error log follows.
=== Pre-bind state information ===
LOG: User = AURORAFCS\raj
LOG: DisplayName = Microsoft.ReportViewer.WebForms, Version=8.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
(Partial)
LOG: Appbase = file:///C:/Family/
LOG: Initial PrivatePath = C:\Family\bin
LOG: Dynamic Base = c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\dc46260e
LOG: Cache Base = c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\dc46260e
LOG: AppName = 807e5b0d
Calling assembly : (Unknown).
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: C:\Family\web.config
LOG: Using host configuration file: \\?\c:\windows\microsoft.net\framework\v2.0.50727\aspnet.config
LOG: Using machine configuration file from c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\config\machine.config.
LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind).
LOG: Attempting download of new URL file:///c:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/Temporary ASP.NET Files/root/dc46260e/807e5b0d/Microsoft.ReportViewer.WebForms.DLL.
LOG: Attempting download of new URL file:///c:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/Temporary ASP.NET Files/root/dc46260e/807e5b0d/Microsoft.ReportViewer.WebForms/Microsoft.ReportViewer.WebForms.DLL.
LOG: Attempting download of new URL file:///C:/Family/bin/Microsoft.ReportViewer.WebForms.DLL.
LOG: Attempting download of new URL file:///C:/Family/bin/Microsoft.ReportViewer.WebForms/Microsoft.ReportViewer.WebForms.DLL.
LOG: Attempting download of new URL file:///c:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/Temporary ASP.NET Files/root/dc46260e/807e5b0d/Microsoft.ReportViewer.WebForms.EXE.
LOG: Attempting download of new URL file:///c:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/Temporary ASP.NET Files/root/dc46260e/807e5b0d/Microsoft.ReportViewer.WebForms/Microsoft.ReportViewer.WebForms.EXE.
LOG: Attempting download of new URL file:///C:/Family/bin/Microsoft.ReportViewer.WebForms.EXE.
LOG: Attempting download of new URL file:///C:/Family/bin/Microsoft.ReportViewer.WebForms/Microsoft.ReportViewer.WebForms.EXE.
LOG: All probing URLs attempted and failed.
You need to determine what version of the ReportViewer Control you are targeting and install the proper package on the same server that your web app is deployed.
Microsoft Report Viewer 2010 Redistributable Package
Microsoft Report Viewer 2008 SP1 Redistributable
Microsoft Report Viewer Redistributable 2008
Microsoft Report Viewer Redistributable 2005
I am sure the logic is as follows:
ReportViewer 2010 can be used against SQL Server 2008(SP2) and 2012
ReportViewer 2008 can be used against SQL Server 2008 and 2005
ReportViewer 2005 can be used against SQL Server 2005
I found the answer to my problem in this blog:
http://www.orcsweb.com/blog/desiree/access-report-viewer-dll-files-for-your-application/
I just extracted the needed DLL and put it into one of the directories that the webapp was looking for. Still not sure why it happened, though.

System.management reference in SQL CLR stored procedure

I am trying to build an SQL CLR stored procedure that references an IBM WebSphere MQ dll. I'm having problems doing this on my work machine, so I decided to see if I could just get this to work on my home comp using localhost. I've made progress in getting a different error, however I'm not sure what this means:
Msg 10301, Level 16, State 1, Line 1
Assembly 'amqmdnet' references assembly 'system.management, 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.

Where to find the System.management dll

I am trying to build an SQL CLR stored procedure that references an IBM WebSphere MQ dll. I'm having problems doing this on my work machine, so I decided to see if I could just get this to work on my home comp using localhost. I've made progress in getting a different error, however I'm not sure where the system.management dll is located...
Here is a copy of the error message:
Msg 10301, Level 16, State 1, Line 1 Assembly 'amqmdnet' references assembly 'system.management, 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.
This is installed in GAC, Check the version of .Net that you have it on your system
You must register this assembly in SQL Server
create assembly [System.Management]
from 'c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Management.dll'
with permission_set = unsafe

Error adding sharepoint web service as web reference in a project

I'm trying to add web reference to my project using the link:- http://localhost/_vti_bin/Lists.asmx
Getting the following error:-
Parser Error
Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.
Parser Error Message: Could not load file or assembly 'Microsoft.SharePoint' or one of its dependencies. The system cannot find the file specified.
Source Error:
Line 1: <%# Assembly Name="Microsoft.SharePoint"%><%# Application Language="C#" Inherits="Microsoft.SharePoint.ApplicationRuntime.SPHttpApplication" %>
Source File: /global.asax Line: 1
Assembly Load Trace: The following information can be helpful to determine why the assembly 'Microsoft.SharePoint' could not be loaded.
WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!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 [HKLM\Software\Microsoft\Fusion!EnableLog].