Open stolliemods opened 2 days ago
First; make sure you have everything up to date (see wiki). If the error still occurs, you can try to enable "trace" mode in the .ini file to get more information, and a whole bunch of intermediate code files. Please try to narrow down where the error actually occurs. It seems to me like the minifier is trying to be "smart" and replaces a type reference with var
somewhere it's not allowed to.
Thanks, I've confirmed I needed to update the MDK2 Templates. Nuget packages is up to date, I did that earlier today and confirmed no further update pending as I write this.
I turned on trace mode previously which is where that above log information came from. I've had a look through the intermediate files and can't see where it's going wrong. The only things I see are: -
Is there any way for me to see specfically which symbol it fails at, see any more debugging info or check which type references should not be changed and if they are in the symbol map?
No, the way this usually is done is to try to see where it fails in the processed code vs where that is in the unprocessed code. It would not be in the symbol map as it's not renaming anything in this case, simply trying to use var
instead of the type itself, to shorten it.
It's directly related to a specific way you write your code, which is why it needs to be narrowed down so I can fix it.
I will help you if that's the only option, but I beg you to try for yourself first. I don't have much free time to work on this project, so the more you guys help me out, the better for all of us 🙏
All good mate, dont stress, I'll try and narrow it down to where its happening, thanks for your help!
Worse case scenario I'll have to refactor and use less descriptive method and variable names 😄
I'd prefer to be able to fix the problem than you having to refactor, since someone else might be getting the issue and there's already two issues I have no good solutions for :P
Hi,
I'm not sure what information I need to provide, I'm a pretty amateur coder. When I use Lite the script minifies just fine.
When I try to Full I get the below error. I've tried using all Explicit types in the script and removing any mention of 'var' in the entire script and that error still shows up.
Is there anything else I can look at to see what's going wrong?
1>Starting symbol renaming... 1>Symbol renaming complete in 00:00:00.8662093 1>Writing intermediate symbol map to C:\Users\cheyn\source\repos\AutoDockingUpdatedMDK\obj\symbol.map 1>Compilation failed with errors. 1>The contextual keyword 'var' may only appear within a local variable declaration or in script code 1>'object' does not contain a definition for 'Value' and no accessible extension method 'Value' accepting a first argument of type 'object' could be found (are you missing a using directive or an assembly reference?) 1>'object' does not contain a definition for 'Value' and no accessible extension method 'Value' accepting a first argument of type 'object' could be found (are you missing a using directive or an assembly reference?) 1>Implicitly-typed variables must be initialized 1>Implicitly-typed variables must be initialized 1>C:\Users\cheyn.nuget\packages\mal.mdk2.pbpackager\2.0.13\build\Mal.Mdk2.PbPackager.props(18,9): error MSB3073: The command ""C:\Users\cheyn.nuget\packages\mal.mdk2.pbpackager\2.0.13\build..\tools\mdk.exe" pack "C:\Users\cheyn\source\repos\AutoDockingUpdatedMDK\AutoDockingUpdatedMDK.csproj" -configuration Debug -interactive" exited with code -1. 1>Done building project "AutoDockingUpdatedMDK.csproj" -- FAILED.