MDK-SE
MDK-SE copied to clipboard
Crash on deploy - Exception in TypeTrimmer
Recurring crash on script deploy, seemingly originated in TypeTrimmer. Started at a random point, and restarting Visual Studio does not fix it (it often did with similar crashes).
If Type Trimming is disabled, deploy is successful (albeit it exceeds the script length limit 😛).
(I just tested it with full minifying, and that succeeds. So this seems to be exclusively related to the Type Trimmer.)
System.ArgumentNullException: Value cannot be null. Parameter name: key at System.Collections.Generic.Dictionary
2.FindEntry(TKey key) at System.Collections.Generic.Dictionary2.get_Item(TKey key) at MDK.Build.TypeTrimming.TypeTrimmer.<ProcessAsync>d__4.MoveNext() in D:\Repos\SpaceEngineers\MDK-SE\Source\MDK\Build\TypeTrimming\TypeTrimmer.cs:line 93 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at MDK.Build.BuildModule.<BuildAsync>d__27.MoveNext() in D:\Repos\SpaceEngineers\MDK-SE\Source\MDK\Build\BuildModule.cs:line 165 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at MDK.Build.BuildModule.<<RunAsync>b__25_0>d.MoveNext() in D:\Repos\SpaceEngineers\MDK-SE\Source\MDK\Build\BuildModule.cs:line 118 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at MDK.MDKPackage.<DeployAsync>d__47.MoveNext() in D:\Repos\SpaceEngineers\MDK-SE\Source\MDK\MDKPackage.cs:line 359
Please provide me with a reproduction.
Please provide me with a reproduction.
Yes, working on it. The changes in my project which triggered this bug aren't committed yet. Once they're pushed, I can provide a link to the repo.
I'm not sure there is an easier way to reproduce it, because I don't know exactly what change triggered this issue, so I can't isolate it (although I could try).
Nah, that's probably good enough. At least until the opposite is proven.
So I got to it finally, and it turned out the cause of the crash was an accidental namespace declaration in one of the files (i.e. I forgot to edit the namespace added by Visual Studio). The deploy command showed no error pertaining to invalid namespace use, it just crashed.
Not sure that in light of this you'd like to close this issue, or if you still consider it a bug that it didn't communicate the namespace problem. 🤔
MDK doesn't do compilation, hence it isn't it's job to report any kind of code problem. However, it shouldn't crash just because you added a nonstandard namespace, so that is still a bug - if a rather less important one.