Reference.svcmap: Could not load file or assembly 'Microsoft.SqlServer.SqlEnum, - c#

when I upload the website on the host below error accrue I don't have any problem in localhost but when I upload it on a host this error accrues:
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: Reference.svcmap: Could not load file or assembly 'Microsoft.SqlServer.SqlEnum, Version=10.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' or one of its dependencies. The system cannot find the file specified.
Source Error:
[No relevant source lines]
Source File: /App_WebReferences/XMLForSMSServiceReference1/ Line: 1
Assembly Load Trace: The following information can be helpful to determine why the assembly 'Microsoft.SqlServer.SqlEnum, Version=10.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' could not be loaded.
what should I do?
Best Regards
Neda

Possible duplicate of : C# SMO and SqlEnum references error
Short answer is the binaries you are deploying on to target server are missing referenced binaries (I am guessing the Sql server SMO library).
When you deploy a project to the destination you have to ensure the destination has the shared components (such as SQL SMO) already installed there, if not you have to include such shared binaries through your msi/deployment.
In your case there are two possible workarounds depending upon how you want to achieve it.
Create the msi and include all binaries (including the once those go in global cache - strongly signed libraries) - this is the more sensible way of handling standard deployment scenarios.
Only deploy your project binaries but ensure the referenced packages are already installed on destination.

Related

ASP.Net error on server?

I have an ASP.Net site that pulls back data from a SQL database, it works in visual studio on my local machine but when i upload it to my web space at somee.com i get an error when i try to access the page.
Here i the error page :
Server Error in '/' Application.
Configuration Error
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.
Parser Error Message: Could not load file or assembly 'MySql.Data, Version=6.9.8.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d' or one of its dependencies. The system cannot find the file specified.
Source Error:
An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine.
Source File: d:\DZHosts\LocalUser\bman262\www.brandonsLoginTest.somee.com\riviera horticulture\web.config Line: 9
Assembly Load Trace: The following information can be helpful to determine why the assembly 'MySql.Data, Version=6.9.8.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d' 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:4.0.30319; ASP.NET Version:4.6.1069.1
From what i can make of that, i don't think the
mysql.data
reference in the web config is getting loaded in.
Anyone help ?
Thank you
You either need to make sure that the missing DLL is included when you deploy your web site. If you use the VS deploy tool, it should do this for you.
Check your Publish folder and see if it's there.

IBM.Data.DB2 FileNotFound Loading Microsoft.ReportingServices.Interfaces

I have a ASP.Net application which references an assembly with some re-usable code (common utils, data access, etc.). The assembly references IBM.Data.DB2.dll. However, I am not using DB2 in my application, the IBM.Data.DB2.dll is simply a dependency (in case an app needs to connect to DB2). Recently, i've run into the following error:
System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.ReportingServices.Interfaces, Version=10.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' or one of its dependencies. The system cannot find the file specified.
File name: 'Microsoft.ReportingServices.Interfaces, Version=10.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91'
System.Reflection.ReflectionTypeLoadException: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.
at System.Reflection.RuntimeModule.GetTypes(RuntimeModule module)
at System.Reflection.RuntimeModule.GetTypes()
at System.Reflection.Assembly.GetTypes()
at Unity.AutoRegistration.AutoRegistration.<ApplyAutoRegistration>b__5(Assembly a)
at System.Linq.Enumerable.<SelectManyIterator>d__14`2.MoveNext()
at System.Linq.Enumerable.WhereEnumerableIterator`1.MoveNext()
at Unity.AutoRegistration.AutoRegistration.ApplyAutoRegistration()
The only file in the entire application that contains Microsoft.ReportingServices.Interfaces is the IBM.Data.DB2.dll file. I do not have any need of SQL Server or the overhead of a SQL Server installation locally much less on the server when the app is deployed. Bear in mind I am required to use the assembly which has the dependency on IBM.Data.DB2.dll and this error has not happened in the past, it seems to be recent.
I have tried binding redirects, installed Microsoft.ReportingServices.Interfaces via Nuget all to no avail.
Would anyone know why this error is occurring and more importantly....how to resolve it?
If IBM.Data.DB2.dll references Microsoft.ReportingServices.Interfaces, you will probably have to manually copy Microsoft.ReportingServices.Interfaces.dll into your bin folder. Here is a post that can help you with that:
Microsoft.ReportingServices.Interfaces.dll missing for SSRS 2005

Creating custom assembly in SQL Server throwing assembly not found in database error

