Assembly version from command line?

This is an area where PowerShell shines. If you don’t already have it, install it. It’s preinstalled with Windows 7. Running this command line: [System.Reflection.Assembly]::LoadFrom(“C:\full\path\to\YourDllName.dll”).GetName().Version outputs this: Major Minor Build Revision —– —– —– ——– 3 0 8 0 Note that LoadFrom returns an assembly object, so you can do pretty much anything you like. … Read more

Old DLL file keeps being used

It hides it in the GAC. There it may reside indefinitely. Using a more recent version may indeed solve the problem, but there is an outstanding bug in Visual Studio that has to do with choosing the correct version of DLL files. (If DLL Hell wasn’t bad enough, the Visual Studio team is making it … Read more

Can you remove an Add-ed Type in PowerShell again?

Like the others say, this is a .NET behavior. Assemblies loaded into an AppDomain cannot be unloaded. Only the AppDomain can be unloaded, and powershell uses a single appdomain. I blogged a bit about this some years ago: https://web.archive.org/web/20170707034334/http://www.nivot.org/blog/post/2007/12/07/WhyAppDomainsAreNotAMagicBullet When I test like this, I usually keep a shell open and use a nested shell … Read more

How do I find out which dlls an executable will load?

dumpbin is a tool that comes with VC++. To see what DLLs a program will import: Open Visual Studio Menu Item Tools | Visual Studio Command prompt cd to folder containing executable dumpbin /dependents whatever.exe Dump of file whatever.exe File Type: EXECUTABLE IMAGE Image has the following dependencies: AIOUSB.DLL sqlite3.dll wxmsw293u_core_vc_custom.dll wxbase293u_vc_custom.dll KERNEL32.dll ole32.dll OLEAUT32.dll … Read more