question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

try-convert 0.9.4.32202 crashes with: System.IO.FileLoadException: Could not load file or assembly 'System.Runtime.CompilerServices.Unsafe, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. Could not find or load a specific file. (0x80131621)

See original GitHub issue

I just installed try-convert as a global tool (dotnet tool install -g try-convert).

I changed into the root of my git repo and ran ‘try-convert’. And i got this exception trace: d:\Repos\msazure-one\Spartan>try-convert System.IO.FileLoadException: Could not load file or assembly ‘System.Runtime.CompilerServices.Unsafe, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a’. Could not find or load a specific file. (0x80131621) File name: ‘System.Runtime.CompilerServices.Unsafe, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a’ at Microsoft.NET.StringTools.InternableString.ExpensiveConvertToString() at Microsoft.NET.StringTools.WeakStringCache.GetOrCreateEntry(InternableString& internable, Boolean& cacheHit) at Microsoft.NET.StringTools.WeakStringCacheInterner.Intern(InternableString& candidate, String& interned) at Microsoft.NET.StringTools.WeakStringCacheInterner.InternableToString(InternableString& candidate) at Microsoft.NET.StringTools.InternableString.ToString() at Microsoft.NET.StringTools.SpanBasedStringBuilder.ToString() at Microsoft.Build.Evaluation.Expander2.AddArgument(List1 arguments, SpanBasedStringBuilder argumentBuilder) at Microsoft.Build.Evaluation.Expander2.ExtractFunctionArguments(IElementLocation elementLocation, String expressionFunction, String argumentsString) at Microsoft.Build.Evaluation.Expander2.Function1.ConstructFunction(IElementLocation elementLocation, String expressionFunction, Int32 argumentStartIndex, Int32 methodStartIndex, FunctionBuilder1& functionBuilder) at Microsoft.Build.Evaluation.Expander2.Function1.ExtractPropertyFunction(String expressionFunction, IElementLocation elementLocation, Object propertyValue, UsedUninitializedProperties usedUnInitializedProperties, IFileSystem fileSystem) at Microsoft.Build.Evaluation.Expander2.PropertyExpander1.ExpandPropertyBody(String propertyBody, Object propertyValue, IPropertyProvider1 properties, ExpanderOptions options, IElementLocation elementLocation, UsedUninitializedProperties usedUninitializedProperties, IFileSystem fileSystem) at Microsoft.Build.Evaluation.Expander2.PropertyExpander1.ExpandPropertiesLeaveTypedAndEscaped(String expression, IPropertyProvider1 properties, ExpanderOptions options, IElementLocation elementLocation, UsedUninitializedProperties usedUninitializedProperties, IFileSystem fileSystem, LoggingContext loggingContext) at Microsoft.Build.Evaluation.Expander2.PropertyExpander1.ExpandPropertiesLeaveEscaped(String expression, IPropertyProvider1 properties, ExpanderOptions options, IElementLocation elementLocation, UsedUninitializedProperties usedUninitializedProperties, IFileSystem fileSystem, LoggingContext loggingContext) at Microsoft.Build.Evaluation.Expander2.ExpandIntoStringLeaveEscaped(String expression, ExpanderOptions options, IElementLocation elementLocation, LoggingContext loggingContext) at Microsoft.Build.Evaluation.Expander2.ExpandIntoStringAndUnescape(String expression, ExpanderOptions options, IElementLocation elementLocation, LoggingContext loggingContext) at Microsoft.Build.Evaluation.ToolsetReader.ExpandPropertyUnescaped(ToolsetPropertyDefinition property, Expander2 expander) at Microsoft.Build.Evaluation.ToolsetReader.EvaluateAndSetProperty(ToolsetPropertyDefinition property, PropertyDictionary1 properties, PropertyDictionary1 globalProperties, PropertyDictionary1 initialProperties, Boolean accumulateProperties, String& toolsPath, String& binPath, Expander2& expander) at Microsoft.Build.Evaluation.ToolsetReader.ReadToolset(ToolsetPropertyDefinition toolsVersion, PropertyDictionary1 globalProperties, PropertyDictionary1 initialProperties, Boolean accumulateProperties) at Microsoft.Build.Evaluation.ToolsetReader.ReadEachToolset(Dictionary2 toolsets, PropertyDictionary1 globalProperties, PropertyDictionary1 initialProperties, Boolean accumulateProperties) at Microsoft.Build.Evaluation.ToolsetReader.ReadToolsets(Dictionary2 toolsets, PropertyDictionary1 globalProperties, PropertyDictionary1 initialProperties, Boolean accumulateProperties, String& msBuildOverrideTasksPath, String& defaultOverrideToolsVersion) at Microsoft.Build.Evaluation.ToolsetReader.<ReadAllToolsets>g__ReadConfigToolset|12_0(<>c__DisplayClass12_0& ) at Microsoft.Build.Evaluation.ToolsetReader.ReadAllToolsets(Dictionary2 toolsets, ToolsetRegistryReader registryReader, ToolsetConfigurationReader configurationReader, PropertyDictionary1 environmentProperties, PropertyDictionary1 globalProperties, ToolsetDefinitionLocations locations) at Microsoft.Build.Evaluation.ProjectCollection.InitializeToolsetCollection(ToolsetRegistryReader registryReader, ToolsetConfigurationReader configReader) at Microsoft.Build.Evaluation.ProjectCollection..ctor(IDictionary2 globalProperties, IEnumerable1 loggers, IEnumerable1 remoteLoggers, ToolsetDefinitionLocations toolsetDefinitionLocations, Int32 maxNodeCount, Boolean onlyLogCriticalEvents, Boolean loadProjectsReadOnly, Boolean useAsynchronousLogging, Boolean reuseProjectRootElementCache) at Microsoft.Build.Evaluation.ProjectCollection…ctor(IDictionary2 globalProperties, IEnumerable1 loggers, IEnumerable1 remoteLoggers, ToolsetDefinitionLocations toolsetDefinitionLocations, Int32 maxNodeCount, Boolean onlyLogCriticalEvents, Boolean loadProjectsReadOnly) at Microsoft.Build.Evaluation.ProjectCollection..ctor(IDictionary2 globalProperties, IEnumerable1 loggers, IEnumerable1 remoteLoggers, ToolsetDefinitionLocations toolsetDefinitionLocations, Int32 maxNodeCount, Boolean onlyLogCriticalEvents) at Microsoft.Build.Evaluation.ProjectCollection…ctor(IDictionary2 globalProperties, IEnumerable1 loggers, ToolsetDefinitionLocations toolsetDefinitionLocations) at Microsoft.Build.Evaluation.ProjectCollection…ctor(IDictionary2 globalProperties) at Microsoft.Build.Evaluation.ProjectCollection..ctor() at MSBuild.Abstractions.MSBuildConversionWorkspace..ctor(ImmutableArray1 paths, Boolean noBackup, String tfm, Boolean keepCurrentTFMs, Boolean forceWeb) in //src/MSBuild.Abstractions/MSBuildConversionWorkspace.cs:line 24 at MSBuild.Abstractions.MSBuildConversionWorkspaceLoader.LoadWorkspace(String path, Boolean noBackup, String tfm, Boolean keepCurrentTFMs, Boolean forceWeb) in //src/MSBuild.Abstractions/MSBuildConversionWorkspaceLoader.cs:line 45 at MSBuild.Conversion.Program.Run(String project, String workspace, String msbuildPath, String tfm, Boolean forceWebConversion, Boolean preview, Boolean diffOnly, Boolean noBackup, Boolean keepCurrentTfms, Boolean update, Boolean mauiConversion) in /_/src/try-convert/Program.cs:line 133

Issue Analytics

  • State:open
  • Created 8 months ago
  • Comments:6

github_iconTop GitHub Comments

1reaction
AdamTaylorQuiltercommented, Apr 13, 2023

I also have this issue. Using sdk v5 didn’t help.

1reaction
jlehman93commented, Jan 25, 2023

I was having the same issue. I was able to get it by running by using the 5.0 sdk. I ran it with the flag -m "C:\Program Files\dotnet\sdk\5.0.408"

Read more comments on GitHub >

github_iconTop Results From Across the Web

No results found

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found