Can't get feature reporting to work on console app
smuda
Posts: 24
Hi All!
I have three apps (1 winform and 2 console apps) that I'm trying to enable feature usage reporting on.
All is well on the winform and one console app, but the last console app doesn't show the "Would you like to send feedback..." question. The one thing that puzzles me is that at first run the console application automatically adds a registry entry "SmartAssemblyReportUsage" with the value of "False". If I change the value to "True", feature reports are generated.
What have I missed to get the "Would you like to send feedback..." question?
I have verified in the project that FeatureUsage Reporting is enabled with the standard template provided by SmartAssembly "With consent dialog box on first run".
From the saproj file:
<FeatureUsageReporting ReportUsages="1" Template="res:SmartUsageWithUIConsentFirstRun1033.dll" />
Best Regards,
John
I have three apps (1 winform and 2 console apps) that I'm trying to enable feature usage reporting on.
All is well on the winform and one console app, but the last console app doesn't show the "Would you like to send feedback..." question. The one thing that puzzles me is that at first run the console application automatically adds a registry entry "SmartAssemblyReportUsage" with the value of "False". If I change the value to "True", feature reports are generated.
What have I missed to get the "Would you like to send feedback..." question?
I have verified in the project that FeatureUsage Reporting is enabled with the standard template provided by SmartAssembly "With consent dialog box on first run".
From the saproj file:
<FeatureUsageReporting ReportUsages="1" Template="res:SmartUsageWithUIConsentFirstRun1033.dll" />
Best Regards,
John
Comments
Sorry, I don't know what could be wrong. The "first run" dialog should come up and set the registry key according to the user's wishes.
The "standard template" should be embedded into your assembly so if it's not coming up I probably couldn't tell you why not without seeing the assembly.
Yes, I'm trying to handle feature usage in the common dlls for the three projects. However, since I read somewhere that to get the feature usage template working I need to set the ReportUsage on the entry method, which I've done for both the console apps:
I'd be happy do upload the obfuscated assembly, project file or even the input assemblies to you, if you think it can help.
John
According to this you don't have to do anything to the entry point.
As far as I can work out from the source (and maybe this is a bad assumption), you should be able to get the user request box back up if the SmartAssemblyReportUsage registry key does not exist or has no value.
Is there any logging that can be enabled for the feature usage within the merged assembly?
I suppose the default template is the one included in SA. If you look on line 21 it sets the registry value to false and AskUserForReportUsageConfirm(). If something happens there it will have the exact same behavior that I'm experiencing. I think I'll try with a custom template (based on this) with more error handling.
Best Regards,
John
This means that when the console app is done on it's thread, all background threads are simply dismissed.
I added a Thread.Sleep in the console application and the dialog for the user pops up nicely. I can wait and then see it disappear once the application ends.
:idea: Perhaps there could be a checkbox to NOT make the thread a background thread in the saproj settings would be a good thing?
:idea: I note that once the reporting is added, the application takes another half second (roughly) to end and I suppose this is because of the actual reporting. During that time, you could also check if the reporting thread you spawned which is waiting for the user input has ended. Perhaps a Thread.Join would be a good thing at that point?
Best Regards,
John
I'm told the idea is not to leave a console process hanging,waiting for input, if the dialog comes up. Apparently we are already looking at alternate ways of "opting in" on console applications.