Author Topic: generate guid  (Read 3907 times)

mstram

  • Newbie
  • *
  • Posts: 2
generate guid
« on: June 16, 2021, 03:48:43 AM »
Greetings,

I'm trying to generate a GUID for a test plugin.

The plugin is a copy of the example C# program, with
the class, and namespace changed, and some identifying text
sent by the WriteToLog function.

The example plugin worked fine, but when I try to use the guid
generated by the following code ( found at )
https://docs.microsoft.com/en-us/dotnet/api/system.guid.newguid?view=net-5.0

VA, is just 'silently ignoring' the plugin / dll.

Or maybe it's some other problem if the GUID *is* being generated properly?

Another thing is that the plugin manager is showing the name of an old plugin that I
removed from the app folder.

Maybe the two problems are related ?

Mike

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4782
  • RTFM
Re: generate guid
« Reply #1 on: June 16, 2021, 07:25:45 AM »
If VoiceAttack is listing a plugin in the plugin manager, that would indicate it's finding an assembly associated with it.


If you're compiling the example plugin into multiple plugins, the assembly's GUID would be identical, and VoiceAttack will only load one assembly with the same GUID.

This is separate from the GUID set in the VA_Id() method. Open the properties of your project, and in the "Application" tab click "Assembly Information...", then change the GUID found there, rebuild your project, and check whether VoiceAttack now loads the assembly

mstram

  • Newbie
  • *
  • Posts: 2
Re: generate guid
« Reply #2 on: June 16, 2021, 08:05:32 PM »
If VoiceAttack is listing a plugin in the plugin manager, that would indicate it's finding an assembly associated with it.

If you're compiling the example plugin into multiple plugins, the assembly's GUID would be identical, and VoiceAttack will only load one assembly with the same GUID.

This is separate from the GUID set in the VA_Id() method. Open the properties of your project, and in the "Application" tab click "Assembly Information...", then change the GUID found there, rebuild your project, and check whether VoiceAttack now loads the assembly

When you mention "Application tab", are you talking about Visual Studio ?

If so, I'm just (for now) using the "bare" monoDevelop compiler, that's why I went looking for a way to generate the GUID.

What do you mean about "separate GUID's" ?

If there is more than one guid, maybe that has something to do with the problem I'm having trying to update / add
plugins.

What is the preferred procedure to update an existing plugin ?

Right now I'm :

- going into the plugin manager
 - disabling (un checking) the plugin I want to update
 - exit VA
 - delete the old .dll file from it's  APPS/<mysubdir>
 - copy the new dll to that apps/subir
 - restart VA

When I do that, it's showing an "old" name for the plugin but with the *new* dll file name.

I got it working by shutting down VA, renaming the users\myuser\appdata\voiceAttack\Voiceattack.dat, (Voiceattack.dat.off)
then restarting VA, it then found my new plugin,
then shutdown VA, rename VoiceAttack.dat.off -> VoiceAttack.dat
then restart VA

I even tried the 'Reset Defaults' button ... which unfortunately also wipes out my registration code !!  (bug ? WASD ?)

Mike

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4782
  • RTFM
Re: generate guid
« Reply #3 on: June 16, 2021, 09:25:18 PM »
When you mention "Application tab", are you talking about Visual Studio ?
Indeed.


If there is more than one guid, maybe that has something to do with the problem I'm having trying to update / add
plugins.
It does not. I re-tested this, and there are only two aspects that need to be unique: The GUID in "VA_Id()", and the assembly name.
Note that the latter means the name the file is compiled with; it doesn't matter how many times you rename the resulting file, as the assembly name is compiled into the file's contents.

The assembly name can be checked using a PowerShell command:
Code: [Select]
([system.reflection.assembly]::loadfile("Absolute\path\to\your\plugin.dll")).CustomAttributeswhich will list it as "System.Reflection.AssemblyTitleAttribute"


What is the preferred procedure to update an existing plugin ?
  • Close VoiceAttack
  • Replace plugin DLL with new version
  • Start VoiceAttack

On my machine, changes to the "VA_DisplayName()" string are shown immediately after the file has been replaced and VoiceAttack starts, both in the log and the plugin manager.


I even tried the 'Reset Defaults' button ... which unfortunately also wipes out my registration code !!  (bug ? WASD ?)
Unless you explicitly enabled the "Also remove registration data (VoiceAttack will close)" option, registration data should not be removed.

On my machine the registration data is preserved when using the "Reset Defaults" option with the "Also remove registration data (VoiceAttack will close)" option unchecked.