Using System.Linq in non-VS context

rmlrmlrmlrml wrote on 2/25/2021, 5:42 PM
<?xml version="1.0" encoding="UTF-8" ?>
<ScriptSettings> 
    <AssemblyReference>System.Core.dll</AssemblyReference>
</ScriptSettings>

I've followed the instructions in Vegas Pro Scripting FAQs and placed the above "Script Name.xml.config" file in the same directory as the "Script Name.cs" file. Why am I still getting the following error:

C:\Program Files\VEGAS\VEGAS Pro 18.0\Script Menu\{Script Name}.cs(3) : The type or namespace name 'Linq' does not exist in the namespace 'System' (are you missing an assembly reference?)

I have

using System.Linq;

at the top of the .cs file.

Comments

jetdv wrote on 2/26/2021, 7:55 AM

If you build the script and compile it to a DLL, I'm sure it would work and without needing the xml.config file. Give it a try and see what happens. You can see how to do this here:

http://www.jetdv.com/2021/02/01/what-is-the-minimum-i-need-to-write-a-script-for-vegas/

http://www.jetdv.com/2021/02/04/how-can-i-find-and-correct-errors-debug-in-a-script-running-in-vegas/

 

rmlrmlrmlrml wrote on 2/27/2021, 8:06 AM

Thanks, it didn't occur to me that I could just drag the vs-compiled .dll file into the `Scripts Menu` folder!

jetdv wrote on 2/27/2021, 8:33 AM

Yes, the dll files work great. In fact, you must create a dll if you're creating a custom command/extension. And it's definitely the easiest solution in this case.