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.Threading.Tasks.Dataflow #1079

Open
mc0re opened this issue Mar 30, 2022 · 7 comments
Open

Could not load file or assembly System.Threading.Tasks.Dataflow #1079

mc0re opened this issue Mar 30, 2022 · 7 comments
Labels
community reported Triaged Label to show that UA team has triaged this issue.

Comments

@mc0re
Copy link

mc0re commented Mar 30, 2022

Problem encountered on https://dotnet.microsoft.com/en-us/platform/upgrade-assistant/tutorial/install-upgrade-assistant
Operating System: windows

Tried to convert a .NET Framework 4.6.1 project:

[11:02:54 INF] Applying upgrade step Convert project file to SDK style
[11:02:56 INF] Converting project file format with try-convert, version 0.9.232202
[11:02:57 INF] [dotnet] Microsoft.Build.Framework.InternalErrorException: MSB0001: Internal MSBuild Error: Throwing from logger shutdown
[11:02:57 INF] [dotnet] =============
[11:02:57 INF] [dotnet] System.IO.FileLoadException: Could not load file or assembly 'System.Threading.Tasks.Dataflow, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. Could not find or load a specific file. (0x80131621)
[11:02:57 INF] [dotnet] File name: 'System.Threading.Tasks.Dataflow, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
[11:02:57 INF] [dotnet]    at Microsoft.Build.BackEnd.Logging.LoggingService.ShutdownComponent()
[11:02:57 INF] [dotnet]    at Microsoft.Build.Evaluation.ProjectCollection.ShutDownLoggingService()
[11:02:57 INF] [dotnet]  ---> System.IO.FileLoadException: Could not load file or assembly 'System.Threading.Tasks.Dataflow, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. Could not find or load a specific file. (0x80131621)
[11:02:57 INF] [dotnet] File name: 'System.Threading.Tasks.Dataflow, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
[11:02:57 INF] [dotnet]    at Microsoft.Build.BackEnd.Logging.LoggingService.ShutdownComponent()
[11:02:57 INF] [dotnet]    at Microsoft.Build.Evaluation.ProjectCollection.ShutDownLoggingService()
[11:02:57 INF] [dotnet]    --- End of inner exception stack trace ---
[11:02:57 INF] [dotnet]    at Microsoft.Build.Shared.ErrorUtilities.ThrowInternalError(String message, Exception innerException, Object[] args)
[11:02:57 INF] [dotnet]    at Microsoft.Build.Evaluation.ProjectCollection.ShutDownLoggingService()
[11:02:57 ERR] [dotnet] Error: Exited with non-success code: -1
[11:02:57 INF] [dotnet]    at Microsoft.Build.Evaluation.ProjectCollection..ctor(IDictionary`2 globalProperties, IEnumerable`1 loggers, IEnumerable`1 remoteLoggers, ToolsetDefinitionLocations toolsetDefinitionLocations, Int32 maxNodeCount, Boolean onlyLogCriticalEvents, Boolean loadProjectsReadOnly)
[11:02:58 FTL] Conversion with try-convert failed.
[11:02:59 WRN] Upgrade step Convert project file to SDK style failed: Failed: Conversion with try-convert failed.

The project does not use Dataflow.

@fue-medatixx
Copy link

Hello, we get the same error while execute try-convert. The project does not use Dataflow.

Microsoft.Build.Framework.InternalErrorException: MSB0001: Internal MSBuild Error: Throwing from logger shutdown

System.IO.FileLoadException: Could not load file or assembly 'System.Threading.Tasks.Dataflow, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. Could not find or load a specific file. (0x80131621)
File name: 'System.Threading.Tasks.Dataflow, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
at Microsoft.Build.BackEnd.Logging.LoggingService.ShutdownComponent()
at Microsoft.Build.Evaluation.ProjectCollection.ShutDownLoggingService()
---> System.IO.FileLoadException: Could not load file or assembly 'System.Threading.Tasks.Dataflow, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. Could not find or load a specific file. (0x80131621)
File name: 'System.Threading.Tasks.Dataflow, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
at Microsoft.Build.BackEnd.Logging.LoggingService.ShutdownComponent()
at Microsoft.Build.Evaluation.ProjectCollection.ShutDownLoggingService()
--- End of inner exception stack trace ---
at Microsoft.Build.Shared.ErrorUtilities.ThrowInternalError(String message, Exception innerException, Object[] args)
at Microsoft.Build.Evaluation.ProjectCollection.ShutDownLoggingService()
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

@sunandabalu
Copy link
Member

@mc0re / @fue-medatixx What version of msbuild is getting used for the tool? Locally when I tried to repro it, I could not see the error and it was Using MSBuild from C:\Program Files\dotnet\sdk\6.0.201\

@sunandabalu sunandabalu added community reported Triaged Label to show that UA team has triaged this issue. labels Apr 6, 2022
@fue-medatixx
Copy link

@mc0re / @fue-medatixx What version of msbuild is getting used for the tool? Locally when I tried to repro it, I could not see the error and it was Using MSBuild from C:\Program Files\dotnet\sdk\6.0.201\

The same msbuild version is used. We get the same error if we use try-convert standalone.
The error goes away if we use try-convert with the option -m "C:\Program Files\dotnet\sdk\5.0.406"

@sunandabalu
Copy link
Member

@mc0re / @fue-medatixx What version of msbuild is getting used for the tool? Locally when I tried to repro it, I could not see the error and it was Using MSBuild from C:\Program Files\dotnet\sdk\6.0.201\

The same msbuild version is used. We get the same error if we use try-convert standalone. The error goes away if we use try-convert with the option -m "C:\Program Files\dotnet\sdk\5.0.406"

You can do the same with UA too using --msbuild-path parameter

@mc0re
Copy link
Author

mc0re commented Apr 7, 2022

I use upgrade-assistant version 0.2.241603.
The version information printed at the start of the process:

[08:52:26 INF] Loaded 5 extensions
[08:52:30 INF] MSBuild registered from C:\Program Files\dotnet\sdk\5.0.104\
[08:52:32 INF] Found Visual Studio v17.1.32328.378 [C:\Program Files\Microsoft Visual Studio\2022\Enterprise]

Which is a bit strange as I have .NET 6 installed.

@smoothdeveloper
Copy link

In case it helps, as I face same issue in dotnet 5 sdk environment (that needs to ship bits for .net 4.8 framework), as of today, I need to update to dotnet sdk 6 and run the tool with:

dotnet tool run try-convert -m "C:\Program Files\dotnet\sdk\5.0.407"

otherwise, I get the same kind of errors, for variety of different assemblies.

I still remember and face binding redirect issues plaguing .net framework eco system, and I feel this hasn't been ironed out to smoothen the ride of dotnet SDK, runtime and application end users, and all those in between trying to keep legacy of dotnet alive and up to date, but thanks a lot for the tool!

@sunandabalu
Copy link
Member

I use upgrade-assistant version 0.2.241603. The version information printed at the start of the process:

[08:52:26 INF] Loaded 5 extensions
[08:52:30 INF] MSBuild registered from C:\Program Files\dotnet\sdk\5.0.104\
[08:52:32 INF] Found Visual Studio v17.1.32328.378 [C:\Program Files\Microsoft Visual Studio\2022\Enterprise]

Which is a bit strange as I have .NET 6 installed.

0.2x is an older version of UA, could you try with any of the latest versions (0.3x)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community reported Triaged Label to show that UA team has triaged this issue.
Projects
None yet
Development

No branches or pull requests

4 participants