Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Could not load file or assembly System.Runtime.CompilerServices.Unsafe #170

Open
chucklu opened this issue Jul 24, 2019 · 3 comments
Open

Comments

@chucklu
Copy link
Contributor

chucklu commented Jul 24, 2019

System.IO.FileNotFoundException: Could not load file or assembly 'System.Runtime.CompilerServices.Unsafe, Version=4.0.4.1, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
File name: 'System.Runtime.CompilerServices.Unsafe, Version=4.0.4.1, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
at System.ReadOnlySpan1..ctor(T[] array, Int32 start, Int32 length) at SabberStoneCore.Model.Zones.Zone1.GetSpan()
at SabberStoneCore.Model.Entities.Controller.Options(Boolean skipPrePhase)
at SabberStoneCoreGui.Nodes.OptionNode.Options(ConcurrentDictionary`2& optionNodes) in C:\repository\GitHub\HearthSim\SabberStone\SabberStoneGui\src\Nodes\OptionNode.cs:line 113
at SabberStoneGui.MainWindow.<>c__DisplayClass4_2.<worker_DoWork>b__5() in C:\repository\GitHub\HearthSim\SabberStone\SabberStoneGui\src\MainWindow.xaml.cs:line 82
at System.Threading.Tasks.Task.InnerInvoke()
at System.Threading.Tasks.Task.Execute()

=== Pre-bind state information ===
LOG: DisplayName = System.Runtime.CompilerServices.Unsafe, Version=4.0.4.1, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
(Fully-specified)
LOG: Appbase = file:///C:/repository/GitHub/HearthSim/SabberStone/SabberStoneGui/bin/Debug/
LOG: Initial PrivatePath = NULL
Calling assembly : System.Memory, Version=4.0.1.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51.

LOG: This bind starts in default load context.
LOG: Using application configuration file: C:\repository\GitHub\HearthSim\SabberStone\SabberStoneGui\bin\Debug\SabberStoneGui.exe.Config
LOG: Using host configuration file:
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
LOG: Post-policy reference: System.Runtime.CompilerServices.Unsafe, Version=4.0.4.1, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
LOG: Attempting download of new URL file:///C:/repository/GitHub/HearthSim/SabberStone/SabberStoneGui/bin/Debug/System.Runtime.CompilerServices.Unsafe.DLL.
LOG: Attempting download of new URL file:///C:/repository/GitHub/HearthSim/SabberStone/SabberStoneGui/bin/Debug/System.Runtime.CompilerServices.Unsafe/System.Runtime.CompilerServices.Unsafe.DLL.
LOG: Attempting download of new URL file:///C:/repository/GitHub/HearthSim/SabberStone/SabberStoneGui/bin/Debug/System.Runtime.CompilerServices.Unsafe.EXE.
LOG: Attempting download of new URL file:///C:/repository/GitHub/HearthSim/SabberStone/SabberStoneGui/bin/Debug/System.Runtime.CompilerServices.Unsafe/System.Runtime.CompilerServices.Unsafe.EXE.

@chucklu
Copy link
Contributor Author

chucklu commented Jul 24, 2019

The gui crashed when I try to start a new game
C:\repository\GitHub\HearthSim\SabberStone\SabberStoneCore\src\Model\Zones\Zone.cs

public ReadOnlySpan<T> GetSpan()
		{
			return new ReadOnlySpan<T>(_entities, 0, _count);
		}

image

@chucklu
Copy link
Contributor Author

chucklu commented Jul 24, 2019

It can be fixed by reference System.Runtime.CompilerServices.Unsafe from NuGet for SabberStoneGui project.

@chucklu
Copy link
Contributor Author

chucklu commented Jul 24, 2019

By the way, I also found you have a no span build option,
image
I have tried to build no span, but build failed.

1>------ Build started: Project: SabberStoneCore, Configuration: NoSpan Any CPU ------
1>C:\Program Files\dotnet\sdk\3.0.100-preview-010184\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.RuntimeIdentifierInference.targets(151,5): message NETSDK1057: You are using a preview version of .NET Core. See: https://aka.ms/dotnet-core-preview
1>src\CardSets\Standard\TrollCardsGen.cs(30,7,30,34): warning CS0105: The using directive for 'SabberStoneCore.Model.Zones' appeared previously in this namespace
1>src\Auras\SummoningPortalAura.cs(85,23,85,30): warning CS0108: 'SummoningPortalAura.DeApply(IPlayable)' hides inherited member 'Aura.DeApply(IPlayable)'. Use the new keyword if hiding was intended.
1>src\Loader\TargetingPredicates.cs(120,36,120,61): error CS0029: Cannot implicitly convert type 'SabberStoneCore.Model.Zones.ReadOnlySpan<SabberStoneCore.Model.Entities.IPlayable>' to 'System.ReadOnlySpan<SabberStoneCore.Model.Entities.IPlayable>'
1>src\Loader\TargetingPredicates.cs(227,32,227,53): error CS0029: Cannot implicitly convert type 'SabberStoneCore.Model.Zones.ReadOnlySpan<SabberStoneCore.Model.Entities.Minion>' to 'System.ReadOnlySpan<SabberStoneCore.Model.Entities.Minion>'
1>src\Tasks\ComplexTasks.cs(459,5,459,28): error CS0104: 'ReadOnlySpan<>' is an ambiguous reference between 'SabberStoneCore.Model.Zones.ReadOnlySpan' and 'System.ReadOnlySpan'
1>src\Loader\CardLoader.cs(110,39,110,84): warning CS0618: 'Enum.ToString(IFormatProvider)' is obsolete: 'The provider argument is not used. Please use ToString().'
1>src\Model\Zones\Zone.cs(192,15,192,30): error CS1729: 'ReadOnlySpan' does not contain a constructor that takes 3 arguments
1>src\CardSets\Standard\TrollCardsGen.cs(805,16,805,42): warning CS0618: 'AdaptiveCostEffectObsolete' is obsolete: 'Not used any more'
1>src\CardSets\Standard\TrollCardsGen.cs(1180,6,1180,12): error CS0246: The type or namespace name 'Random' could not be found (are you missing a using directive or an assembly reference?)
1>src\CardSets\Standard\TrollCardsGen.cs(1855,25,1855,29): error CS0103: The name 'Math' does not exist in the current context
1>src\CardSets\Standard\TrollCardsGen.cs(1860,24,1860,28): error CS0103: The name 'Math' does not exist in the current context
1>src\CardSets\LootapaloozaCardsGen.cs(2789,16,2789,42): warning CS0618: 'AdaptiveCostEffectObsolete' is obsolete: 'Not used any more'
1>src\CardSets\IcecrownCardsGen.cs(2906,16,2906,42): warning CS0618: 'AdaptiveCostEffectObsolete' is obsolete: 'Not used any more'
1>src\Tasks\SimpleTasks\IncludeTask.cs(263,39,263,46): error CS1061: 'ReadOnlySpan' does not contain a definition for 'ToArray' and no accessible extension method 'ToArray' accepting a first argument of type 'ReadOnlySpan' could be found (are you missing a using directive or an assembly reference?)
1>Done building project "SabberStoneCore.csproj" -- FAILED.
2>------ Build started: Project: SabberStoneGui, Configuration: NoSpan Any CPU ------
2> SabberStoneGui -> C:\repository\GitHub\HearthSim\SabberStone\SabberStoneGui\bin\NoSpan\SabberStoneGui.exe
========== Build: 1 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant