Include project reference in debug - vb.net

I built an online login program which connects to my online MySQL db. In my application i have used the MySQL.Data file as a reference since the program needed the file to connect to the online MySQL server. Now my question; when I take my program from 'C:\Users\User\Documents\Visual Studio 2010\Projects\MYPROJECT\MYPROJECT\bin\Debug' and copy that file to a completely other computer, I get an error message saying that the MySQL.Data file is missing. I want to know how I can include the MySQL.Data file in my project compile. If you need further details I am happy to provide them.

In the Solution Explorer of your project, you have the point References, where the MySql.Data.dll should occur. Right-click it and select Properties, and in the Properties make sure that Copy Local is set to True.
Then, the MySql.Data.dll file will always be copied to your bin/Debug folder.
If you deploy your program, you have to copy that dll, too. Then everything will work on the other computer.

You can build a setup project (installer), or copy the mysql.data.dll file with your exe (basicly everything in your bin/{config} directory).

Related

VB.net .exe cannot be run from another computer. Missing assemblies for ClosedXML

I must put this program into production today, and I can't get it to run independently.
In the program, I have included NuGet package "Imports ClosedXML.Excel" and use it to create spreadsheets. When I build my executable, and try to run it from another computer, it cannot find the ClosedXML and Documentformat.OpenXml assemblies.
I checked in References that "Copy Local" was = True for ClosedXML and Documentformat.OpenXml, but it's not working. I found another website that mentioned Global Assembly Cache, and that if the dependency is in there, it will not be included in the Build .exe.
I am running Visual Studio Professional 2017. I am in over my head on this one, so if you have answer (and I hope you do), please try to provide it in elementary terms I can understand.
Sometimes issue is solved by individually adding application files inside the following menu
Go to Publish-->Application Files
Select Show all files
Under Publish Status
Set the files you need to Include [not include(auto)]

SDL2_ttf can't find entry point unless libfreetype-6.dll is in proj folder

I am working with SDL2 and its add-on libraries SDL2_image and SDL2_ttf, using Visual Studio 2017. The libraries, and the .dll files that come with them, are in another folder (C:\SDL2.0\lib\x86), which is in the system path.
When I run, it fails, with this error message:
The procedure entry point InterlockedCompareExchange#12 could not be located in the dynamic link library C:\SDL2.0\lib\x86\SDL2.ttf.dll.
I can fix this by putting libfreetype-6.dll, which comes with SDL2_ttf, in the same folder as the .vcxproj file; or in the Debug folder. I can also fix it by putting the .dll into c:\windows\SysWOW64. But I want to distribute my code, and I don't want to put that file in each folder or require users to have admin access (to access c:\windows\SysWOW64); I want Windows to find it in the PATH, as it does with the other .dll files it's using here.
A few things I tried as I looked around the web for solution (to no effect):
Recompiling libfreetype-6.dll
Downloading the latest versions of all associated libraries
Rearranging the .lib files in Project Properties, Linker, Input, Additional Dependencies. Admittedly I may not have tried all possible arrangements as there are several dependencies
regsvr32 libfreetype-6.dll. This led to a different error message:
The module "libfreetype-6.dll" may not be compatible with the version of Windows that you're running. Check if the module is compatible with an x86 (32-bit) or x64 (64-bit) version of regsvr32.exe.
I saw here that maybe I should use the version of regsvr32 in the system32 folder; when I do that, I get
The module "libfreetype-6.dll" was loaded but the entry-point DllRegisterServer was not found. Make sure that "libfreetype-6.dll" is a valid DLL or OCX file and then try again.
So: is there a way to get the program to find libfreetype-6.dll in another folder in the PATH, and eliminate the error message about the procedure entry point?
The program I'm testing on now is from the TrueType tutorial from the LazyFoo website (source).

Include vb.net modules in compilation

I have created a program in vb.net using Visual Studio Express 2013, and I compile it there, it works fine except the modules. It doesn't include mysql.data (which is essential to the application). How do I include these modules in the compilation? (I already tried putting the .dll in the solution explorer.)
All you need to do, is to include the file in the project by: Right-Click on solution > Add file.
Once done, set “Build Action” to “Content” and its “Copy to Output Directory” mode to “Copy if newer” from the properties window.
Go to Add Reference and Add .DLL file reference using browse option.

Include RIA Services in Solution without usual installation

I want to use WCF RIA Services without need to install this. My idea is just to reference the libraries:
Microsoft.ServiceModel.DomainServices.Hosting.dll and Microsoft.ServiceModel.DomainServices.Tools.dll
in my Solution Libs folder.
This avoid overhead for devs and even for deployment.
This solution creates some evil hide monster? I forgetting something?
*I tried this and, well, "It works in my machine" until now.
If you reference DLL´s that are only on your development machine, make sure your reference doesn´t point to the Globsal Assembly Cache. Otherwise the other developers can´t find the reference.
Also selecting ´Copy Local´ for the references will make sure they are copied to the bin directory so you can deploy the solution with the necessary dll´s included.
I would suggest storing the actual dll files in a References folder in the root of your project. Then add them to your project through visual studio. Once you've done that add the hintpath node to the actual project file for each reference, which will tell VS where to look for the file. This method works great especially if you are working with multiple projects because then you dont have to copy the dll files to each bin directory.

cannot access because it is used from another process

Well suddenly when I’m trying to run my project from the debugger in Visual Studio 2010 It gives me this error:
Error 40 Unable to copy file "obj\x86\Debug\AssetsManagement.exe" to "bin\Debug\AssetsManagement.exe". The process cannot access the file 'bin\Debug\AssetsManagement.exe' because it is being used by another process.
Please is there someone how knows why that happens?
I have already delete the x86\Debug subfolder and te bin\Debug subfolder but nothing happen
Especially in the second folder the only file which cannot deleted was the the .exe file Also with the same error.
Most of the time when I see this error I go look in task manager and I see a VSHost file for my project running. You can't kill it, it just comes back. It's gotten to the point now I always uncheck enable visual studio hosting on the debug tab when I start a new project.
Try commenting out AssemblyVersion in AssemblyInfo.vb and performing a build.
Assembly: AssemblyVersion("1.0.0.0")
This has worked for me.