Adding a custom theme as a resource - vb.net

I have a custom theme.dll. My program works fine loading the DLL externally. What I am trying to do is make the theme and the program as one file. I added it as project resource, however I don't know if it will work or how to code it.

I got my problem solved! I merge the theme.dll and the Application.exe using ILMerge.
Copy the DLL and the Application.exe into the ILMerge folder
Open command prompt in the current folder ( SHIFT + Right Click )
Type in this command
C:\ilmerge> ilmerge Application.exe theme.dll /out:MergedApp.exe /target:winexe /targetplatform:"v4,C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6.1"
*I know this answer is not how to add a custom theme as a resource, but this solves my problem to make the DLL and EXE as a single file.

Related

Create an EXE that has files in it

I want to create an Exe that copies files to a directory on the c drive.
So I want it to this.
I have added the files to the project.
And when I run the code. It copies the file.
My.Computer.FileSystem.CreateDirectory("C:\direcotory1")
My.Computer.FileSystem.CopyFile("file1", "c:\direcotry1\file1.dat")
The above code works, but...
After I compile if I move the exe out of the source directory, it doesn't work. I have to leave the exe in the directory where the file is.
Phrased another way. IF the exe is not in the directory it gets compiled into by Visual Studio. Then it cannot find the file to copy.
I know people do this all the time, but I am not sure how to get them in there.
Properties are set to content, or embedded resource don't seem to make a difference.
Can anyone give me the piece I am missing?
Thanks
Dan

Remove the PDB file/functionality from Lib

I'm stuck in the following situation, I have been asked to rebuild a website, the original site was built and the solution had 5 projects, 4 of these where the different data layers and one of them was the actual website.
I only have the dll's of the 4 projects, so far I've managed to rebuild the website and adding the dll's to my project gives me access to the Entities and Repository layer etc... everything builds fine.
The problem is that when I run the project the debugger is trying to look for the Source files of the dll's that I've added which I don't have. Is there a way to remove the PDB file/functionality from the dll's that I've added? I don't need to or want to debug those dll's as I know that they are working correctly... and I dont have the code to change them if they arent.
Or to ask it in another way, is there a way to add them to my project and force them to not run with the Debugger?
Thanks
Ok, so to solve this problem I had to decompile the lib's of the four projects, create and place the code files in the exact directory that is specified in the PDB files and then compile and run the website.
I dont think it cared that the source files didn't compile again, it just needed to know that they where there.
After running the site i could delete the created path and source files and I haven't had a problem since.

Include and Call PDF File in vb.net (after Deployement)

Glad to see this site, Thanks guys for being active. :)
I have a problem in Visual Studio 2010/VB.Net
I have windows form in Visual Basic, I deployed the software(form) to one installer
Now I want to open My PDF file( i-e: Specific) with Button_Click_Event
I know that:
Process.Start("MyPDF.pdf")
But I dont know if user install my software in his PC so may be he install the software in C D or other directory, and also I dont know How to include PDF file in my project :)
Please suggest for me, I am searching this every where but failed so pl help me
Use Add->Existing Item on your Project. Then add the PDF File to your Project.
Afterwards you have to set the Properties of the newly added file to the following:
Now the file will be added to your "Output" Directory after you build your Project.
Now use your Process.Start("MyPDF.pdf") call. It will open up, as it resides in the same directory.
This is rather easy:
Simply include the file by dragging it to your project folder and in its options, tell it to copy to the build directory.
Thereafter, find the path through the my.application methods.
Build a correct path from that and launch it via process.start

Build VC++ project with additional cpp file using MSBuild

I need to build VC++ project (made in VS2008) from command line using MSBuild with additional .cpp file which isn't part of this project (doesn't listed in section of .vcproj file.
Is there are any way to do this? (e.g. just by passing filename to command line input).
Editing .vcproj file by my script is also is a option but I save it for a worst scenario when there are no way to do it just with MSBuild.
I don't think you can point MSBuild at a project file and tell it to build this project and add another file at the same time. I'd either update the .vcproj file to include the file you're trying to add or go for the script-driven editing approach. Actually, I'd probably just change the .vcproj file as I'd think this is the safer approach and less likely to break something.
You can add the file to the project if it's in the same directory.
If it's shared / in another directory you can try adding as a link.
In the Add / Existing Dialog notice the Arrow on the edge of the add button. Try clicking it.

Where should I place the DLL?

I downloaded an itextsharp DLL that I would like to use in my vb.net 2008 express application.
In which folder should it be placed?
I went into choose items in the toolbox and tried to add it but I got an error
This is what I downloaded:
http://sourceforge.net/projects/itextsharp/
You need to reference the DLL inside your project: right-click on the project in solution explorer and then select Add Reference and next select itextsharp.dll. It will then be automatically copied to the project output folder alongside with the executable (usually bin\Debug)
It shouldn't matter where the DLL is places. Download the correct compiled DLL to your computer.
Open your VB.NET solution -> Right Click -> Add Reference...
Browse your PC for the DLL you just downloaded and let Visual Studio do the rest.
Typicaly you put the dll in ANY directory and set up a reference to it. When compiling, VS adds this dll to the bin directory of the application automatically.
Something to keep in mind is that there are no objects from the DLL you can put in and use from the Toolbox; you need to programmatically create iTextSharp objects.
Like this:
Add Imports:
Imports iTextSharp.text.pdf
And in your code:
Dim writer As PdfWriter = PdfWriter.GetInstance(document, iostream)
Maybe it's better to copy the additional dll file inside your project, so that when you pull it again from git server, you don't need to copy it again.