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 issueI 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(List
1 arguments, SpanBasedStringBuilder argumentBuilder)
at Microsoft.Build.Evaluation.Expander2.ExtractFunctionArguments(IElementLocation elementLocation, String expressionFunction, String argumentsString) at Microsoft.Build.Evaluation.Expander
2.Function1.ConstructFunction(IElementLocation elementLocation, String expressionFunction, Int32 argumentStartIndex, Int32 methodStartIndex, FunctionBuilder
1& functionBuilder)
at Microsoft.Build.Evaluation.Expander2.Function
1.ExtractPropertyFunction(String expressionFunction, IElementLocation elementLocation, Object propertyValue, UsedUninitializedProperties usedUnInitializedProperties, IFileSystem fileSystem)
at Microsoft.Build.Evaluation.Expander2.PropertyExpander
1.ExpandPropertyBody(String propertyBody, Object propertyValue, IPropertyProvider1 properties, ExpanderOptions options, IElementLocation elementLocation, UsedUninitializedProperties usedUninitializedProperties, IFileSystem fileSystem) at Microsoft.Build.Evaluation.Expander
2.PropertyExpander1.ExpandPropertiesLeaveTypedAndEscaped(String expression, IPropertyProvider
1 properties, ExpanderOptions options, IElementLocation elementLocation, UsedUninitializedProperties usedUninitializedProperties, IFileSystem fileSystem, LoggingContext loggingContext)
at Microsoft.Build.Evaluation.Expander2.PropertyExpander
1.ExpandPropertiesLeaveEscaped(String expression, IPropertyProvider1 properties, ExpanderOptions options, IElementLocation elementLocation, UsedUninitializedProperties usedUninitializedProperties, IFileSystem fileSystem, LoggingContext loggingContext) at Microsoft.Build.Evaluation.Expander
2.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, Expander
2 expander)
at Microsoft.Build.Evaluation.ToolsetReader.EvaluateAndSetProperty(ToolsetPropertyDefinition property, PropertyDictionary1 properties, PropertyDictionary
1 globalProperties, PropertyDictionary1 initialProperties, Boolean accumulateProperties, String& toolsPath, String& binPath, Expander
2& expander)
at Microsoft.Build.Evaluation.ToolsetReader.ReadToolset(ToolsetPropertyDefinition toolsVersion, PropertyDictionary1 globalProperties, PropertyDictionary
1 initialProperties, Boolean accumulateProperties)
at Microsoft.Build.Evaluation.ToolsetReader.ReadEachToolset(Dictionary2 toolsets, PropertyDictionary
1 globalProperties, PropertyDictionary1 initialProperties, Boolean accumulateProperties) at Microsoft.Build.Evaluation.ToolsetReader.ReadToolsets(Dictionary
2 toolsets, PropertyDictionary1 globalProperties, PropertyDictionary
1 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, PropertyDictionary
1 environmentProperties, PropertyDictionary1 globalProperties, ToolsetDefinitionLocations locations) at Microsoft.Build.Evaluation.ProjectCollection.InitializeToolsetCollection(ToolsetRegistryReader registryReader, ToolsetConfigurationReader configReader) at Microsoft.Build.Evaluation.ProjectCollection..ctor(IDictionary
2 globalProperties, IEnumerable1 loggers, IEnumerable
1 remoteLoggers, ToolsetDefinitionLocations toolsetDefinitionLocations, Int32 maxNodeCount, Boolean onlyLogCriticalEvents, Boolean loadProjectsReadOnly, Boolean useAsynchronousLogging, Boolean reuseProjectRootElementCache)
at Microsoft.Build.Evaluation.ProjectCollection…ctor(IDictionary2 globalProperties, IEnumerable
1 loggers, IEnumerable1 remoteLoggers, ToolsetDefinitionLocations toolsetDefinitionLocations, Int32 maxNodeCount, Boolean onlyLogCriticalEvents, Boolean loadProjectsReadOnly) at Microsoft.Build.Evaluation.ProjectCollection..ctor(IDictionary
2 globalProperties, IEnumerable1 loggers, IEnumerable
1 remoteLoggers, ToolsetDefinitionLocations toolsetDefinitionLocations, Int32 maxNodeCount, Boolean onlyLogCriticalEvents)
at Microsoft.Build.Evaluation.ProjectCollection…ctor(IDictionary2 globalProperties, IEnumerable
1 loggers, ToolsetDefinitionLocations toolsetDefinitionLocations)
at Microsoft.Build.Evaluation.ProjectCollection…ctor(IDictionary2 globalProperties) at Microsoft.Build.Evaluation.ProjectCollection..ctor() at MSBuild.Abstractions.MSBuildConversionWorkspace..ctor(ImmutableArray
1 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:
- Created 8 months ago
- Comments:6
Top GitHub Comments
I also have this issue. Using sdk v5 didn’t help.
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"