Using Other Programmers Custom Controls - dll

I am using Scott Mitchell's textBox Characters and Words counter control, i downloaded it from the website https://web.archive.org/web/20211020202742/https://www.4guysfromrolla.com/ and unzipped it to my desktop. then in VWD Express 2008, i created a new tab in the Toolbox, i chose the *.dll from the unzipped folder, i used the control, all is fine (try it, i recommend it) but when i backed up my code, copied the site, and tried to run it on another computer, i got a bunch of error all indicating that its looking for the dll file on my desktop, but when i checked under my bin folder in my website directory, the dll is there...
Help Plz...

If you view the properties of the reference you'll probably find that the path to the reference is incorrect.
I have often found that the quickest way of fixing the problem is to open the project file with notepad and correct the path to the reference.

Related

In VStudio 2019, VB, .NET-5: for a ClickOnce installed app, how do I locate the application's data directory at runtime?

My VStudio is 2019 Community, the application is an old VB Windows/Forms app being brought forward from .Net-3.5-ish to .Net-5.
Under .Net-4.8 or earlier, using the namespace System.Deployment.Application, one could access ApplicationDeployment.DataDirectory to locate that artificially-generated directory in \Users\Username\AppData\Local\Apps\2.0\... that a 1-click installation would create and populate with data files from the Project Build/Publish.
Under .Net-5, I believe that particular set of functions has been taken out - yet the ClickOnce installer still places Data files there. How do I programmatically locate that directory? The Application Path can be located from System.AppContext.BaseDirectory, but that doesn't help in locating the data.
This app, an old bit of VB code, has a large number of application data files that need to be installed along with the code. As there are more than 40 of them, we've kept them in their own \Data directory, which is included in the Project, is under Git control to keep their versions aligned with their code...
In an uninstalled app, we could keep this \Data directory adjacent to the executable, and find it easily at runtime: but with a ClickOnce installed app, that falls apart. In the Publish configuration, all the data files are identified, with Group=Required, Publish Status=DataFile.
Can I either:
Easily configure the 1-click installer to place our \Data directory and its contents into one of the standard \Local\Appname or \Roaming\Appname directories that seem to also get created, but left empty? Those can easily be located at runtime.
Easily construct at runtime the path to that obscure data directory that 1-click normally creates and uses for data?
Cheers, and Thanks! Bob

Cannot get PDB to load. "A matching symbol file was not found in this folder."

