I am just rewriting the question here:
I am building a console app that uses MySql connector. So I add reference to the dll in the project. When I compile the solution, I get an exe that runs fine on my own machine, but when I copy the exe to another machine, it doesn't work, because it can't find the Mysql dll. I have tried to copy the dll into the same folder as the exe on the other machine but no luck.
I also tried putting the dll in the same folder on same machines, but that didn't work either.
How do I deploy the dll correctly with my exe?
I had some different errors in the setup. It has to be the correct assembly dll (6.3.0) to work and also I needed to create the user#server and grant him privileges. But the dll is accessible when it's in the same folder as the exe.
Related
I have an azure function that calls a static method from a DLL I created separately and uploaded to the function folder, along with all of its dependencies (all dll's from the release folder were uploaded to the azure function).
When i try to call the function i receive an error
Could not load file or assembly 'Microsoft.SharePoint.Client.Runtime, Version=16.1.3912.1204
If i upload this version of Microsoft.SharePoint.Client.Runtime, i receive an error that it wants the other version again:
Could not load file or assembly 'Microsoft.SharePoint.Client.Runtime, Version=16.0.0.0
How can this be? It runs successfully outside Azure. Why does it want two versions of the same DLL? The project references 16.1.3912.1204, and this is the version of the dll in the \bin\release folder.
Side note: my .NET GAC folder contains version 16.0.0.0. If it is the case that for some reason inside the Microsoft.SharePoint.Client dll's it needs to reference both versions, how can i include two versions of the same file in an azure function?
Do not try to upload global nuget packages manually. Instead refer this thread, How can I use NuGet packages in my Azure Functions? to import nuget libraries to your Azure function ecosystem.
After that, you can directly use those c# libraries as, for example
using Microsoft.SharePoint;
Ensuring all project references pointed to packages folder (nuget) dll's to eliminate version conflicts and then uploading all DLL's from the bin folder resolved the issue in this case.
I'm using the CodePlex-hosted Microsoft.SqlServer.IntegrationServices.Build project to build a DLL that contains the MSBuild tasks for building SSIS packages via MSBuild.exe.
I also am using an MSBuild proj file that's floating around the web.
More here:
https://speaksql.wordpress.com/2013/06/07/a-journey-to-db-deployment-automaton-ssis-build-using-msbuild/
I've opened the CodePlex project, disabled signing, switched it to 4.6.1 and built the DLL and corrected paths etc. and go it semi-working. However MSBuild spits this error:
Could not load file or assembly 'Microsoft.SqlServer.DTSRuntimeWrap, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' or one of its dependencies. The system cannot find the file specified.
I've installed SSDT latest for Visual Studio 2015. I have various SQL Server editions installed on my dev PC. The DLL seems to be present; I've copied all I need into one folder for the moment.
Open the CodePlex project again and remove the reference to Microsoft.SqlServer.ManagedDTS.
Look on your local disk for the missing Microsoft.SqlServer.DTSRuntimeWrap.dll and note the version(s) you have available.
Now look on your disk for Microsoft.SqlServer.ManagedDTS.dll and note the version(s).
Re-add the reference but make sure you pick a DLL for which you also have the version of the 'wrap' available.
Now make sure those DLLs are (re)copied over into your working folder or whatever.
If you're still having problems, you may need to copy some files around so that MSBuild.exe can find them or edit/create a config file for MSBuild.
How to solve: Custom MSBuild task requires assembly outside of AppBase
I'm trying to use the sqlite-winrt library at https://sqlwinrt.codeplex.com (cf. http://blogs.windows.com/windows_phone/b/wpdev/archive/2013/05/30/sqlite-winrt-wrapper-for-windows-phone.aspx) because I need to access an SQLite database via SQL commands in a WinRT 8.1 and a WP8 app and this library seems the only available option.
Anyway, there is no binary release and if I try compiling the source I get several link errors for unresolved externals against the SQLite DLL. I posted an issue at codeplex but got no reply yet, so I was wondering if anyone had already managed to successfully compile this lib and how (or if you know of any viable alternative for RT8.1 and WP8). Here is what I did:
downloaded the latest source from the site.
downloaded and installed 2 VSIX from http://www.sqlite.org/download.html: sqlite-winrt81-3080002.vsix for RT 8.1 and sqlite-wp80-winrt-3080100.vsix for WP.
executed the powershell scripts in each subfolder of the source code solution, which are required to update the projects with newer releases of the SQLite for WinRT extension. The current versions of the scripts refer to SQLite for WinRT 8.1 (prerelease) which is the same I downloaded above.
opened the VS2013 solution and removed the RT project (I just need RT8.1 and WP, this was for WinRT 8.0).
5) built the solution, which failed with link errors.
If I see the RT8.1 project properties, I can confirm the reference to SQLite is under C:\Program Files (x86)\Microsoft SDKs\Windows\v8.1\ExtensionSDKs\SQLite.WinRT81\3.8.0.2.
Did anyone manage to use this lib? Thanks!
I also once had that problem. I fix it by editing the project file manually. At that time, the powershell script updating the wrong path. That's why I always failed when compiling my project. After I edit the project file using external text editor (I use sublime text), the projects are linked correctly.
You can try DatabasesCx. It is another SQLite Wrapper using Windows Runtime Component technology. It is freeware distributed as precompiled binary. You can find the details at http://www.almanacsoft.com/databasescx
I'm trying to call a MySQL database located on another server, from Azure.
I'm referencing .Net MySql.Data, and it works when running it in a test application.
However when I deploy the code to the Azure server I get the following exception:
Could not load file or assembly 'MySql.Data, Version=6.5.4.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d' or one of its dependencies. The system cannot find the file specified.
Since it's part of .Net I would expect it to work on Azure so I suspect I may be doing something wrong.
I also tried adding the MySql.Data.dll to the project and installing it to the CAG with no luck. (However I'm not certain it was installed successfully)
Any help or advice would be much appreciated.
Why are you assuming MySql.Data is part of .NET? The connector was written in .NET, it's not part of .NET. You will need to make sure the assembly is available in your instances. Since copy local didn't work (it should work...), try the following:
Add both gacutil.exe and MySql.Data.dll in a folder (mysql for example) in your project and set Copy to Output Directory to always.
Then create a startup task that calls gacutil.exe and installs the assembly, something like: mysql\gacutil.exe /i mysql\MySql.Data.dll
Note: I'm assuming you're using a Web Role.
I am trying to deploy my web service on AppHarbor through GitHub. My web service is using NHibernate.Spatial, which has Microsoft.SQLServer.Types version 10.0.0.0 as a dependency. This assembly is, if I understand correctly, installed along with SQL Server 2008. When I run my web service on my development computer, on which I have SQL Server 2008 installed, the service runs without trouble, but when I deploy to AppHarbor I get the following exception:
"Could not load file or assembly 'Microsoft.SqlServer.Types,
Version=10.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' or
one of its dependencies. The system cannot find the file specified."
As I already build my own version of NHibernate.Spatial.MsSql2008, the assembly from which the dependency derives, I have simply tried copying the required dll into the bin folder when building this project, by setting the reference property Copy Local to true. This is also reflected in the web service bin folder which is pulled by AppHarbor through Git. This didn't help though and my guess is that my web service is looking for the dependency in a different folder than bin.
How do I make the Microsoft.SqlServer.Types assembly available on AppHarbor? As the exception states, this might also be caused by possible missing dependencies of Microsoft.SqlServer.Types, but how do I find if this is the case, and again, how do I make the dependencies of Microsoft.SqlServer.Types available on AppHarbor?
Here's a NuGet package with the Microsoft.SqlServer.Types assembly. You can use this in combination with NuGet package restore on AppHarbor.