Unable to load DLL "SQLite.Interop.dll" - wpf

I just finished a C# WPF application for a client that uses a SQLite database. The program launches fine, but whenever the program tries to do something with the database, I get this error in my Try Catch:
Unable to load DLL "SQLite.Interop.dll": The specified module could not be
found. (Exception from HRESULT: 0x8007007E)
I read up on the other Stackoverflow questions and have not come up successful in any of the solutions. Note that I am building an installer with "Microsoft Visual Studio 2017 Installer Projects"
Here is what I have tried so far:
Setting Copy Local to True in all of my project References.
Using NuGet to obtain System.Data.SQLite, .Core and x64/x86.
Setting Any CPU to x64.
Prefer 32-bit false.
SQLite.Interop.dll and System.Data.SQLite.dll is inside of the the installed application's directory. This is not an issue on computers that have VS installed, only an issue on computers that don't have VS.

Related

OraOLEDB.Oracle.1 is not registered but works in VS2013, not VS2017/2019

I have a project/dtsx that just does a simple source->destination fill from Oracle to SQLServer 2014.
The original solution/project was in VS2013 and it runs on my machine - I've never looked to modify the project settings but Project -> Properties -> Configuration Properties -> Debugging -> Run64BitRuntime is True.
Opening this solution now in VS2019 it again looks fine - shows targeting SQL Server 2014 as necessary and appears they are identical but running locally now get "Error: 0xC0209303 at ProjectNameHere, Connection manager "Oracle_To_MF.oledb": The requested OLE DB provider OraOLEDB.Oracle.1 is not registered. If the 64-bit driver is not installed, run the package in 32-bit mode. Error code: 0x00000000.".
Switching Run64BitRuntime to False it will run.
Testing the connection from Connection Manager in SSIS it is successful regardless of the 64bit project setting.
Same behavior in VS2017.
Is there some more global setting I may have set in VS2013 to let this run and I might not have set it in 2017/2019. I can't remember ever going out of my way to set something. It is probable I don't have the 64bit installed and not the end of the world to switch the project properties, I am just confused why it's been working in VS2013. For what it's worth deployed packages and scheduled jobs the configuration to use 32bit is always checked - this is just my local that I'm trying to understand.
Thanks in advance.

Fix this Entity Framework migration, 00000000000000_CreateIdentitySchema, in Visual Studio?

I'm starting with the default Blazor app in Visual Studio 16.3.7 with authentication:
I go to the registration page, enter the email and password, and click the Register button and up comes the following error:
Next I go to Package Manager Console in Visual Studio, and run Update-Database, getting the following error:
CREATE FILE encountered operating system error 5(Access is denied.) while attempting to open or create the physical file 'C:\Users\Halaspnet-BlazorAuthentication-0X0X0X0X0X0-X0X0-X0X0-X0X0-0X0X0X0X0X0.mdf'.
CREATE DATABASE failed. Some file names listed could not be created. Check related errors.
The message points to the culprit, a backslash is missing from the file specification. It should be C:\Users\Hal\aspnet... , not C:\Users\Halaspnet...
So, how do I fix this? I can't find the string "CREATE DATABASE" anywhere in my solution.
Also, how do I get this to Microsoft as a bug report?
Problem solved!
I created the database that the 00000000000000_CreateIdentitySchema.cs wanted using Visual Studio's SQL Server Object Explorer. Then I ran Update-Database in the Package Manager Console, and it completed successfully.
The problem seems to be that I was using the Express edition of SQL Server.
This link got me to the fix for this problem:
Creating A Step-By-Step End-To-End Database Server-Side Blazor Application

AdventureWorks2012 mdf error message when downloading file

I am trying to download AdventureWorks2012.mdf. The link I am using is (https://github.com/Microsoft/sql-server-samples/releases). I then select the first option "adventure-works-2012-dw-data-file.mdf".
The link seems to download, but then when I go to open it I get an error:
This file does not have a program associated with it for performing this action. Please install a program or, if one is already installed, create an association in the Default Programs control panel
I have a macbook air and I have installed Microsoft by way of a virtual machine. Given all of this information, how am I supposed to resolve this issue so I can get the file to download? I already have SQL Server 2012 installed on my Microsoft.

Application display error after windows upgrade

Hi I have recently upgraded from windows 7 to windows 8.And have installed both Visual studio 2010 and 2012 on my PC.I had two personal application that worked fine under windows 7 but after trying to run them on windows 8 I get the following error.
The first application displays the following error:
The database 'E:\PROJECTS IDE\VISUAL STUDIO\2010\WEBAPPLICATIONS\FORUM\APP_DATA\ASPNETDB.MDF' cannot be opened because it is version 706. This server supports version 655 and earlier. A downgrade path is not supported.
Could not open new database 'E:\PROJECTS IDE\VISUAL STUDIO\2010\WEBAPPLICATIONS\FORUM\APP_DATA\ASPNETDB.MDF'. CREATE DATABASE is aborted.
An attempt to attach an auto-named database for file E:\Projects IDE\Visual Studio\2010\WebApplications\Forum\App_Data\ASPNETDB.MDF failed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC share.
This seems to be linked to the ASPNETB.MDF db on both applications.
The second applications runs fine at first but I thing only because I have created with two database and in order to run the app acces to ASPNETDB.MDF is not required.But after I try to login into the application I get this error:
An attempt to attach an auto-named database for file D:\Projects IDE\Visual Studio\MyWork\Websites\e-commerce\e-commerce\App_Data\ASPNETDB.MDF failed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC share.
The reason I am posting both the application problems is because I thing it is the same problem that is preventing my applications from running.
What can I do to solve this problem?

asp.net 4 mvc 2 error

when I run the app on server I get:
Could not load file or assembly 'Microsoft.SqlServer.Replication.DLL' or one of its dependencies. This application has failed to start because the application configuration is incorrect. Reinstalling the application may fix this problem. (Exception from HRESULT: 0x800736B1)
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.IO.FileLoadException: Could not load file or assembly 'Microsoft.SqlServer.Replication.DLL' or one of its dependencies. This application has failed to start because the application configuration is incorrect. Reinstalling the application may fix this problem. (Exception from HRESULT: 0x800736B1)
Some points:
On machines with sql server 2005 installed (from which that dll is copied) the app works. But the server does not have it, so I need to get it to work without sql server.
The file is in wwwroot/bin folder: Microsoft.SqlServer.Replication.dll
Do I need to include the file in References folder in VS? Set it to CopyLocal?
Any advice or solutions would be greatly appreciated
--MB
The Microsoft.SqlServer.Replication.DLL is part of the Replication Management Objects which in turn are part of the SMO pack. The only supported redistribution path for SMO is to use the installer that comes with the SQL Server feature pack download, see Distributing an Application That Uses SQL Server Management Objects. You must install the SMO redistributable packet on the server.

Resources