I've got a project that debugging was working just fine about an hour ago, and now after the latest rebuild I can't get it to load the symbol files, so I cannot hit my breakpoints.
I've tried everything suggested here on Fixing “The breakpoint will not currently be hit. No symbols have been loaded for this document.” and cannot get it to load my PDB. There are a ton of questions on .PDB files not loading here on SO and I've spent the last hour going through as many of them as I can and trying everything suggested, but to no avail.
I've tried Build>Rebuild Solution, Build>Clean+ Build>Build Solution, Build>Clean + Build>Rebuild Solution, manually deleting all files from the BIN output folder + Build Solution and/or Rebuild Solution. The same thing happens in each case; the compiler creates a brand spanking new .DLL and .PDB file, yet the .PDB refuses to load at runtime.
I've even tried Debug>Windows>Modules>[Right-Click on offending symbol library]>Load Symbols and I manually browsed to the correct .PDB file, but when I hit Open it just tells me "A matching symbol file was not found in this folder".
Using Debug>Windows>Modules>[Right click...]>Load Symbol Information gives me:
C:\Windows\ssoederPDMupgrade.pdb: Cannot find or open the PDB file.
C:\VS_TestFolder\EPDMAddIns\ssoederPDMupgrade\bin\Debug\ssoederPDMupgrade.pdb:
PDB does not match image.
C:\VS_TestFolder\EPDMAddIns\ssoederPDMupgrade\obj\Debug\ssoederPDMupgrade.pdb:
PDB does not match image. C:\Windows\ssoederPDMupgrade.pdb: Cannot
find or open the PDB file.
C:\Windows\symbols\dll\ssoederPDMupgrade.pdb: Cannot find or open the
PDB file. C:\Windows\dll\ssoederPDMupgrade.pdb: Cannot find or open
the PDB file.
C:\Users\ssoeder\AppData\Local\Temp\SymbolCache\ssoederPDMupgrade.pdb\afe14027e9c6490883d12f2f139cb5911\ssoederPDMupgrade.pdb:
Cannot find or open the PDB file.
C:\Users\ssoeder\AppData\Local\Temp\SymbolCache\MicrosoftPublicSymbols\ssoederPDMupgrade.pdb\afe14027e9c6490883d12f2f139cb5911\ssoederPDMupgrade.pdb:
Cannot find or open the PDB file.
C:\VS_TestFolder\EPDMAddIns\ssoederPDMupgrade\obj\Debug\ssoederPDMupgrade.pdb:
PDB does not match image. SYMSRV:
C:\Users\ssoeder\AppData\Local\Temp\SymbolCache\ssoederPDMupgrade.pdb\AFE14027E9C6490883D12F2F139CB5911\ssoederPDMupgrade.pdb
not found
SYMSRV:
http://msdl.microsoft.com/download/symbols/ssoederPDMupgrade.pdb/AFE14027E9C6490883D12F2F139CB5911/ssoederPDMupgrade.pdb
not found
http://msdl.microsoft.com/download/symbols: Symbols not found on
symbol server.
Not much of an answer but...
I think something became corrupt in VS Express 2013. I have no idea how or why - and I may be totally wrong here, but the simple matter is what got my breakpoints working was installing VS Community 2015.
After installing VS Community 2015 (VSC 2015) the symbol file loads without problem, and all breakpoints are hit. This also got everything working in my existing VS Express 2013 (VSC 2013) installation, so I can work in either one now without problem.
Event timeline:
I've been working in VSE 2013 on this same project for a month or two now. Writing a class library, debugging using Debug>Attach to process.
I made some changes yesterday to code within a single class module (no other changes) and used Build>Rebuild Solution to clean and re-generate the current configuration (DEBUG) output files.
Event horizon: I went to debug using Attach to process as usual, and my break point appeared hollow with the message it would not be hit because no symbols had been loaded.
I spent quite a bit of time trying to work this out before posting here (see my original question for details on what was tried).
Received suggestion from #HansPassant regarding use of Symchk from command line. Tried to follow instructions linked to and was unable to get it working - command line didn't recognize Symchk or Symchk.exe as valid commands/processes/etc.
I downloaded WDK 8.1 update and installed.
Opened VSE 2013, received an error message regarding a driver failing to load, application froze before loading up. Actually, after trying multiple times I found it would sometimes get to the welcome screen - but remained unresponsive even then.
Went on M$ VS site to download latest copy of VSE 2013 installation files to do a repair-install, and I noticed there was a newer version: VSC 2015.
Downloaded and installed VSC 2015.
Opened project, started debugging by using Debug>Attach to process and it worked - all symbols loaded and my breakpoints worked. NOTE: I changed nothing with the project * - just opened it and ran.
* unless some changes are made by the IDE unbeknownst to me just by opening the project.
This seemed to repair whatever driver was corrupted in the VS2013 install as well, as I went back to VSE 2013 and it opened without error AND I was able to open the same project and do Attach to process and all symbols loaded and breakpoints are working again.
I had the same problem with VS2013 Ultimate. I did a clean and build of the assembly several times, and I deleted all temporary files from C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files.
I also verified that in "Debug -> Options and Settings -> Symbols", there were no modules excluded... in the end, I found a reference that was different from that deployed into the GAC.
I'm glad you got it to work CBRF23! I had this problem when trying to compile a DirectX effect file in DevC++. The easiest way I found of downloading pdbs is to first download WinDBG here:
http://go.microsoft.com/fwlink/p/?LinkId=536682
Then as an example, say you want to download d3dx9d.pdb. copy d3dx9d.dll from C:\windows\system32 and paste another copy into your (debugger) windbg symchk.exe folder, then connect to your internet server, go to the windows start menu, Run: [then type] cmd [press enter], next go to the windbg debugger folder by going to the Command Prompt (MS-DOS Window)
(if it's in the C:\windbg_6p12p0002p633\debugger_x86 folder for example, then type):
cd windbg_6p12p0002p633[enter]
cd debugger_x86
[and finally type the following but change the double asterisk** to one asterisk *:]
symchk /if d3dx9d.dll srv**c:\symbols*\mainserver\symbols*https://msdl.microsoft.com/download/symbols
Please note again, that there is only supposed to be one asterisk after srv (the post would interpret an asterisk as italic or bold), not two then it will open symchk.exe and download the pdb symbol file associated with the inputted dll into the created C:\symbols\ folder automatically!
Did you try these steps?
1- delete the .SUO file
2- make a CLEAN BUILD.
3- make a BUILD PROJECT

vb.net Solution file module windows disappeared(Visual Studio 2013/copy and paste)

I am not familiar with the development environment of Visual Studio, but I really need help on this problem or I cant open the file again.
It is a finished project and I copy and paste it in another file on the same hard disk of my computer, while I didnt copy the solution file but only the file with those bin, My Project, obj and etc included in it.
Then I rename the file name in the window explorer, while the .vb , .vbproj and .resx file stay in the same name as the original file did.
When I try to open the Project through the Solution file, weird things occur, all those modules windows disappeared, those design form, the .vb modules, all disappeared, and in the Solution Explorer, instead of showing the OriginalFile.vb, it shows the renameFile.vb, then I deleted the renameFile, and try to open it again, and yet, the problem is still not solved, the Solution Explorer is still showing the renameFile.vb, and I have no idea what is happening, since I really dont know how the file of Visual Studio works.
There are error messages showed on the list, it is,
Unable to open module file 'F:\RenamedFile_Location.vb': System Error &H80070003&
from line 1 of both RenamedFile.vb and RenamedFile.Designer.vb
I tested the program in the Release/Debug file in the OriginalFile, and the program still works, but still cannot open the Solution file
Any help and suggestions would be appreciated, I dont really understand why and how does this problem occurs, so if it is not able to be solved, I am going to redo my whole project.

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

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.