How to get PublicKeyToken from GAC - gac

I have been following this guide, which goes over adding a file to GAC with gacutil.
I have completed this step but I can't seem to read the Keytoken from the file.
It says to navigate to the assembly you added to the GAC, right click and view properties. How ever when I do this the PKT is mentioned no where on the properties pages.
Assume I have misinterpreted something here as no one else seems to be having this problem, where have I gone wrong? How do I view the PublickKeyToken?
Edit: resolved.
It's this easy.

Turns out you can use "sn.exe" from Visual Studio Command Prompt.
Guide.

Related

Library failed to load 'dll' in LabVIEW

I want to use this project face_eye_detection.zip.
When I run it I get an error 'library failed to load',
So I changed the dll link
but the problem remains the same, I even change the dll link and it doesn't work.
Where exactly is the problem? In the link above, the program worked well with the others
Double check that it is a c++ dll and not a dotnet dll, that one has got me before.

VS2017: Solution builds but publish fails

I have a solution with 3 Websites and 1 Web API project. When I build the solution there is no issue but when I publish the Web API project to file folder, I get a lot of errors and the publish fails. One of the error is:
Error CS0006 Metadata file
'D:\Projects\MyAppName\Code\MyAppName\BusinessObjects\bin\Release\BusinessObjects.dll'
could not be found.
Other issues are similar to:
Error CS0246 The type or namespace name 'Amazon' could not be found
(are you missing a using directive or an assembly reference?)
I have checked in the project. The referenced DLL(Amazon) is available and this issue doesn't occur when I build the solution.
What could be the issue? I have also checked if there is any missing file(checking for yellow exclamation icon in front of file name) but I couldn't find one.
VS2017: Solution builds but publish fails
(According to the error messages, they are all common errors. we could not give the most direct correct answer for this issue, we can only give you some troubleshootings. In order to avoid losing contact in the round-trip comments, I post those troubleshootings as answer instead of comments.).
You can try:
Clean solution then rebuild it.
Go to Solution Explorer. Right click on Solution. Go to Properties. Go to Configuration Manager. Check if the checkboxes under Build are checked or not. If any or all of them are unchecked, then check them and try build the solution again.
Remove the project reference and then adding it back in again, and check if all those missing dll file exists in the bin folder.
Delete bin/obj folder, build again and try to restart Visual Studio.

Cannot register DLL using WiX

I am trying to register a DLL using WiX. Now I know and understand that I should use heat and get it to pull the registry information for me, but heat seems to fail with the following error message: heat.exe : warning HEAT5150 : Could not harvest data from a file that was expected to be a SelfReg DLL: C:\Users\seb\Desktop\Development\addin.dll. If this file does not support SelfReg you can ignore this warning. Otherwise, this error detail may be helpful to diagnose the failure: Unable to load file: C:\Users\seb\Desktop\Development\addin.dll, error: 193
I've looked around and found this post which explains a bit more in detail about registering DLLs but I would like to avoid the self registration route if possible. I also see mention of manually registering the DLLs further down below, but I'm not too well versed with the registry or COM objects that well to know where I could even get the CLSID, ProgId, and any other information that has been mentioned.
If anyone can point me in the right direction or explain to me what I need to do to run the DLL through heat it would be greatly appreciated.
I know this is old but I wanted to add an answer here - the reason this occurs is because the dll you are trying to register is 64 bit dll - and Heat.exe is 32 bit so it cannot load the dll in its address space. Anyway, just point to a 32 bit version of the dll to create the wxs file and you should not receive that error.
Is this an unmanaged / native DLL? Does Dependency Walker show any missing dependencies? Usually this means the DllRegisterFunction failed and Heat couldn't extract any data. Fix that problem and you should get good XML meta.
I was getting same problem with Wix heat.exe : warning HEAT5150 : Could not harvest data from a file that was expected to be a SelfReg DLL. The reason is dll was unable to find dependency to load. I think you must be having similar problems. I ran Process Monitor tool and applied filter to capture heat.exe event. I was able to find the root cause of the problem. Basically I had to put all dependency dll to same location where my main dll was. For your case addin.dll needs to point to the same location where your dependent dll's are.
The following blog about this warning helped me lot to figure out root cause.
http://marc.durdin.net/2009/12/case-of-hidden-exception.html?

