Open KVonGit opened 2 months ago
In the test runner, if you choose Debug test (instead of Run test) it should stop where the exception is occurring so you can see more details.
It stopped there. I let it go for at least 30 minutes after that popped up, not knowing if VS was still actually doing something. After a while, I clicked the Continue button, and the test exited.
Now that we've established how ignorant I am when it comes to that, I can tell you the problem is somewhere in the new interface code (or I think can I safely state that as fact).
@alexwarren, do you remember me sharing that screen shot of Quest Retro the other day? It looks like 5.7, but it is really 5.8 underneath? Well, I just updated Quest Retro to bring it up to speed with these recent pull requests I've submitted, and it passes all the tests.
So, it's not anything in:
I literally copied and pasted all those files from my current quest directory (which fails the test) to my Quest Retro directory.
I'm pretty sure this is the point I checked the quest repo out to keep the old interface: https://github.com/textadventures/quest/commit/114bd1faa18f0fac54b48be03865d36423370889
From that point, I've added everything that wasn't from SoonGames from every commit up until this point. (This was only to keep the old interface. I didn't even know the template test was failing until a few days ago.)
There was an actual error message in the top left window that I needed to scroll down to see.
HResult=0x80131040
Message=Could not load file or assembly 'Newtonsoft.Json, Version=9.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
Source=EditorController
StackTrace:
at TextAdventures.Quest.FontsManager.m_client_DownloadStringCompleted(Object sender, DownloadStringCompletedEventArgs e) in C:\Users\kv\Documents\GitHub\quest - Copy\EditorController\FontsManager.cs:line 64
at System.Threading.QueueUserWorkItemCallback.WaitCallback_Context(Object state)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
at System.Threading.ThreadPoolWorkQueue.Dispatch()
at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()
Inner Exception 1:
FileLoadException: Could not load file or assembly 'Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
In EditorController.csproject (and Utility.csproject):
<ItemGroup>
<Reference Include="Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion><!-- This line was deleted. I have restored it. -->
<HintPath>..\packages\Newtonsoft.Json.6.0.6\lib\net40\Newtonsoft.Json.dll</HintPath>
<Private>True</Private> <!-- This line was added. I left it here. -->
</Reference>
I also added <SpecificVersion>False</SpecificVersion>
back in the Moq reference in WorldModelTests.csproj:
<Reference Include="Moq, Version=4.2.1409.1722, Culture=neutral, PublicKeyToken=69f491c39445e920, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion><!-- This line was deleted. I have restored it. -->
<HintPath>..\packages\Moq.4.2.1409.1722\lib\net40\Moq.dll</HintPath>
<Private>True</Private> <!-- This line was added. I left it here. -->
</Reference>
I'm not sure if what I'm doing is correct, but it made the warnings about Newtonsoft and Moq disappear as soon as I added that line back to the code.
Now, to run the tests...
...and the template test still failed.
Debugging all tests again...
System.IO.FileLoadException
HResult=0x80131040
Message=Could not load file or assembly 'Newtonsoft.Json, Version=9.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
Source=EditorController
StackTrace:
at TextAdventures.Quest.FontsManager.m_client_DownloadStringCompleted(Object sender, DownloadStringCompletedEventArgs e) in C:\Users\kv\Documents\GitHub\quest - Copy\EditorController\FontsManager.cs:line 64
at System.Threading.QueueUserWorkItemCallback.WaitCallback_Context(Object state)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
at System.Threading.ThreadPoolWorkQueue.Dispatch()
at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()
Inner Exception 1:
FileLoadException: Could not load file or assembly 'Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
Curses.
I wonder what this line does? <Private>True</Private>
I mean, if that means what I think it means (like a Private Sub), then it isn't shared outside of the document. ...or something. I don't know. This is way beyond me. I'll try removing that bit and see what happens, then give up if that doesn't do it.
And that didn't fix anything, either.
I have been defeated. Maybe all this will save someone with more knowledge than me some time when fixing this.
Fixed.
Two things I did, one of which probably fixed this:
The pull request that includes this fix is already submitted.
In VS Community 2022, with the unaltered files currently in the main repo, the Template Test fails. It shows an error on line 16 of TemplateTest.cs, and that is just the line of code that finds all the template files in the directory. That line of code works, because I added a purposeful error to one line in English.template, and VS displayed the proper error in the test window when the test failed. I changed that line of code back, and got the same error: line 16. (NOTE: Sometimes it says line 15, but most times it says 16.)
This test passed on Feb 1, 2018.
https://textadventures.co.uk/forum/quest/topic/eejoe5pelu__3ucgrvjkha/aslevent-fires-turn-scripts#b18bc9a2-de88-48a6-9d4f-2395ea40ff7f
Those files have been altered twice since that date, both times by me.
The first time, I added
<isroom />
to every template.I just removed that line from every template, and the test still failed the same way. So, I'm ruling that out.
The second time, I changed the ASL version from 550 to 580 on all the existing templates.
Looking through that, there were a few templates that I somehow missed the second time through, and those were still ASL 550. The gamebook was also 550. So, I updated all those to 580. Still the same error.
Lines 15 and 16 of TemplateTest.cs:
Like I say, when I purposefully added a mistake to English.template, the test failed and displayed an error that showed that error. So, that line of code has to be finding the proper folder. It's the first actual line of code in the file, too.
It flashes this for a half a second right when it fails:
I don't know. I took off
<isroom />
and changed ASL version back to 550 on everything including the test file, thus reverting the changes I see in the history since after the date of the post with the screenshot proving the tests all passed on Feb 1, 2018.I'm using VS Community 2022 this time, and it makes me update to .NET 4.8 runtime. So, maybe that has something to do with it.
Everything in Quest seems to work fine, but I have not tested it with other languages.
Last thing: I added purposeful errors to one file at a time alphabetically, and it shows those errors when it fails, but not with Deutsch.template or anything after that alphabetically (besides English, which is included in everything, I think, so maybe that's why).
I tried, but I don't understand the C# file.