Closed binpick closed 6 years ago
I noticed that i am not able to save the boilerplate template settings. After e.g. resetting to default, i see the default template. After selecting ok and opening the settings again, all fields are empty.
Do you get any more details for the exception, like the stack trace? Or does it only say that it threw an exception and not tell you anything else?
No, there is no stacktrace, just this exception message. Don't know if there is a log file somewhere?
Can you uninstall the extension and try this one? I added more logging that should tell me what's going on: http://engy.us/misc/UnitTestBoilerplate.vsix
Thank you. I installed it and get the same exception. Where do i find the log file?
Btw, i have this issue on different computers.
...forgot to mention, great extension. I am using it in all of my projects, hope we can fix it :-)
UTBG Self Test -> Run: "Sequence contains no matching element"
If i reset UTGB settings to default, Visual Studio hangs and then it crashes (after pressing OK).
This is from the windows event view:
Application: devenv.exe Framework Version: v4.0.30319 Description: The process was terminated due to an unhandled exception. Exception Info: System.IO.FileNotFoundException at UnitTestBoilerplate.StaticBoilerplateSettings..cctor()
Exception Info: System.TypeInitializationException at UnitTestBoilerplate.ViewModel.FileContentsOptionsDialogViewModel.Apply() at UnitTestBoilerplate.View.FileContentsOptionsDialogPage.OnApply(PageApplyEventArgs) at Microsoft.VisualStudio.Shell.DialogPage+DialogSubclass.WndProc(System.Windows.Forms.Message ByRef) at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr, Int32, IntPtr, IntPtr)
So seems that i cannot save/load the settings. That's why the fields are empty when opening the settings. After resetting to default, VS crashes. Where are the settings stored?
In VS 2017 Community the extension works.
If you open VS, then right click on a file and select "Create Unit Test Boilerplate..." it should open a dialog box with more details this time. But that stack trace in the event log should give me somewhere to start, thanks.
After right click i just get the expcetion window:
I compared the settings of VS2017 and VS2015 in the registry and i noticed that the key where the settings are stored is missing for VS 2015. This explains why i am getting empty fields when opening the settings in VS 2015, but i don't know the reason.
VS 2017 (missing in VS 2015):
So seems that i cannot write the settings into the registry. Probably it is not a UTGB bug but a VS bug, but i dont' know the reason. I have it on different PCs.
Hmm, I installed VS 2015 community and everything is working fine over here. I'm rather surprised you're seeing the issue on multiple computers. What OS are you running?
One thing to remember about the registry is the \VisualStudio\14.0 is for VS 2015. In VS 2017 (which is version 15, I know, confusing), whisks the registry settings off to some private place:
\REGISTRY\A{f3b03746-a87a-c8bf-6859-2869b2937396}\Software\Microsoft\VisualStudio\15.0_a703f143\UnitTestBoilerplateGenerator\Template_VisualStudio_Moq_File
I'm also a bit surprised that with that .vsix you're still getting the old error dialog, as I put a giant try/catch around the StaticBoilerplateSettings static ctor. Are you sure you uninstalled the previous version?
Hi, i am running Win10. I am going to deinstall the current version again, clean up the extension folder and reinstall it.
I reinstalled and get the same error. Only the message box with the exception message. I do have the new version installed since i have the Self test menu, which i had not before. When trying to reset the settings VS crashes.
Curses! It sounds like something is causing SettingsManager.GetWritableSettingsStore to throw a FileNotFoundException, but I can't reproduce it. I'm running Win10 as well.
I'll try it on a clean Win10 VM.
Okay reproduced the error. Apparently Visual Studio stopped including Newtonsoft.Json in the VSIX output for some reason. Now I need to figure out why and how to include it again.
Should be fixed in 1.7.1.
Awesome. Thank you for the support, works like a charme.
Leave a review on the gallery page if you like the extension!
You'r right, i did it.
Installed product versions
Description
This extension was working for a time. Now, every time i try to create a new xx i get the exception:
"The type initializer for UnitTestBoilerplate.StaticBoilerplateSettings threw an exception."
Steps to recreate
Current behavior
No unit test file is created due to the exception.
Expected behavior
A new unit test file should be created.