Crash in macOS: TypeLoadException: Could not resolve type Cake.Core.CakeTaskBuilder`1, Cake.Core, Version=0.26.1.0, Culture=neutral, PublicKeyToken=null
- Dominant language
- C#
- Stars
- 4.2k
- Forks
- 778
- Avg merge
- 1h 15m
- Merged PRs (30d)
- 19
Description
### What You Are Seeing?
A crash.
I try to build the repository ZXing.Net.Mobile, which has a stock build.sh file for bootstrapping CAKE. The log:
```
$ ./build.sh
Restoring tools from NuGet...
Feeds used:
/Users/andres/.nuget/packages/
https://www.myget.org/F/nethereum/api/v3/index.json
https://api.nuget.org/v3/index.json
All packages listed in /Users/andres/Documents/Code/gwalletFRONTEND/build/ZXing.Net.Mobile/tools/packages.config are already installed.
Running Cake...
The assembly 'Cake.Android.SdkManager, Version=3.0.0.0, Culture=neutral, PublicKeyToken=null'
is referencing an older version of Cake.Core (0.26.1).
For best compatibility it should target Cake.Core version 0.28.0.
The assembly 'Cake.XCode, Version=4.0.0.0, Culture=neutral, PublicKeyToken=null'
is referencing an older version of Cake.Core (0.26.1).
For best compatibility it should target Cake.Core version 0.28.0.
The assembly 'Cake.Xamarin, Version=3.0.0.0, Culture=neutral, PublicKeyToken=null'
is referencing an older version of Cake.Core (0.26.1).
For best compatibility it should target Cake.Core version 0.28.0.
The assembly 'Cake.Xamarin.Build, Version=4.0.1.0, Culture=neutral, PublicKeyToken=null'
is referencing an older version of Cake.Core (0.26.1).
For best compatibility it should target Cake.Core version 0.28.0.
The assembly 'Cake.SemVer, Version=3.0.0.0, Culture=neutral, PublicKeyToken=null'
is referencing an older version of Cake.Core (0.26.1).
For best compatibility it should target Cake.Core version 0.28.0.
Error: Could not resolve type with token 01000016 (from typeref, class/assembly Cake.Core.CakeTaskBuilder`1, Cake.Core, Version=0.26.1.0, Culture=neutral, PublicKeyToken=null)
```
### What is Expected?
To not crash?
### What version of Cake are you using?
The last one? build.sh seems to download the last one. Which at the time of writing seems to be 0.30.0.
### Are you running on a 32 or 64 bit system?
64 I guess.
### What environment are you running on? Windows? Linux? Mac?
macOS
### Are you running on a CI Server? If so, which one?
No
### How Did You Get This To Happen? (Steps to Reproduce)
Clone https://github.com/Redth/ZXing.Net.Mobile , run its build.sh.
### Output Log
Log with `--verbosity=diagnostic`:
```
$ ./build.sh
Restoring tools from NuGet...
Feeds used:
/Users/andres/.nuget/packages/
https://www.myget.org/F/nethereum/api/v3/index.json
https://api.nuget.org/v3/index.json
All packages listed in /Users/andres/Documents/Code/gwalletFRONTEND/build/ZXing.Net.Mobile/tools/packages.config are already installed.
Running Cake...
Module directory does not exist.
NuGet.config not found.
Analyzing build script...
Analyzing /Users/andres/Documents/Code/gwalletFRONTEND/build/ZXing.Net.Mobile/build.cake...
Processing build script...
Installing tools...
GET https://www.myget.org/F/nethereum/api/v3/registration1/xamarincomponent/index.json
NotFound https://www.myget.org/F/nethereum/api/v3/registration1/xamarincomponent/index.json 1404ms
CACHE https://api.nuget.org/v3/registration3-gz-semver2/xamarincomponent/index.json
Found package 'XamarinComponent 1.1.0.65' in '/Users/andres/Documents/Code/gwalletFRONTEND/build/ZXing.Net.Mobile/tools'.
Package XamarinComponent.1.1.0.65 has already been installed.
Successfully installed 'XamarinComponent 1.1.0.65' to /Users/andres/Documents/Code/gwalletFRONTEND/build/ZXing.Net.Mobile/tools
Executing nuget actions took 18.95 ms
Installing addins...
GET https://www.myget.org/F/nethereum/api/v3/registration1/cake.android.sdkmanager/index.json
NotFound https://www.myget.org/F/nethereum/api/v3/registration1/cake.android.sdkmanager/index.json 1106ms
CACHE https://api.nuget.org/v3/registration3-gz-semver2/cake.android.sdkmanager/index.json
Found package 'Cake.Android.SdkManager 3.0.0' in '/Users/andres/Documents/Code/gwalletFRONTEND/build/ZXing.Net.Mobile/tools/Addins'.
Package Cake.Android.SdkManager.3.0.0 has already been installed.
Successfully installed 'Cake.Android.SdkManager 3.0.0' to /Users/andres/Documents/Code/gwalletFRONTEND/build/ZXing.Net.Mobile/tools/Addins
Executing nuget actions took 0.84 ms
The addin Cake.Android.SdkManager will reference Cake.Android.SdkManager.dll.
GET https://www.myget.org/F/nethereum/api/v3/registration1/cake.xcode/index.json
NotFound https://www.myget.org/F/nethereum/api/v3/registration1/cake.xcode/index.json 1063ms
CACHE https://api.nuget.org/v3/registration3-gz-semver2/cake.xcode/index.json
Found package 'Cake.XCode 4.0.0' in '/Users/andres/Documents/Code/gwalletFRONTEND/build/ZXing.Net.Mobile/tools/Addins'.
Package Cake.XCode.4.0.0 has already been installed.
Successfully installed 'Cake.XCode 4.0.0' to /Users/andres/Documents/Code/gwalletFRONTEND/build/ZXing.Net.Mobile/tools/Addins
Executing nuget actions took 0.8 ms
The addin Cake.XCode will reference Cake.XCode.dll.
GET https://www.myget.org/F/nethereum/api/v3/registration1/cake.xamarin/index.json
NotFound https://www.myget.org/F/nethereum/api/v3/registration1/cake.xamarin/index.json 1234ms
CACHE https://api.nuget.org/v3/registration3-gz-semver2/cake.xamarin/index.json
Found package 'Cake.Xamarin 3.0.0' in '/Users/andres/Documents/Code/gwalletFRONTEND/build/ZXing.Net.Mobile/tools/Addins'.
Package Cake.Xamarin.3.0.0 has already been installed.
Successfully installed 'Cake.Xamarin 3.0.0' to /Users/andres/Documents/Code/gwalletFRONTEND/build/ZXing.Net.Mobile/tools/Addins
Executing nuget actions took 0.84 ms
The addin Cake.Xamarin will reference Cake.Xamarin.dll.
GET https://www.myget.org/F/nethereum/api/v3/registration1/cake.xamarin.build/index.json
NotFound https://www.myget.org/F/nethereum/api/v3/registration1/cake.xamarin.build/index.json 1108ms
CACHE https://api.nuget.org/v3/registration3-gz-semver2/cake.xamarin.build/index.json
Found package 'Cake.Xamarin.Build 4.0.1' in '/Users/andres/Documents/Code/gwalletFRONTEND/build/ZXing.Net.Mobile/tools/Addins'.
Package Cake.Xamarin.Build.4.0.1 has already been installed.
Successfully installed 'Cake.Xamarin.Build 4.0.1' to /Users/andres/Documents/Code/gwalletFRONTEND/build/ZXing.Net.Mobile/tools/Addins
Executing nuget actions took 0.82 ms
The addin Cake.Xamarin.Build will reference Cake.Xamarin.Build.dll.
GET https://www.myget.org/F/nethereum/api/v3/registration1/cake.semver/index.json
NotFound https://www.myget.org/F/nethereum/api/v3/registration1/cake.semver/index.json 1190ms
CACHE https://api.nuget.org/v3/registration3-gz-semver2/cake.semver/index.json
Found package 'Cake.SemVer 3.0.0' in '/Users/andres/Documents/Code/gwalletFRONTEND/build/ZXing.Net.Mobile/tools/Addins'.
Package Cake.SemVer.3.0.0 has already been installed.
Successfully installed 'Cake.SemVer 3.0.0' to /Users/andres/Documents/Code/gwalletFRONTEND/build/ZXing.Net.Mobile/tools/Addins
Executing nuget actions took 0.82 ms
The addin Cake.SemVer will reference Cake.SemVer.dll.
GET https://www.myget.org/F/nethereum/api/v3/registration1/cake.filehelpers/index.json
NotFound https://www.myget.org/F/nethereum/api/v3/registration1/cake.filehelpers/index.json 1022ms
CACHE https://api.nuget.org/v3/registration3-gz-semver2/cake.filehelpers/index.json
Found package 'Cake.FileHelpers 3.1.0' in '/Users/andres/Documents/Code/gwalletFRONTEND/build/ZXing.Net.Mobile/tools/Addins'.
Package Cake.FileHelpers.3.1.0 has already been installed.
Successfully installed 'Cake.FileHelpers 3.1.0' to /Users/andres/Documents/Code/gwalletFRONTEND/build/ZXing.Net.Mobile/tools/Addins
Executing nuget actions took 0.89 ms
The addin Cake.FileHelpers will reference Cake.FileHelpers.dll.
GET https://www.myget.org/F/nethereum/api/v3/registration1/cake.monoapitools/index.json
NotFound https://www.myget.org/F/nethereum/api/v3/registration1/cake.monoapitools/index.json 1074ms
CACHE https://api.nuget.org/v3/registration3-gz-semver2/cake.monoapitools/index.json
Found package 'Cake.MonoApiTools 3.0.1' in '/Users/andres/Documents/Code/gwalletFRONTEND/build/ZXing.Net.Mobile/tools/Addins'.
Package Cake.MonoApiTools.3.0.1 has already been installed.
Successfully installed 'Cake.MonoApiTools 3.0.1' to /Users/andres/Documents/Code/gwalletFRONTEND/build/ZXing.Net.Mobile/tools/Addins
Executing nuget actions took 0.92 ms
The addin Cake.MonoApiTools will reference Cake.MonoApiTools.dll.
Verifying assembly 'Cake.Android.SdkManager, Version=3.0.0.0, Culture=neutral, PublicKeyToken=null'.
The assembly 'Cake.Android.SdkManager, Version=3.0.0.0, Culture=neutral, PublicKeyToken=null'
is referencing an older version of Cake.Core (0.26.1).
For best compatibility it should target Cake.Core version 0.28.0.
Verifying assembly 'Cake.XCode, Version=4.0.0.0, Culture=neutral, PublicKeyToken=null'.
The assembly 'Cake.XCode, Version=4.0.0.0, Culture=neutral, PublicKeyToken=null'
is referencing an older version of Cake.Core (0.26.1).
For best compatibility it should target Cake.Core version 0.28.0.
Verifying assembly 'Cake.Xamarin, Version=3.0.0.0, Culture=neutral, PublicKeyToken=null'.
The assembly 'Cake.Xamarin, Version=3.0.0.0, Culture=neutral, PublicKeyToken=null'
is referencing an older version of Cake.Core (0.26.1).
For best compatibility it should target Cake.Core version 0.28.0.
Verifying assembly 'Cake.Xamarin.Build, Version=4.0.1.0, Culture=neutral, PublicKeyToken=null'.
The assembly 'Cake.Xamarin.Build, Version=4.0.1.0, Culture=neutral, PublicKeyToken=null'
is referencing an older version of Cake.Core (0.26.1).
For best compatibility it should target Cake.Core version 0.28.0.
Verifying assembly 'Cake.SemVer, Version=3.0.0.0, Culture=neutral, PublicKeyToken=null'.
The assembly 'Cake.SemVer, Version=3.0.0.0, Culture=neutral, PublicKeyToken=null'
is referencing an older version of Cake.Core (0.26.1).
For best compatibility it should target Cake.Core version 0.28.0.
Verifying assembly 'Cake.FileHelpers, Version=3.1.0.0, Culture=neutral, PublicKeyToken=null'.
Verifying assembly 'Cake.MonoApiTools, Version=3.0.0.0, Culture=neutral, PublicKeyToken=null'.
Error: System.TypeLoadException: Could not resolve type with token 01000016 (from typeref, class/assembly Cake.Core.CakeTaskBuilder`1, Cake.Core, Version=0.26.1.0, Culture=neutral, PublicKeyToken=null)
at (wrapper managed-to-native) System.Reflection.MonoMethodInfo.get_parameter_info(intptr,System.Reflection.MemberInfo)
at System.Reflection.MonoMethodInfo.GetParametersInfo (System.IntPtr handle, System.Reflection.MemberInfo member) [0x00000] in :0
at System.Reflection.MonoMethod.GetParameters () [0x00000] in :0
at Cake.Core.Scripting.ScriptAliasFinder+d__4.MoveNext () [0x00070] in <1a12afcf649f4de8ab5d15d82d4f6310>:0
at Cake.Core.Scripting.ScriptAliasFinder.FindAliases (System.Collections.Generic.IEnumerable`1[T] assemblies) [0x00072] in <1a12afcf649f4de8ab5d15d82d4f6310>:0
at Cake.Core.Scripting.ScriptRunner.Run (Cake.Core.Scripting.IScriptHost host, Cake.Core.IO.FilePath scriptPath, System.Collections.Generic.IDictionary`2[TKey,TValue] arguments) [0x00238] in <1a12afcf649f4de8ab5d15d82d4f6310>:0
at Cake.Commands.BuildCommand.Execute (Cake.CakeOptions options) [0x0003f] in <52bc22bce5254240ba373b3cf23da1ab>:0
at Cake.CakeApplication.Run (Cake.CakeOptions options) [0x00015] in <52bc22bce5254240ba373b3cf23da1ab>:0
at Cake.Program.Main () [0x000d1] in <52bc22bce5254240ba373b3cf23da1ab>:0
```
Contributor guide
Research direction
Reproduce the failure with ZXing.Net.Mobile's build.sh and inspect tools/packages.config, then trace the reported failure through Cake.Core.Scripting.ScriptAliasFinder. Compare the loaded Cake.Core 0.28.0 with add-ins referencing 0.26.1. Done means the macOS build completes without the TypeLoadException and the compatibility warning is resolved or properly handled.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- build-system
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100