Vegas script not updating when addded to Script Menu folder

bradbradbrad wrote on 12/30/2016, 2:21 PM

For some reason, when I build a .dll and add it to the script menu/copy over previous .dll, Vegas seems to call the older version. I have verified that my .dll is being properly built, so it seems that Vegas, for whatever reason, is looking at old script files instead of the new one. I've clicked update script menu, which sadly didn't help.

Anyone else have a similar problem?

Comments

Red Prince wrote on 12/30/2016, 2:46 PM

Did you go to menu -> Tools -> Scripting -> Rescan Script Menu Folder? Or just Alt-t t c (in that order).

He who knows does not speak; he who speaks does not know.
                    — Lao Tze in Tao Te Ching

Can you imagine the silence if everyone only said what he knows?
                    — Karel Čapek (The guy who gave us the word “robot” in R.U.R.)

bradbradbrad wrote on 12/30/2016, 2:53 PM

Yeah, I tried to re-scan. No luck. It's weird. I had a backup of the original .dll and just renamed it while testing the new .dll. If I change the working .dll name back to the original name, the script runs fine. It's when I copy the newly built .dll, with the same name, into the script folder to overwrite the current script, things get weird and Vegas calls the old build instead of the new build.

GJeffrey wrote on 12/30/2016, 3:06 PM

Have you tried to restart Vegas? Dies it still look for the old dll after?

Red Prince wrote on 12/30/2016, 3:15 PM

It's when I copy the newly built .dll, with the same name, into the script folder to overwrite the current script, things get weird and Vegas calls the old build instead of the new build.

Wait a minute. If you copy the new .dll with the same name as the old, one of two things will happen (depending on how you are copying).

  1. It will either remove the old .dll and replace it with the new one.
  2. Or, it will keep the old one and add a number to its name. For example, if you have mydll.dll, Windows will rename it to mydll (1).dll before copying it to the folder.

So, if Vegas is loading the old dll, presumably the second option happened.

He who knows does not speak; he who speaks does not know.
                    — Lao Tze in Tao Te Ching

Can you imagine the silence if everyone only said what he knows?
                    — Karel Čapek (The guy who gave us the word “robot” in R.U.R.)

bradbradbrad wrote on 12/30/2016, 3:22 PM

I totally agree with you/understand. When I go to replace the file, I select the remove old, replace with new option.

Still, no luck. However, I did find somewhat of a fix, but I don't know if this is the best solution.

For Vegas to utilize a .dll, there has to be a config file that is the same name of the script that utilizes the .dll. So if your script is named myScript.cs, your config file would be named myScript.cs.config. The config file consists of xml and looks like this:

<ScriptSettings>
  <AssemblyReference resolver="local">myLibary.dll</AssemblyReference>
</ScriptSettings>

What I did was have my .dll built as a new file name, then make the config file reference the new file name. This runs the newly built .dll fine. Now, I just need to know if this is the best way to go about fixing this problem, or if there is a better way.

Thanks for your input Red Prince, and if you have any other advice I'd love to hear it.

 

 

Red Prince wrote on 12/30/2016, 6:03 PM

I’d say, if it works, stick with it.

He who knows does not speak; he who speaks does not know.
                    — Lao Tze in Tao Te Ching

Can you imagine the silence if everyone only said what he knows?
                    — Karel Čapek (The guy who gave us the word “robot” in R.U.R.)