I am trying to create an assembly for a third party dll (developed in .net) in SQL Server 2008 for CLR procedure project,
create assembly [`XXXX.XXX.XXX.dll`]
authorization dbo
from 'C:\Windows\Microsoft.NET\Framework\v2.0.50727\XXXX.XXX.XXX.dll'
with permission_set = unsafe
But I'm getting this error while executing the above script:
Assembly 'XXX.XXX.XXX.XXX' references assembly 'XXX.XXX.XXXXX',
version=0.0.0.0, culture=neutral, publickeytoken=null.', 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 appreciate your help in solving this issue
You can add Assemblies to your database which is used by you CLR.
I have added for example System.Messaging.dll to SQL Server 2014 as follows
CREATE ASSEMBLY [System.Messaging]
FROM 'C:\Windows\Microsoft.NET\Framework64\v4.0.30319\System.Messaging.dll'
WITH PERMISSION_SET = UNSAFE;
GO
It will add the neccessary other referenced assemblies linked to that one. After that, I added Newtonsoft.Json.dll like this:
CREATE ASSEMBLY [Newtonsoft.Json]
FROM 'C:\Users\RiaanDL\Downloads\Json60r3\Bin\Net45\Newtonsoft.Json.dll'
WITH PERMISSION_SET = UNSAFE;
GO
Just remember to set your SQLCLR Permission level as UNSAFE in Project Configuration.
Assemblies in SQL Server cannot reference assemblies from the GAC unless they are on the 'blessed' list. That list is as follows:
Mscorlib.dll
System.Data.dll
System.dll
System.Xml.dll
System.Security.dll
System.Web.Services.dll
System.Data.SqlXml.dll
System.Transactions.dll
System.Configuration.dll
Microsoft.VisualBasic.dll
Microsoft.VisualC.dll
CustomMarshalers.dll
System.Data.OracleClient.dll
Any other assemblies need to be created within SQL Server using the CREATE ASSEMBLY syntax - even those from the .NET Framework itself that are not on the list above.
I know this question has been asked long back but I would like to share my findings and solutions to it so that it could help someone.
In order to create assembly be it custom or native assembly from .NET Framework, you need set TRUSTWORTHY ON for the database.
ALTER DATABASE [DATABASE NAME] SET TRUSTWORTHY ON;
After this, you may execute the below script for creating an assembly. In my example, I'm trying to create assembly for "System.Net.Http"
CREATE ASSEMBLY [System.Net.Http]
FROM
'C:\Windows\Microsoft.NET\Framework64\v4.0.30319\System.Net.Http.dll'
WITH PERMISSION_SET = UNSAFE;
For your case, you need to point your customer assembly (dll) location correctly to make this work.
Note: There are only few supported assembly which can be found here. If anything other than specified assembly are used then you will get an Warning as shown below. In my example, when I tried to create assembly for [System.Net.Http], I got below Warning.
The Microsoft .NET Framework assembly 'system.net.http,
version=4.0.0.0, culture=neutral, publickeytoken=b03f5f7f11d50a3a,
processorarchitecture=msil.' you are registering is not fully tested
in the SQL Server hosted environment and is not supported. In the
future, if you upgrade or service this assembly or the .NET Framework,
your CLR integration routine may stop working. Please refer SQL Server
Books Online for more details.
Hope this helps.

Could not load file or assembly Microsoft.ServiceModel.DomainServices.Hosting

I have an application loaded in my local environment. This is a codebase that I have inherited and have not gotten it to work at all. At this time, when I navigate to "http://test.myapp.com:75/" in my browser, I receive the following error:
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.
Parser Error Message: Could not load file or assembly 'Microsoft.ServiceModel.DomainServices.Hosting, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.
I have checked and verified that I have RIA Data Services loaded. I can see the files in C:\Program Files (x86)\Microsoft SDKs\RIA Services\v1.0\Libraries\Server. Interestingly, the assemblies in this directory are not loaded into my GAC. I've tried loading them into my GAC, however, I cannot drag the assemblies into C:\Windows\assembly and no error is shown when I try.
What am I doing wrong?
The Microsoft.ServiceModel.DomainServices.Hosting library is not part of the standard WCF RIA Services. You have to download and install the WCF RIA Services Toolkit seperately.
I also recommend reading WCF Extensibility – Configuring the Endpoint for WCF RIA Services.
I had the same problem , and solved.
The files "Microsoft.ServiceModel.DomainServices.Hosting.dll" in C:\Program Files (x86)\Microsoft SDKs\RIA Services\v1.0\Libraries\Server is the wrong one.
The right one is here
C:\Program Files (x86)\Microsoft SDKs\RIA Services\v1.0\Libraries\Server\SP2
I think this problem maybe caursed by the dll file version.
the first one is old and the second one is new .
Setting your .NET version incorrectly in the application list can also create this issue.

System.IO.FileLoadException

I have got this error when using Enterprise Library 3.1 May 2007 version. We are developing a product and have a common lib directory beneath the Subversion Trunk directory
<>\Trunk\Lib\ into which we put all the third party DLLs. Inside this we have Microsoft\EnterpriseLibrary\v3.1 in which we have copied all the dlls from \Program Files\Microsoft Enterprise Library May2007\bin. Everything was working properly until one of the developers installed the source code on this machine. There were some dlls copied at the end of the source code installation and once that was done, he is not able to run the project anymore. He always gets this error
'Microsoft.Practices.EnterpriseLibrary.Data, Version=3.1.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)'
What is the problem here? I thought that when the source code was installed it was just supposed to build everything and copy in the bin directory within the source code parent directory. Also we have copied the Dlls from Microsoft Enterprise Library May 2007\bin directory into our product development directory and references into our project with a copylocal flag set to true.
Can anyone help me out here
RK
I used to get that when I developed against the signed version of the dll and deployed where only the unsigned version was available.
Also, fuslogvw.exe. EVERY. TIME.
I assume the error lies in the developer having compiled the code against the unsigned source code compilation he has.
Make sure he adds the reference to the signed DLLs before compiling his code.
Microsoft.Practices.EnterpriseLibrary.Data, Version=3.1.0.0, Culture=neutral, PublicKeyToken=null
should be something like:
Microsoft.Practices.EnterpriseLibrary.Data, Version=3.1.0.0, Culture=neutral, PublicKeyToken=fa03fef243232
maybe you should check the Assembly- and FileVersion of the dll. if they do not match this exception can occur.
Read here to get started with assembly loading debugging.
In short you need to check the Fusion log for more information.
For a "The located assembly's manifest
definition with name [yourAssembly]
does not match the assembly reference"
message (for hresult
FUSION_E_REF_DEF_MISMATCH,
0x80131040): The Fusion log will say
which part of the assembly reference
failed to match what was found. It
will be the assembly name, culture,
public key (or token) or version (if
the found assembly was
strongly-named).

Categories