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

dnt fails to run on macos #80

Open
vetras opened this issue Nov 26, 2020 · 13 comments
Open

dnt fails to run on macos #80

vetras opened this issue Nov 26, 2020 · 13 comments

Comments

@vetras
Copy link

vetras commented Nov 26, 2020

When i run dnt I just get:

➜ dnt
Unhandled exception. System.IO.FileLoadException: Could not load file or assembly 'System.Runtime, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The located assembly's manifest definition does not match the assembly reference. (0x80131040)
File name: 'System.Runtime, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'

[1] 18864 abort dnt


More Information:

I did install netcore using brew, but i have the same issue if I install from from https://dotnet.microsoft.com/download/dotnet-core/3.1

Then I installed the dnt tool globally with:

$ dotnet tool install --global dnt

Because I use zsh, I added this to my rc file:

export PATH="$PATH:$HOME/.dotnet/tools"

I'm using macos catalina 10.15.7.

dotnet info:


➜ dotnet --info
.NET Core SDK (reflecting any global.json):
 Version:   3.1.110
 Commit:    f02c158773

Runtime Environment:
 OS Name:     Mac OS X
 OS Version:  10.15
 OS Platform: Darwin
 RID:         osx.10.15-x64
 Base Path:   /usr/local/Cellar/dotnet/3.1.110/libexec/sdk/3.1.110/

Host (useful for support):
  Version: 3.1.10
  Commit:  2b1abb2399

.NET Core SDKs installed:
  3.1.110 [/usr/local/Cellar/dotnet/3.1.110/libexec/sdk]

