Error 0x80070002 (message missing) on first script

VegaMega wrote on 11/28/2023, 4:34 PM

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?

 

Comments

jetdv wrote on 11/29/2023, 9:33 AM

I would recommend you go through my tutorials and start with the base scripts I have listed there. A big issue with the newer versions of Visual Studio is that you have to make sure you choose the "right" beginning option which is much harder to find. I'm actually still using Visual Studio 2015 (for multiple reasons)

  1. It's really easy to choose the beginning preset.
  2. I have the full installer downloaded making it easy to add to new machines without needing to download everything each time.
  3. Debugging works correctly

p.s. you want .NET 4.x

VegaMega wrote on 11/29/2023, 5:25 PM

I would recommend you go through my tutorials and start with the base scripts I have listed there. A big issue with the newer versions of Visual Studio is that you have to make sure you choose the "right" beginning option which is much harder to find. I'm actually still using Visual Studio 2015 (for multiple reasons)

  1. It's really easy to choose the beginning preset.
  2. I have the full installer downloaded making it easy to add to new machines without needing to download everything each time.
  3. Debugging works correctly

p.s. you want .NET 4.x

I am basically doing the same as in your videos. It just that in VS 2022 some things are different. I was making a guide for it and post it here when I have it working.

That last line of your post is very very interesting because Visual Studio 2022 does not include .Net 4.0 - 4.5.1 because these versions are no longer supported...... This now will be my main suspect for this problem. Not sure how to fix that though but Google or ChatGPT may hopefully tell me..

jetdv wrote on 11/30/2023, 7:05 AM

I've tested and gotten it to work (as per my tutorials) in both VS2015 and VS2019. I have not tested VS2022. For my tutorials, this is my properties (.NET 4.8):

VegaMega wrote on 11/30/2023, 3:05 PM

Just found out the by selecting 'class library (.Net Framework)' instead of 'class library' that I do have the option for .Net 4.8. Also after compiling, I could run the .dll file in Vegas without a problem. So the good news is that I can compile a working .dll now.

However there is a new problem: Setting Vegas210.exe as the debug executable, just as I did before, now does not start Vegas..... For a few seconds it is busy and then debugger stops without any message or error.... the whole exercise with the .dll is to get debugging to work, else I could just run the .cs file.

jetdv wrote on 11/30/2023, 6:37 PM

Debugging was an issue for me with 2019 - it would start VEGAS and everything would run but all of the tabs were blank. With 2015, everything just works which is one of the main reasons I'm still using VS2015.

And, yes, it's very important which "class library" you pick which I demonstrated using 2019.

lucas-v wrote on 12/24/2023, 8:54 AM

Thank you for these posts! I was struggling to find why I got the same FileNotFoundException with Visual Studio 2022 and this fixed it :D

jetdv wrote on 12/24/2023, 1:07 PM

@lucas-v glad to hear these posts are helpful.