Microsoft Visual Studio: How to find where a dll is loaded from?

A wrong version of a dll (MSVCR90d.dll instead of MSVCR90.dll) gets used for the delete operator, causing a crash. In the callstack, only the dll name is shown, not their path. How to see the path?
Edit: I'm building in Release mode, not in debug mode. So why does the debug dll get used? I have seen the same problem reported on many other websites, but could find no working solution.
Yesterday I found using Dependency Walker that the debug dll is getting picked up, so I renamed the dll, then the release version got picked up in the Dependency Walker, and also my program did not crash. I didn't change anything today, but the program has started crashing again. And when I see the dependency walker tree, it shows MSVCR90d.dll (the debug dll) with a question mark, saying it couldn't find it in the path. Why can't it pick up the release dll? Also I don't know from where the debug dll gets used by the runtime.
You can add them in your global PATH environment variable. Refer here
You can specify the dll manually by right clicking on the solution and selecting Add Reference, then browse to the particular dll.
You can add the path to the DLLs to the Executables files settings under Tools > Options > Projects and Solutions > VC++ Directories
For finding out the details of a dll, you might want to use DependencyWalker
However, in your case I think d is being appended to the name of dll, probably because you are creating a DEBUG build, and for that corresponding DEBUG versions of all dlls are loaded.
If you choose to create a RELEASE build, you would not have a d appended to MSVCR90.dll
You don't need to know Dll path, you need to understand why Debug version of delete operator is called. Maybe, _DEBUG constant is defined in Release configuration.

Where is App.config?

I'm trying to set up logging with Microsoft's Enterprise Library (log4net seems to be a dead project). I'm using VB .NET 2008 and VS 2008. I've searched all over the MSDN documentation, CodePlex docs (including the Hands-On labs that installed and then vanished), and online tutorials to no avail.
They all refer to a mysterious "configuration file" or "App.config" that I can't find and can't seem to add. I even tried adding a new text file and renaming it "App.config" but that only made VS 2008 spit out a red wavy line on a blank file.
Any suggestions for finding the elusive app.config would be greatly appreciated.
(and, if that makes the EntLib configuration tool show up, I'll be absolutely delighted)
Edit:
I've been tricked!
The tree in VS 2008 isn't a true superset-subset relationship, which is why I got so frustrated.
To wit, the top of the tree:
alt text http://static.zooomr.com/images/7954203_910064e809.jpg
And a 'sub-section' of the tree.
alt text http://static.zooomr.com/images/7954204_69e03c8502.jpg
Im pretty sure you can use web.config if youre in a web app or web solution.
Otherwise, see here
[EDIT] In my VS the app file can be added like:
Add new item -> General -> Application Configuration file
Should be in the same directory as binaries, but you have to add it to your solution first, using Visual Studio window for adding new files to soultion.
Add -> New Item -> Application configuration file
You can add an app config file to any vb project by
right clicking on the project -> Add-> New Item -> ...
and selecting either
Application Configuration File
or selecting
Web Configuration File
(for app.config or web.config respectively)
Wanted to add my $0.02 as I stumbled on this question with frustrated googling, and my situation wasn't as others have described here. I created a new winforms project, didn't see app.config, and went to add it as others have described. Wasn't in the list. I turned on "Show all files" in Solution Explorer, and it was already there, but not a part of the project. Right clicked on it and selected "Include in project," and now I'm good to go. No idea why it created the file, but didn't include it in the project. (This is VS2010, btw.)