I get this "class already exists" error when I run a script. Anybody have any ideas to fix this. Thanks for your time., and yes I do have Vegas 6. I didn't have this problem before.
Does this happen the first time that you run the script, or only if you are running it multiple times in the same Vegas session?
Can you post the exact error message to the forum?
Due to the change to AppDomains in Vegas 6, I found it necessary to include the System.Windows.Forms.Application.Exit() method as the last statement to execute prior to exiting the script. The Vegas code also executes this, but there seems to be situations where it is needed also in your script. This is a .Net framework bug, not a Vegas bug.
You are correct. It happens when I run the scripts multiple times during an edit session. 1st time or two it works and then I start to get this error message " class already exists" and that's about it.
Try putting the following line of code before you script exits:
Application.Exit();
or
System.Windows.Form.Application.Exit();
There is a bug in the .Net framework that windows classes are not cleaned up properly when an AppDomain exits. Normally, these classes are deleted when Application.Exit() is called, so calling this at the end seems to work to clean thing up.
I had reported this to Sony and they did insert an Application.Exit() call after the script returns to them. However, for some reason this does not always fix the problem.
Let me know if adding the Application.Exit() doesn't fix it for you. I am still interested in finding out if there is a better fix or workaround for this problem.