macOS
Visual Studio for Mac 17.5.3
dotnet 7.0.202
CLI upgrade-assistant 0.5.30
Apologies for ignoring the template, but I don't believe I got far enough for most of it to be relevant.
I'm also not sure this is the right place to report this. This experience is based on this blog post and using the updated CLI tool.
When attempting to run on any iOS or Android project, I just get the following:
Microsoft.Build.Exceptions.InvalidProjectFileException: The imported project "/usr/local/share/dotnet/sdk/7.0.202/Xamarin/iOS/Xamarin.iOS.CSharp.targets" was not found. Confirm that the expression in the Import declaration "/usr/local/share/dotnet/sdk/7.0.202/Xamarin/iOS/Xamarin.iOS.CSharp.targets" is correct, and that the file exists on disk.
Microsoft.Build.Exceptions.InvalidProjectFileException: The imported project "/usr/local/share/dotnet/sdk/7.0.202/Xamarin/Android/Xamarin.Android.CSharp.targets" was not found. Confirm that the expression in the Import declaration "/usr/local/share/dotnet/sdk/7.0.202/Xamarin/Android/Xamarin.Android.CSharp.targets" is correct, and that the file exists on disk.
Full stack trace:
```
Microsoft.Build.Exceptions.InvalidProjectFileException: The imported project "/usr/local/share/dotnet/sdk/7.0.202/Xamarin/Android/Xamarin.Android.CSharp.targets" was not found. Confirm that the expression in the Import declaration
"/usr/local/share/dotnet/sdk/7.0.202/Xamarin/Android/Xamarin.Android.CSharp.targets" is correct, and that the file exists on disk.
/Users/obbbrown/xxx.csproj
at Microsoft.Build.Shared.ProjectErrorUtilities.ThrowInvalidProject(String errorSubCategoryResourceName, IElementLocation elementLocation, String resourceName, Object[] args)
at Microsoft.Build.Shared.ProjectErrorUtilities.ThrowInvalidProject[T1,T2](IElementLocation elementLocation, String resourceName, T1 arg0, T2 arg1)
at Microsoft.Build.Evaluation.Evaluator`4.ExpandAndLoadImportsFromUnescapedImportExpression(String directoryOfImportingFile, ProjectImportElement importElement, String unescapedExpression, Boolean throwOnFileNotExistsError, List`1&
imports)
at Microsoft.Build.Evaluation.Evaluator`4.ExpandAndLoadImportsFromUnescapedImportExpressionConditioned(String directoryOfImportingFile, ProjectImportElement importElement, List`1& projects, SdkResult& sdkResult)
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, Project project, 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.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, IDirectoryCacheFactory directoryCacheFactory)
at Microsoft.Build.Evaluation.ProjectCollection.LoadProject(String fileName, IDictionary`2 globalProperties, String toolsVersion)
at Microsoft.UpgradeAssistant.Services.DefaultMsbuildProjectAccess..ctor(String projectPath, ILogger logger, CancellationToken cancellationToken)
at Microsoft.UpgradeAssistant.Cli.Slices.Services.Msbuild.MsbuildService.GetProjectAccessAsync(String projectPath, Boolean isReadOnly, ILogger logger, CancellationToken cancellationToken)
at Microsoft.UpgradeAssistant.Cli.Slices.Services.Project.MsbuildProjectBuilder.BuildAsync(ISolution solution, String projectPath, CancellationToken cancellationToken)
at Microsoft.UpgradeAssistant.Cli.Slices.Services.Project.ProjectService.GetProjectAsync(ISolution solution, String projectPath, CancellationToken cancellationToken)
at Microsoft.UpgradeAssistant.Cli.Slices.Services.Project.ProjectService.GetProjectByPathAsync(ISolution solution, String projectPath, ILogger logger, CancellationToken cancellationToken)
at UpgradeHost.GetTraitsAsync(String projectPath, CancellationToken cancellationToken)
at Spectre.Console.Flow.FlowContextExtensions.GetOriginalTraitsAsync(IFlowContext context, String projectPath, IUpgradeHost host, CancellationToken cancellationToken)
at Microsoft.UpgradeAssistant.Cli.Flow.Steps.Upgrade.SelectControllerFlowStep.<>c__DisplayClass8_0.<b__0>d.MoveNext()
--- End of stack trace from previous location ---
at Spectre.Console.Status.<>c__DisplayClass17_0`1.<b__0>d.MoveNext() in /_/src/Spectre.Console/Live/Status/Status.cs:line 120
--- End of stack trace from previous location ---
at Spectre.Console.Progress.<>c__DisplayClass28_0`1.<b__0>d.MoveNext() in /_/src/Spectre.Console/Live/Progress/Progress.cs:line 133
--- End of stack trace from previous location ---
at Spectre.Console.Internal.DefaultExclusivityMode.RunAsync[T](Func`1 func) in /_/src/Spectre.Console/Internal/DefaultExclusivityMode.cs:line 40
at Spectre.Console.Progress.StartAsync[T](Func`2 action) in /_/src/Spectre.Console/Live/Progress/Progress.cs:line 116
at Spectre.Console.Status.StartAsync[T](String status, Func`2 func) in /_/src/Spectre.Console/Live/Status/Status.cs:line 117
at Microsoft.UpgradeAssistant.Cli.Flow.Steps.Upgrade.SelectControllerFlowStep.ValidateUserInputAsync(IFlowContext context, CancellationToken cancellationToken)
at Spectre.Console.Flow.FlowRunner.RunAsync(CancellationToken cancellationToken)
```
The projects all contain lines like the following:
Environment
macOS Visual Studio for Mac 17.5.3 dotnet 7.0.202 CLI upgrade-assistant 0.5.30
Apologies for ignoring the template, but I don't believe I got far enough for most of it to be relevant.
I'm also not sure this is the right place to report this. This experience is based on this blog post and using the updated CLI tool.
When attempting to run on any iOS or Android project, I just get the following:
Microsoft.Build.Exceptions.InvalidProjectFileException: The imported project "/usr/local/share/dotnet/sdk/7.0.202/Xamarin/iOS/Xamarin.iOS.CSharp.targets" was not found. Confirm that the expression in the Import declaration "/usr/local/share/dotnet/sdk/7.0.202/Xamarin/iOS/Xamarin.iOS.CSharp.targets" is correct, and that the file exists on disk.
Microsoft.Build.Exceptions.InvalidProjectFileException: The imported project "/usr/local/share/dotnet/sdk/7.0.202/Xamarin/Android/Xamarin.Android.CSharp.targets" was not found. Confirm that the expression in the Import declaration "/usr/local/share/dotnet/sdk/7.0.202/Xamarin/Android/Xamarin.Android.CSharp.targets" is correct, and that the file exists on disk.
Full stack trace:
``` Microsoft.Build.Exceptions.InvalidProjectFileException: The imported project "/usr/local/share/dotnet/sdk/7.0.202/Xamarin/Android/Xamarin.Android.CSharp.targets" was not found. Confirm that the expression in the Import declaration "/usr/local/share/dotnet/sdk/7.0.202/Xamarin/Android/Xamarin.Android.CSharp.targets" is correct, and that the file exists on disk. /Users/obbbrown/xxx.csproj at Microsoft.Build.Shared.ProjectErrorUtilities.ThrowInvalidProject(String errorSubCategoryResourceName, IElementLocation elementLocation, String resourceName, Object[] args) at Microsoft.Build.Shared.ProjectErrorUtilities.ThrowInvalidProject[T1,T2](IElementLocation elementLocation, String resourceName, T1 arg0, T2 arg1) at Microsoft.Build.Evaluation.Evaluator`4.ExpandAndLoadImportsFromUnescapedImportExpression(String directoryOfImportingFile, ProjectImportElement importElement, String unescapedExpression, Boolean throwOnFileNotExistsError, List`1& imports) at Microsoft.Build.Evaluation.Evaluator`4.ExpandAndLoadImportsFromUnescapedImportExpressionConditioned(String directoryOfImportingFile, ProjectImportElement importElement, List`1& projects, SdkResult& sdkResult) 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, Project project, 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.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, IDirectoryCacheFactory directoryCacheFactory) at Microsoft.Build.Evaluation.ProjectCollection.LoadProject(String fileName, IDictionary`2 globalProperties, String toolsVersion) at Microsoft.UpgradeAssistant.Services.DefaultMsbuildProjectAccess..ctor(String projectPath, ILogger logger, CancellationToken cancellationToken) at Microsoft.UpgradeAssistant.Cli.Slices.Services.Msbuild.MsbuildService.GetProjectAccessAsync(String projectPath, Boolean isReadOnly, ILogger logger, CancellationToken cancellationToken) at Microsoft.UpgradeAssistant.Cli.Slices.Services.Project.MsbuildProjectBuilder.BuildAsync(ISolution solution, String projectPath, CancellationToken cancellationToken) at Microsoft.UpgradeAssistant.Cli.Slices.Services.Project.ProjectService.GetProjectAsync(ISolution solution, String projectPath, CancellationToken cancellationToken) at Microsoft.UpgradeAssistant.Cli.Slices.Services.Project.ProjectService.GetProjectByPathAsync(ISolution solution, String projectPath, ILogger logger, CancellationToken cancellationToken) at UpgradeHost.GetTraitsAsync(String projectPath, CancellationToken cancellationToken) at Spectre.Console.Flow.FlowContextExtensions.GetOriginalTraitsAsync(IFlowContext context, String projectPath, IUpgradeHost host, CancellationToken cancellationToken) at Microsoft.UpgradeAssistant.Cli.Flow.Steps.Upgrade.SelectControllerFlowStep.<>c__DisplayClass8_0.<The projects all contain lines like the following:
<Import Project="$(MSBuildExtensionsPath)\Xamarin\Android\Xamarin.Android.CSharp.targets" />
<Import Project="$(MSBuildExtensionsPath)\Xamarin\Android\Xamarin.Android.CSharp.targets" />