.NET Core runtimes installed:
  Microsoft.AspNetCore.App 3.1.10 [/usr/local/Cellar/dotnet/3.1.110/libexec/shared/Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 3.1.10 [/usr/local/Cellar/dotnet/3.1.110/libexec/shared/Microsoft.NETCore.App]

To install additional .NET Core runtimes or SDKs:
  https://aka.ms/dotnet-download
@vetras
Copy link
Author

vetras commented Nov 26, 2020

using an older version works, so:

dotnet tool install DNT --global --version 1.4.1
$ dnt
DNT (DotNetTools, https://github.com/RSuter/DNT, v1.4.1.0)
Binary: /Users/carlos/.dotnet/tools/.store/dnt/1.4.1/dnt/1.4.1/tools/netcoreapp3.1/any/dnt.dll

Commands:
  help
  create-solution
  add-target-framework
...

@Igor-Pchelko
Copy link

dnt doesn't work with dotnet 5.
I've added local global.json to specify dotnet version explicitly and it works for me:

{
  "sdk": {
    "version": "3.1.404"
  }
}

@RicoSuter
Copy link
Owner

Latest version of DNT should work with .NET 5, no?

@Igor-Pchelko
Copy link

no, it doesn't at least for me.

@Igor-Pchelko
Copy link

btw, env is: dotnet 5, osx big sur

@Igor-Pchelko
Copy link

here you go

dnt switch-to-projects switcher.json
DNT (DotNetTools, https://github.com/RSuter/DNT, v1.5.1.0)
Binary: /Users/ipcholko/.dotnet/tools/.store/dnt/1.5.1/dnt/1.5.1/tools/netcoreapp3.1/any/dnt.dll

Executing: dotnet
The project '/Users/ipcholko/Documents/fontem-ventures/acceleration/acceleration-demandware-integration-gateway/DemandwareIntegrationGateway/DemandwareIntegrationGateway.csproj' could not be loaded: System.InvalidOperationException: Not a project: /Users/ipcholko/Documents/fontem-ventures/acceleration/acceleration-demandware-integration-gateway/DemandwareIntegrationGateway/DemandwareIntegrationGateway.csproj
 ---> Microsoft.Build.Exceptions.InvalidProjectFileException: The SDK resolver type "WorkloadSdkResolver" failed to load. Could not load file or assembly 'System.Runtime, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified.
  /Users/ipcholko/Documents/fontem-ventures/acceleration/acceleration-demandware-integration-gateway/DemandwareIntegrationGateway/DemandwareIntegrationGateway.csproj
 ---> System.IO.FileNotFoundException: Could not load file or assembly 'System.Runtime, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified.

File name: 'System.Runtime, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'


   --- End of inner exception stack trace ---
   at Microsoft.Build.Shared.ProjectFileErrorUtilities.VerifyThrowInvalidProjectFile(Boolean condition, String errorSubCategoryResourceName, BuildEventFileInfo projectFile, Exception innerException, String resourceName, Object[] args)
   at Microsoft.Build.Shared.ProjectFileErrorUtilities.ThrowInvalidProjectFile(BuildEventFileInfo projectFile, Exception innerException, String resourceName, Object[] args)
   at Microsoft.Build.BackEnd.SdkResolution.SdkResolverLoader.LoadResolvers(String resolverPath, LoggingContext loggingContext, ElementLocation location, List`1 resolvers)
   at Microsoft.Build.BackEnd.SdkResolution.SdkResolverLoader.LoadResolvers(LoggingContext loggingContext, ElementLocation location)
   at Microsoft.Build.BackEnd.SdkResolution.SdkResolverService.Initialize(LoggingContext loggingContext, ElementLocation location)
   at Microsoft.Build.BackEnd.SdkResolution.SdkResolverService.ResolveSdk(Int32 submissionId, SdkReference sdk, LoggingContext loggingContext, ElementLocation sdkReferenceLocation, String solutionPath, String projectPath, Boolean interactive, Boolean isRunningInVisualStudio)
   at Microsoft.Build.BackEnd.SdkResolution.CachingSdkResolverService.<>n__0(Int32 submissionId, SdkReference sdk, LoggingContext loggingContext, ElementLocation sdkReferenceLocation, String solutionPath, String projectPath, Boolean interactive, Boolean isRunningInVisualStudio)
   at Microsoft.Build.BackEnd.SdkResolution.CachingSdkResolverService.<>c__DisplayClass3_0.<ResolveSdk>b__1()
   at System.Lazy`1.ViaFactory(LazyThreadSafetyMode mode)
   at System.Lazy`1.ExecutionAndPublication(LazyHelper executionAndPublication, Boolean useDefaultConstructor)
   at System.Lazy`1.CreateValue()
   at System.Lazy`1.get_Value()
   at Microsoft.Build.BackEnd.SdkResolution.CachingSdkResolverService.ResolveSdk(Int32 submissionId, SdkReference sdk, LoggingContext loggingContext, ElementLocation sdkReferenceLocation, String solutionPath, String projectPath, Boolean interactive, Boolean isRunningInVisualStudio)
   at Microsoft.Build.Evaluation.Evaluator`4.ExpandAndLoadImportsFromUnescapedImportExpressionConditioned(String directoryOfImportingFile, ProjectImportElement importElement, List`1& projects, SdkResult& sdkResult, Boolean throwOnFileNotExistsError)
   at Microsoft.Build.Evaluation.Evaluator`4.ExpandAndLoadImports(String directoryOfImportingFile, ProjectImportElement importElement, SdkResult& sdkResult)
   at Microsoft.Build.Evaluation.Evaluator`4.EvaluateImportElement(String directoryOfImportingFile, ProjectImportElement importElement)
   at Microsoft.Build.Evaluation.Evaluator`4.PerformDepthFirstPass(ProjectRootElement currentProjectOrImport)
   at Microsoft.Build.Evaluation.Evaluator`4.Evaluate()
   at Microsoft.Build.Evaluation.Evaluator`4.Evaluate(IEvaluatorData`4 data, ProjectRootElement root, ProjectLoadSettings loadSettings, Int32 maxNodeCount, PropertyDictionary`1 environmentProperties, ILoggingService loggingService, IItemFactory`2 itemFactory, IToolsetProvider toolsetProvider, ProjectRootElementCacheBase projectRootElementCache, BuildEventContext buildEventContext, ISdkResolverService sdkResolverService, Int32 submissionId, EvaluationContext evaluationContext, Boolean interactive)
   at Microsoft.Build.Evaluation.Project.ProjectImpl.Reevaluate(ILoggingService loggingServiceForEvaluation, ProjectLoadSettings loadSettings, EvaluationContext evaluationContext)
   at Microsoft.Build.Evaluation.Project.ProjectImpl.ReevaluateIfNecessary(ILoggingService loggingServiceForEvaluation, ProjectLoadSettings loadSettings, EvaluationContext evaluationContext)
   at Microsoft.Build.Evaluation.Project.ProjectImpl.ReevaluateIfNecessary(ILoggingService loggingServiceForEvaluation, EvaluationContext evaluationContext)
   at Microsoft.Build.Evaluation.Project.ProjectImpl.ReevaluateIfNecessary(EvaluationContext evaluationContext)
   at Microsoft.Build.Evaluation.Project.ProjectImpl.Initialize(IDictionary`2 globalProperties, String toolsVersion, String subToolsetVersion, ProjectLoadSettings loadSettings, EvaluationContext evaluationContext)
   at Microsoft.Build.Evaluation.Project..ctor(String projectFile, IDictionary`2 globalProperties, String toolsVersion, String subToolsetVersion, ProjectCollection projectCollection, ProjectLoadSettings loadSettings, EvaluationContext evaluationContext)
   at Microsoft.Build.Evaluation.ProjectCollection.LoadProject(String fileName, IDictionary`2 globalProperties, String toolsVersion)
   at Microsoft.Build.Evaluation.ProjectCollection.LoadProject(String fileName, String toolsVersion)
   at Microsoft.Build.Evaluation.ProjectCollection.LoadProject(String fileName)
   at Dnt.Commands.ProjectExtensions.LoadProject(String projectPath) in C:\projects\dnt\src\Dnt.Commands\ProjectExtensions.cs:line 53
   --- End of inner exception stack trace ---
   at Dnt.Commands.ProjectExtensions.LoadProject(String projectPath) in C:\projects\dnt\src\Dnt.Commands\ProjectExtensions.cs:line 59
   at Dnt.Commands.Packages.SwitchPackagesToProjectsCommand.SwitchToProjects(ReferenceSwitcherConfiguration configuration, IConsoleHost host) in C:\projects\dnt\src\Dnt.Commands\Packages\SwitchPackagesToProjectsCommand.cs:line 57
The project '/Users/ipcholko/Documents/fontem-ventures/acceleration/acceleration-demandware-integration-gateway/DemandwareIntegrationGateway.Test/DemandwareIntegrationGateway.Test.csproj' could not be loaded: System.InvalidOperationException: Not a project: /Users/ipcholko/Documents/fontem-ventures/acceleration/acceleration-demandware-integration-gateway/DemandwareIntegrationGateway.Test/DemandwareIntegrationGateway.Test.csproj
 ---> Microsoft.Build.Exceptions.InvalidProjectFileException: The SDK resolver type "WorkloadSdkResolver" failed to load. Could not load file or assembly 'System.Runtime, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified.
  /Users/ipcholko/Documents/fontem-ventures/acceleration/acceleration-demandware-integration-gateway/DemandwareIntegrationGateway.Test/DemandwareIntegrationGateway.Test.csproj
 ---> System.IO.FileNotFoundException: Could not load file or assembly 'System.Runtime, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified.

File name: 'System.Runtime, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'


   --- End of inner exception stack trace ---
   at Microsoft.Build.Shared.ProjectFileErrorUtilities.VerifyThrowInvalidProjectFile(Boolean condition, String errorSubCategoryResourceName, BuildEventFileInfo projectFile, Exception innerException, String resourceName, Object[] args)
   at Microsoft.Build.Shared.ProjectFileErrorUtilities.ThrowInvalidProjectFile(BuildEventFileInfo projectFile, Exception innerException, String resourceName, Object[] args)
   at Microsoft.Build.BackEnd.SdkResolution.SdkResolverLoader.LoadResolvers(String resolverPath, LoggingContext loggingContext, ElementLocation location, List`1 resolvers)
   at Microsoft.Build.BackEnd.SdkResolution.SdkResolverLoader.LoadResolvers(LoggingContext loggingContext, ElementLocation location)
   at Microsoft.Build.BackEnd.SdkResolution.SdkResolverService.Initialize(LoggingContext loggingContext, ElementLocation location)
   at Microsoft.Build.BackEnd.SdkResolution.SdkResolverService.ResolveSdk(Int32 submissionId, SdkReference sdk, LoggingContext loggingContext, ElementLocation sdkReferenceLocation, String solutionPath, String projectPath, Boolean interactive, Boolean isRunningInVisualStudio)
   at Microsoft.Build.BackEnd.SdkResolution.CachingSdkResolverService.<>n__0(Int32 submissionId, SdkReference sdk, LoggingContext loggingContext, ElementLocation sdkReferenceLocation, String solutionPath, String projectPath, Boolean interactive, Boolean isRunningInVisualStudio)
   at Microsoft.Build.BackEnd.SdkResolution.CachingSdkResolverService.<>c__DisplayClass3_0.<ResolveSdk>b__1()
   at System.Lazy`1.ViaFactory(LazyThreadSafetyMode mode)
   at System.Lazy`1.ExecutionAndPublication(LazyHelper executionAndPublication, Boolean useDefaultConstructor)
   at System.Lazy`1.CreateValue()
   at System.Lazy`1.get_Value()
   at Microsoft.Build.BackEnd.SdkResolution.CachingSdkResolverService.ResolveSdk(Int32 submissionId, SdkReference sdk, LoggingContext loggingContext, ElementLocation sdkReferenceLocation, String solutionPath, String projectPath, Boolean interactive, Boolean isRunningInVisualStudio)
   at Microsoft.Build.Evaluation.Evaluator`4.ExpandAndLoadImportsFromUnescapedImportExpressionConditioned(String directoryOfImportingFile, ProjectImportElement importElement, List`1& projects, SdkResult& sdkResult, Boolean throwOnFileNotExistsError)
   at Microsoft.Build.Evaluation.Evaluator`4.ExpandAndLoadImports(String directoryOfImportingFile, ProjectImportElement importElement, SdkResult& sdkResult)
   at Microsoft.Build.Evaluation.Evaluator`4.EvaluateImportElement(String directoryOfImportingFile, ProjectImportElement importElement)
   at Microsoft.Build.Evaluation.Evaluator`4.PerformDepthFirstPass(ProjectRootElement currentProjectOrImport)
   at Microsoft.Build.Evaluation.Evaluator`4.Evaluate()
   at Microsoft.Build.Evaluation.Evaluator`4.Evaluate(IEvaluatorData`4 data, ProjectRootElement root, ProjectLoadSettings loadSettings, Int32 maxNodeCount, PropertyDictionary`1 environmentProperties, ILoggingService loggingService, IItemFactory`2 itemFactory, IToolsetProvider toolsetProvider, ProjectRootElementCacheBase projectRootElementCache, BuildEventContext buildEventContext, ISdkResolverService sdkResolverService, Int32 submissionId, EvaluationContext evaluationContext, Boolean interactive)
   at Microsoft.Build.Evaluation.Project.ProjectImpl.Reevaluate(ILoggingService loggingServiceForEvaluation, ProjectLoadSettings loadSettings, EvaluationContext evaluationContext)
   at Microsoft.Build.Evaluation.Project.ProjectImpl.ReevaluateIfNecessary(ILoggingService loggingServiceForEvaluation, ProjectLoadSettings loadSettings, EvaluationContext evaluationContext)
   at Microsoft.Build.Evaluation.Project.ProjectImpl.ReevaluateIfNecessary(ILoggingService loggingServiceForEvaluation, EvaluationContext evaluationContext)
   at Microsoft.Build.Evaluation.Project.ProjectImpl.ReevaluateIfNecessary(EvaluationContext evaluationContext)
   at Microsoft.Build.Evaluation.Project.ProjectImpl.Initialize(IDictionary`2 globalProperties, String toolsVersion, String subToolsetVersion, ProjectLoadSettings loadSettings, EvaluationContext evaluationContext)
   at Microsoft.Build.Evaluation.Project..ctor(String projectFile, IDictionary`2 globalProperties, String toolsVersion, String subToolsetVersion, ProjectCollection projectCollection, ProjectLoadSettings loadSettings, EvaluationContext evaluationContext)
   at Microsoft.Build.Evaluation.ProjectCollection.LoadProject(String fileName, IDictionary`2 globalProperties, String toolsVersion)
   at Microsoft.Build.Evaluation.ProjectCollection.LoadProject(String fileName, String toolsVersion)
   at Microsoft.Build.Evaluation.ProjectCollection.LoadProject(String fileName)
   at Dnt.Commands.ProjectExtensions.LoadProject(String projectPath) in C:\projects\dnt\src\Dnt.Commands\ProjectExtensions.cs:line 53
   --- End of inner exception stack trace ---
   at Dnt.Commands.ProjectExtensions.LoadProject(String projectPath) in C:\projects\dnt\src\Dnt.Commands\ProjectExtensions.cs:line 59
   at Dnt.Commands.Packages.SwitchPackagesToProjectsCommand.SwitchToProjects(ReferenceSwitcherConfiguration configuration, IConsoleHost host) in C:\projects\dnt\src\Dnt.Commands\Packages\SwitchPackagesToProjectsCommand.cs:line 57
The project '/Users/ipcholko/Documents/fontem-ventures/acceleration/acceleration-demandware-integration-gateway/DemandwareIntegrationGateway.API/DemandwareIntegrationGateway.API.csproj' could not be loaded: System.InvalidOperationException: Not a project: /Users/ipcholko/Documents/fontem-ventures/acceleration/acceleration-demandware-integration-gateway/DemandwareIntegrationGateway.API/DemandwareIntegrationGateway.API.csproj
 ---> Microsoft.Build.Exceptions.InvalidProjectFileException: The SDK resolver type "WorkloadSdkResolver" failed to load. Could not load file or assembly 'System.Runtime, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified.
  /Users/ipcholko/Documents/fontem-ventures/acceleration/acceleration-demandware-integration-gateway/DemandwareIntegrationGateway.API/DemandwareIntegrationGateway.API.csproj
 ---> System.IO.FileNotFoundException: Could not load file or assembly 'System.Runtime, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified.

File name: 'System.Runtime, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'


   --- End of inner exception stack trace ---
   at Microsoft.Build.Shared.ProjectFileErrorUtilities.VerifyThrowInvalidProjectFile(Boolean condition, String errorSubCategoryResourceName, BuildEventFileInfo projectFile, Exception innerException, String resourceName, Object[] args)
   at Microsoft.Build.Shared.ProjectFileErrorUtilities.ThrowInvalidProjectFile(BuildEventFileInfo projectFile, Exception innerException, String resourceName, Object[] args)
   at Microsoft.Build.BackEnd.SdkResolution.SdkResolverLoader.LoadResolvers(String resolverPath, LoggingContext loggingContext, ElementLocation location, List`1 resolvers)
   at Microsoft.Build.BackEnd.SdkResolution.SdkResolverLoader.LoadResolvers(LoggingContext loggingContext, ElementLocation location)
   at Microsoft.Build.BackEnd.SdkResolution.SdkResolverService.Initialize(LoggingContext loggingContext, ElementLocation location)
   at Microsoft.Build.BackEnd.SdkResolution.SdkResolverService.ResolveSdk(Int32 submissionId, SdkReference sdk, LoggingContext loggingContext, ElementLocation sdkReferenceLocation, String solutionPath, String projectPath, Boolean interactive, Boolean isRunningInVisualStudio)
   at Microsoft.Build.BackEnd.SdkResolution.CachingSdkResolverService.<>n__0(Int32 submissionId, SdkReference sdk, LoggingContext loggingContext, ElementLocation sdkReferenceLocation, String solutionPath, String projectPath, Boolean interactive, Boolean isRunningInVisualStudio)
   at Microsoft.Build.BackEnd.SdkResolution.CachingSdkResolverService.<>c__DisplayClass3_0.<ResolveSdk>b__1()
   at System.Lazy`1.ViaFactory(LazyThreadSafetyMode mode)
   at System.Lazy`1.ExecutionAndPublication(LazyHelper executionAndPublication, Boolean useDefaultConstructor)
   at System.Lazy`1.CreateValue()
   at System.Lazy`1.get_Value()
   at Microsoft.Build.BackEnd.SdkResolution.CachingSdkResolverService.ResolveSdk(Int32 submissionId, SdkReference sdk, LoggingContext loggingContext, ElementLocation sdkReferenceLocation, String solutionPath, String projectPath, Boolean interactive, Boolean isRunningInVisualStudio)
   at Microsoft.Build.Evaluation.Evaluator`4.ExpandAndLoadImportsFromUnescapedImportExpressionConditioned(String directoryOfImportingFile, ProjectImportElement importElement, List`1& projects, SdkResult& sdkResult, Boolean throwOnFileNotExistsError)
   at Microsoft.Build.Evaluation.Evaluator`4.ExpandAndLoadImports(String directoryOfImportingFile, ProjectImportElement importElement, SdkResult& sdkResult)
   at Microsoft.Build.Evaluation.Evaluator`4.EvaluateImportElement(String directoryOfImportingFile, ProjectImportElement importElement)
   at Microsoft.Build.Evaluation.Evaluator`4.PerformDepthFirstPass(ProjectRootElement currentProjectOrImport)
   at Microsoft.Build.Evaluation.Evaluator`4.Evaluate()
   at Microsoft.Build.Evaluation.Evaluator`4.Evaluate(IEvaluatorData`4 data, ProjectRootElement root, ProjectLoadSettings loadSettings, Int32 maxNodeCount, PropertyDictionary`1 environmentProperties, ILoggingService loggingService, IItemFactory`2 itemFactory, IToolsetProvider toolsetProvider, ProjectRootElementCacheBase projectRootElementCache, BuildEventContext buildEventContext, ISdkResolverService sdkResolverService, Int32 submissionId, EvaluationContext evaluationContext, Boolean interactive)
   at Microsoft.Build.Evaluation.Project.ProjectImpl.Reevaluate(ILoggingService loggingServiceForEvaluation, ProjectLoadSettings loadSettings, EvaluationContext evaluationContext)
   at Microsoft.Build.Evaluation.Project.ProjectImpl.ReevaluateIfNecessary(ILoggingService loggingServiceForEvaluation, ProjectLoadSettings loadSettings, EvaluationContext evaluationContext)
   at Microsoft.Build.Evaluation.Project.ProjectImpl.ReevaluateIfNecessary(ILoggingService loggingServiceForEvaluation, EvaluationContext evaluationContext)
   at Microsoft.Build.Evaluation.Project.ProjectImpl.ReevaluateIfNecessary(EvaluationContext evaluationContext)
   at Microsoft.Build.Evaluation.Project.ProjectImpl.Initialize(IDictionary`2 globalProperties, String toolsVersion, String subToolsetVersion, ProjectLoadSettings loadSettings, EvaluationContext evaluationContext)
   at Microsoft.Build.Evaluation.Project..ctor(String projectFile, IDictionary`2 globalProperties, String toolsVersion, String subToolsetVersion, ProjectCollection projectCollection, ProjectLoadSettings loadSettings, EvaluationContext evaluationContext)
   at Microsoft.Build.Evaluation.ProjectCollection.LoadProject(String fileName, IDictionary`2 globalProperties, String toolsVersion)
   at Microsoft.Build.Evaluation.ProjectCollection.LoadProject(String fileName, String toolsVersion)
   at Microsoft.Build.Evaluation.ProjectCollection.LoadProject(String fileName)
   at Dnt.Commands.ProjectExtensions.LoadProject(String projectPath) in C:\projects\dnt\src\Dnt.Commands\ProjectExtensions.cs:line 53
   --- End of inner exception stack trace ---
   at Dnt.Commands.ProjectExtensions.LoadProject(String projectPath) in C:\projects\dnt\src\Dnt.Commands\ProjectExtensions.cs:line 59
   at Dnt.Commands.Packages.SwitchPackagesToProjectsCommand.SwitchToProjects(ReferenceSwitcherConfiguration configuration, IConsoleHost host) in C:\projects\dnt\src\Dnt.Commands\Packages\SwitchPackagesToProjectsCommand.cs:line 57
The project '/Users/ipcholko/Documents/fontem-ventures/acceleration/acceleration-demandware-integration-gateway/../acceleration-lib-velocity/Velocity/Velocity.csproj' could not be loaded: System.InvalidOperationException: Not a project: /Users/ipcholko/Documents/fontem-ventures/acceleration/acceleration-demandware-integration-gateway/../acceleration-lib-velocity/Velocity/Velocity.csproj
 ---> Microsoft.Build.Exceptions.InvalidProjectFileException: The SDK resolver type "WorkloadSdkResolver" failed to load. Could not load file or assembly 'System.Runtime, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified.
  /Users/ipcholko/Documents/fontem-ventures/acceleration/acceleration-lib-velocity/Velocity/Velocity.csproj
 ---> System.IO.FileNotFoundException: Could not load file or assembly 'System.Runtime, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified.

File name: 'System.Runtime, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'


   --- End of inner exception stack trace ---
   at Microsoft.Build.Shared.ProjectFileErrorUtilities.VerifyThrowInvalidProjectFile(Boolean condition, String errorSubCategoryResourceName, BuildEventFileInfo projectFile, Exception innerException, String resourceName, Object[] args)
   at Microsoft.Build.Shared.ProjectFileErrorUtilities.ThrowInvalidProjectFile(BuildEventFileInfo projectFile, Exception innerException, String resourceName, Object[] args)
   at Microsoft.Build.BackEnd.SdkResolution.SdkResolverLoader.LoadResolvers(String resolverPath, LoggingContext loggingContext, ElementLocation location, List`1 resolvers)
   at Microsoft.Build.BackEnd.SdkResolution.SdkResolverLoader.LoadResolvers(LoggingContext loggingContext, ElementLocation location)
   at Microsoft.Build.BackEnd.SdkResolution.SdkResolverService.Initialize(LoggingContext loggingContext, ElementLocation location)
   at Microsoft.Build.BackEnd.SdkResolution.SdkResolverService.ResolveSdk(Int32 submissionId, SdkReference sdk, LoggingContext loggingContext, ElementLocation sdkReferenceLocation, String solutionPath, String projectPath, Boolean interactive, Boolean isRunningInVisualStudio)
   at Microsoft.Build.BackEnd.SdkResolution.CachingSdkResolverService.<>n__0(Int32 submissionId, SdkReference sdk, LoggingContext loggingContext, ElementLocation sdkReferenceLocation, String solutionPath, String projectPath, Boolean interactive, Boolean isRunningInVisualStudio)
   at Microsoft.Build.BackEnd.SdkResolution.CachingSdkResolverService.<>c__DisplayClass3_0.<ResolveSdk>b__1()
   at System.Lazy`1.ViaFactory(LazyThreadSafetyMode mode)
   at System.Lazy`1.ExecutionAndPublication(LazyHelper executionAndPublication, Boolean useDefaultConstructor)
   at System.Lazy`1.CreateValue()
   at System.Lazy`1.get_Value()
   at Microsoft.Build.BackEnd.SdkResolution.CachingSdkResolverService.ResolveSdk(Int32 submissionId, SdkReference sdk, LoggingContext loggingContext, ElementLocation sdkReferenceLocation, String solutionPath, String projectPath, Boolean interactive, Boolean isRunningInVisualStudio)
   at Microsoft.Build.Evaluation.Evaluator`4.ExpandAndLoadImportsFromUnescapedImportExpressionConditioned(String directoryOfImportingFile, ProjectImportElement importElement, List`1& projects, SdkResult& sdkResult, Boolean throwOnFileNotExistsError)
   at Microsoft.Build.Evaluation.Evaluator`4.ExpandAndLoadImports(String directoryOfImportingFile, ProjectImportElement importElement, SdkResult& sdkResult)
   at Microsoft.Build.Evaluation.Evaluator`4.EvaluateImportElement(String directoryOfImportingFile, ProjectImportElement importElement)
   at Microsoft.Build.Evaluation.Evaluator`4.PerformDepthFirstPass(ProjectRootElement currentProjectOrImport)
   at Microsoft.Build.Evaluation.Evaluator`4.Evaluate()
   at Microsoft.Build.Evaluation.Evaluator`4.Evaluate(IEvaluatorData`4 data, ProjectRootElement root, ProjectLoadSettings loadSettings, Int32 maxNodeCount, PropertyDictionary`1 environmentProperties, ILoggingService loggingService, IItemFactory`2 itemFactory, IToolsetProvider toolsetProvider, ProjectRootElementCacheBase projectRootElementCache, BuildEventContext buildEventContext, ISdkResolverService sdkResolverService, Int32 submissionId, EvaluationContext evaluationContext, Boolean interactive)
   at Microsoft.Build.Evaluation.Project.ProjectImpl.Reevaluate(ILoggingService loggingServiceForEvaluation, ProjectLoadSettings loadSettings, EvaluationContext evaluationContext)
   at Microsoft.Build.Evaluation.Project.ProjectImpl.ReevaluateIfNecessary(ILoggingService loggingServiceForEvaluation, ProjectLoadSettings loadSettings, EvaluationContext evaluationContext)
   at Microsoft.Build.Evaluation.Project.ProjectImpl.ReevaluateIfNecessary(ILoggingService loggingServiceForEvaluation, EvaluationContext evaluationContext)
   at Microsoft.Build.Evaluation.Project.ProjectImpl.ReevaluateIfNecessary(EvaluationContext evaluationContext)
   at Microsoft.Build.Evaluation.Project.ProjectImpl.Initialize(IDictionary`2 globalProperties, String toolsVersion, String subToolsetVersion, ProjectLoadSettings loadSettings, EvaluationContext evaluationContext)
   at Microsoft.Build.Evaluation.Project..ctor(String projectFile, IDictionary`2 globalProperties, String toolsVersion, String subToolsetVersion, ProjectCollection projectCollection, ProjectLoadSettings loadSettings, EvaluationContext evaluationContext)
   at Microsoft.Build.Evaluation.ProjectCollection.LoadProject(String fileName, IDictionary`2 globalProperties, String toolsVersion)
   at Microsoft.Build.Evaluation.ProjectCollection.LoadProject(String fileName, String toolsVersion)
   at Microsoft.Build.Evaluation.ProjectCollection.LoadProject(String fileName)
   at Dnt.Commands.ProjectExtensions.LoadProject(String projectPath) in C:\projects\dnt\src\Dnt.Commands\ProjectExtensions.cs:line 53
   --- End of inner exception stack trace ---
   at Dnt.Commands.ProjectExtensions.LoadProject(String projectPath) in C:\projects\dnt\src\Dnt.Commands\ProjectExtensions.cs:line 59
   at Dnt.Commands.Packages.SwitchPackagesToProjectsCommand.SwitchToProjects(ReferenceSwitcherConfiguration configuration, IConsoleHost host) in C:\projects\dnt\src\Dnt.Commands\Packages\SwitchPackagesToProjectsCommand.cs:line 57

Elapsed time: 00:00:01.4753188%  

@RicoSuter
Copy link
Owner

You need v1.6.1 for .net 5

@Igor-Pchelko
Copy link

1.6.1 works with dotnet 5, thanks!

@TripleEmcoder
Copy link

TripleEmcoder commented Dec 16, 2020

Since this thread seems to be more about .NET 5 than MacOSX I'll post information about the same error I am getting in Azure Pipelines, latest Ubuntu image and latest DNT:

DNT (DotNetTools) NPM CLI
DNT (DotNetTools, https://github.com/RSuter/DNT, v1.6.1.0)
Binary: /home/vsts/work/node_modules/dotnettools/bin/binaries/NetCore31/dnt.dll

System.InvalidOperationException: Not a project: (...).csproj
 ---> Microsoft.Build.Exceptions.InvalidProjectFileException: The SDK resolver type "WorkloadSdkResolver" failed to load. Could not load file or assembly 'System.Runtime, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified.
  /home/vsts/work/1/s/(...).csproj
 ---> System.IO.FileNotFoundException: Could not load file or assembly 'System.Runtime, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified.

File name: 'System.Runtime, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'

Environment information as indicated by the initialize job task:

Agent name: 'Hosted Agent'
Agent machine name: 'fv-az679-285'
Current agent version: '2.179.0'
Operating System
Ubuntu
16.04.7
LTS
Virtual Environment
Environment: ubuntu-16.04
Version: 20201210.0
Included Software: https://github.com/actions/virtual-environments/blob/ubuntu16/20201210.0/images/linux/Ubuntu1604-README.md
Current image version: '20201210.0'

Last time the command succeded versions were as follows:

Agent name: 'Hosted Agent'
Agent machine name: 'fv-az670-452'
Current agent version: '2.177.1'
Operating System
Ubuntu
16.04.7
LTS
Virtual Environment
Environment: ubuntu-16.04
Version: 20201116.1
Included Software: https://github.com/actions/virtual-environments/blob/ubuntu16/20201116.1/images/linux/Ubuntu1604-README.md
Current image version: '20201116.1'

@lkurzyniec
Copy link
Contributor

lkurzyniec commented Dec 24, 2020

There could be a bug in .net 5 sdk
dotnet/sdk#14711

@BraveThrasher
Copy link

Possibly my problem is related to this issue. Below is the output I get on my Windows laptop with Visual Studio 2022 (preview) and .Net 6 installed.
image

@cthumburu
Copy link

@BraveThrasher Do you know how you resolved the issue mentioned above? I'm encountering the same problem with VS2022.

@BraveThrasher
Copy link

@cthumburu the version (1.6.4) I was using, which was the current version at the time, did not support .Net6 yet. The current version (1.7.0) does support .Net6 and updating to that version fixed it for me.

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

No branches or pull requests

7 participants