I want to implement a single file generator (aka custom tool) in Visual Studio.
Over the last couple of days, I have checked out loads of examples. So far, I've managed to have no success in getting these to run. Tonight I found what looks to be the best example here... https://github.com/Microsoft/VSSDK-Extensibility-Samples/tree/master/Single_File_Generator
the readme.md file includes a set of steps to follow to get it to work. However, as per every other example that I have tried so far, the result is the same.
Cannot find custom tool 'XmlClassGenerator' on this system.
I've tried examples of stack overflow, code project, various blogs, and now github. All of which end in the same result. I've pored over the registry looking for my class guids, looking to see if everything is installed as per the instructions from all the examples that I've followed, including the MSDN website.
Every time, I end in the same frustration. Can anyone help to get this example working?
Here's the steps that I followed
Here's the steps from the readme.md file that I followed
I've also built a brand new Virtual machine with windows 10 pro N installed, and visual studio 2015 community edition, so I have new tried this on two seperate machines with the same result. For those interested in step 4, I used the content of the Example.XmlFile.xml.
Further update.
In addition, I've performed a nuget up date on the solution as there were a couple of updates available.
Next, I have added set the "Register for COM Interop" flag in the solution build properties.
Executed C:\Windows\Microsoft.NET\Framework\v4.0.30319\RegAsm.exe /tlb Microsoft.VisualStudio.Shell.Interop.dll
Still have the same issue at this point. But at least everything is up to date and building.
Next I've performed a search on the registry to see that the guid is correctly registered. And I've manually added an item into the generators registry key under HKey_Local_Machine\Software\Wow6432node\Microsoft\VisualStudio\14.0\Generators{FAE04EC1...}\XmlClassGenerator This has values for CLSID and GeneratesDesignTimeSource
At this point, I'm still getting the same error "Cannot find custom tool 'XmlClassGenerator' on this system.
One last thing that I'm trying is putting the registry stuff under
HKEY_Current_User\Software\microsoft\visualstudio\14.0_config\Generators{FAE0...}\XmlClassGenerator
And again, this has no effect.
Final thing that I had to attempt. I've just added the GeneratorSample.dll to the GAC and again no effect.
After much looking around and struggling. I decided to follow this guide to the letter, and it worked.
http://www.codeproject.com/Tips/1023337/Custom-Tool-Single-File-Generator-for-Visual-Studi
The things that I've done different from the above is to put the dll in c:\program files\Tool. In addition, I've also put the registry entry only in HKey_Current_User....\14.0_Config\Generators
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With