Compile a .dll file of dlib - c#

I want to import a script that uses Dlib. Problem is that it won't compile without .dll file of Dlib.
Is there any way to get it into my project?
I have .lib file but I don't think there is a way to convert that to .dll.

#ali I made a make file of the dlib file using c-make and then used visual basic to compile it but in export setting I changed the. Exe to. Dll

Related

How do I include a .jpg into a dll?

I have a third-party application that creates a dll file out my .cs code.
In my .cs code I reference a file.
How do I compile the dll or .cs to include the .jpg file along with the code?
The options I have for the third-party application does not allow me to export the .jpg
The import process only looks at the .cs and the associated .dll.
Is there a way to add the file to the dll once the third-party application has created the dll in the export process with visual stuido or something?
Yes this is possible. If the file is used by your code in the dll then the file needs to be embedded thorugh the Properties >> Build Action >> Embedded Resource setting:
(EDIT) Visual Studio Code variant
You have to edit the .csproj and change the node that represents your file to:
<EmbeddedResource Include="Resources\yourEmbeddedResource.json" />
Source:
https://starbeamrainbowlabs.com/blog/article.php?article=posts/180-Embedding-Resources.html;
https://www.codeproject.com/Articles/114997/Embedding-and-Using-Resources-from-Net-Assembly;
How to mark a file as an embedded resource in Visual Studio Code?;

Copy some files to projectDir when someone compile their project using my DLL

I'm not sure if this question has been asked or not.
I have created a DLL in C#. My DLL depends on other DLLs. When someone compile their project using my DLL, the other DLLs will get copy to the projectDir.
However, the other DLLs depend on some text files and some other executable files. The problem is that the text files and executable files don't get copy to the projectDir. Unfortunate, that will cause the project to crash when running.
My question is, how can I load those text files and executable files to the projectDir whenever my DLLs is compiled?
Thanks.
Depending on how you are sharing it you could also look at using Nuget to publish out your DLL. With Nuget you are able to specify and bring across dependent files and libraries that will be added to your any project just by including them as content in the DLL project.

How can I read a file from a c# project using a c dll?

Been searching high and low for this one and can't seem to figure it out.
So I'm making a web application in visual studio using c# project. There is another project in my solution, it's a c project that compiles to dll. I've gotten to the point where I can pass information between the two and it's working right.
In my application, the user uploads a file and it is saved to the file system in an "includes" folder. The dll (compiled from c code I got from an sdk) is supposed to read in that file and decode it. The dll project works fine when I compile it as an exe and send it a file path.
My question is, how can I get the DLL (now in the bin folder) to skip back a directory and grab this file? I've tried just hardcoding the file path into the c code but it doesn't work.
FILE *fp;
bool isWorking = false
if(fp = fopen("../Include/testFile.fit", "r"))
isWorking = true
I've also tried just writing to a text file from the DLL, hoping to find where it pops out and use that directory as a reference but the c code isn't creating and saving a file at all in that case.
The position of the DLL file in the file system is not important. The important part is where the resulting binary is run and what it sees as its current working directory.
If your C# program uses the DLL, the code in the DLL will be run with the same current working directory as the C# program (unless you change it in the code in your DLL).
So, you should try to load your file in the same way, with regards to path, as if you were to load it from your C# program.

Create .xml and .pdb files from .dll file

I have a .dll file from a Silverlight class library. How can I create a .pdb and a .xml file from this .dll file?
You can't. Whoever supplies the DLL must supply the auxiliary files too.
And if you have the source code you can generate them on your own by making sure you build as debug rather than retail/free.
Why do you want them?

Convert .cs to .dll

How can I compile a .cs file into a DLL?
My project name is WA. In my bin folder after the compilation, I found:
WA.exe
WA.vshost.exe
WA.pdb
You have to compile it:
csc /t:library source.cs -> source.dll
Are you using Visual Studio?
If you create a Class Library project in VS, add your .cs file and then compile the project, the output will be a .dll file.
You use a compiler. Csc.exe comes with the .NET Framework.
Check this link: http://msdn.microsoft.com/en-us/library/78f4aasd.aspx
You can also use an IDE like Visual Studio if you want the development process to be easier.
Its automatically created for you when you run a build in visual studio. Check the bin folder in your project folder.
For your information there are two kinds of DLL file which named "Managed" and "Un-Managed". Managed type is which you can use and add to your references in Visual Studio IDE.
However, if you want to convert each classes separately to Dll, you can use new windows application-> class library. After debugging and running that you can find DLL file in your source destination. Try it.
P.S: Usually you forced to use more than one class in one DLL file.

Categories

Resources