Following the scripting FAQ in Visual Studio 2022 with C# I made the Hello World example from 1.14.
Despite some differences in VS 2022, I got it compiling and starting Vegas as the debugger. In Vegas I go to tools, start script and select my debug dll file -> An error occured during execution of the script. Error 0x80070002 (message missing).
System.IO.FileNotFoundException: Could not load file or assembly 'System.Runtime, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
File name: 'System.Runtime, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
at System.Reflection.RuntimeAssembly.GetExportedTypes(RuntimeAssembly assembly, ObjectHandleOnStack retTypes)
at System.Reflection.RuntimeAssembly.GetExportedTypes()
at ScriptPortal.Vegas.ScriptHost.ScriptManager.Run(Assembly asm, String className, String methodName)
at ScriptPortal.Vegas.ScriptHost.RunScript(Boolean fCompileOnly)
WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].
As my code is extremely simple (see 1.14 in scripting FAQ), there can be nothing wrong there..... So what is?
Using Vegas Pro 21.0 (downloaded today) trial version (to see if this scripting meets my needs) on Win11, 23H2 all updated, no other problems with the machine.
After the error message, Vegas completely crashes.... but this seems unrelated and caused by me running it not on screen #1, see: https://www.vegascreativesoftware.info/us/forum/crashes-all-the-time--143650/
Edit: It only happens (always) when running the .dll. When running the .cs it works. So something in my VS2022 project settings causes a file to be not found by vegas..... please help!
Edit2: 0x8007002 basically means that it cannot find a file and the System.IO.FileNotFoundException contributes to that statement. So I took ProcessExplorer from SystemInternals and with help of some filtering I was able to pin down a couple of NAME NOT FOUND or NO SUCH FILE errors generated by Vegas:
1) C:\Users\VegaMega\AppData\Roaming\VEGAS\HubDB\VegasUtilities.msalcache.bin3
=> this one I could fix by logging into VegasHub but that did not fix my problem
2) X:\project\VegasPro\Trial02\Trial02\bin\Debug\net8.0\Trial02.dll.config
3) X:\project\VegasPro\Trial02\Trial02\bin\Debug\net8.0\Trial02.xml
4) X:\project\VegasPro\Trial02\Trial02\bin\Debug\net8.0\System.Runtime.dll
5) X:\project\VegasPro\Trial02\Trial02\bin\Debug\net8.0\System.Runtime.exe
And also a couple of registry NAME NOT FOUNDs:
a) HKLM\SOFTWARE\Microsoft\Fusion\PublisherPolicy\Default\v4.0_policy.8.0.System.Runtime__b03f5f7f11d50a3a
b) HKLM\SOFTWARE\Microsoft\Fusion\PublisherPolicy\Default\policy.8.0.System.Runtime__b03f5f7f11d50a3a
c) HKLM\System\CurrentControlSet\Control\DeviceClasses\{53f5630d-b6bf-11d0-94f2-00a0c91efb8b}\Properties
I suspect 4) and 5) the most. But really not sure why they are not there or should be there.... also a) and b) are really interesting as the hexnumber b03f5f7f11d50a3a matches the PublicKeyToken from the exception details.
Anyone from support to comment on this?