Open tmat opened 6 years ago
NuGet Package Manager reports the following error when uninstalling the package via VS UI:
Microsoft.Build.Exceptions.InvalidProjectFileException: The result "" of evaluating the value "$(_MicrosoftSourceLinkCommonAssemblyFile)" of the "AssemblyFile" attribute in element <UsingTask> is not valid. C:\Temp\Cpp2\ConsoleApplication1\packages\Microsoft.SourceLink.Common.1.0.0-beta-62925-02\build\InitializeSourceControlInformation.targets
at Microsoft.Build.Shared.ProjectErrorUtilities.ThrowInvalidProject(String errorSubCategoryResourceName, IElementLocation elementLocation, String resourceName, Object[] args)
at Microsoft.Build.Shared.ProjectErrorUtilities.VerifyThrowInvalidProject[T1,T2,T3,T4](Boolean condition, String errorSubCategoryResourceName, IElementLocation elementLocation, String resourceName, T1 arg0, T2 arg1, T3 arg2, T4 arg3)
at Microsoft.Build.Execution.TaskRegistry.RegisterTasksFromUsingTaskElement[P,I](ILoggingService loggingService, BuildEventContext buildEventContext, String directoryOfImportingFile, ProjectUsingTaskElement projectUsingTaskXml, TaskRegistry taskRegistry, Expander`2 expander, ExpanderOptions expanderOptions, IFileSystem fileSystem)
at Microsoft.Build.Evaluation.Evaluator`4.EvaluateUsingTaskElement(String directoryOfImportingFile, ProjectUsingTaskElement projectUsingTaskElement)
at Microsoft.Build.Evaluation.Evaluator`4.Evaluate(ILoggingService loggingService, BuildEventContext buildEventContext)
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, ProjectRootElementCache projectRootElementCache, BuildEventContext buildEventContext, ISdkResolverService sdkResolverService, Int32 submissionId, EvaluationContext evaluationContext)
at Microsoft.Build.Evaluation.Project.Reevaluate(ILoggingService loggingServiceForEvaluation, ProjectLoadSettings loadSettings, EvaluationContext evaluationContext)
at Microsoft.Build.Evaluation.Project.ReevaluateIfNecessary(ILoggingService loggingServiceForEvaluation, ProjectLoadSettings loadSettings, EvaluationContext evaluationContext)
at NuGet.PackageManagement.VisualStudio.MicrosoftBuildEvaluationProjectUtility.RemoveImportStatement(Project msBuildProject, String targetsPath)
at NuGet.PackageManagement.VisualStudio.CpsProjectSystem.<>c__DisplayClass5_0.<RemoveImportStatementAsync>b__0(Project buildProject)
at NuGet.VisualStudio.ProjectHelper.<DoWorkInWriterLockAsync>d__0.MoveNext()
at NuGet.VisualStudio.ProjectHelper.<DoWorkInWriterLockAsync>d__0.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at NuGet.PackageManagement.VisualStudio.CpsProjectSystem.<RemoveImportStatementAsync>d__5.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at NuGet.PackageManagement.VisualStudio.CpsProjectSystem.<>c__DisplayClass4_0.<<RemoveImport>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.VisualStudio.Threading.JoinableTask.CompleteOnCurrentThread()
at NuGet.PackageManagement.VisualStudio.CpsProjectSystem.RemoveImport(String targetFullPath)
at NuGet.ProjectManagement.MSBuildNuGetProject.<UninstallPackageAsync>d__37.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at NuGet.PackageManagement.NuGetPackageManager.<ExecuteUninstallAsync>d__86.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
at NuGet.PackageManagement.NuGetPackageManager.<ExecuteNuGetProjectActionsAsync>d__76.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at NuGet.PackageManagement.NuGetPackageManager.<ExecuteNuGetProjectActionsAsync>d__76.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at NuGet.PackageManagement.NuGetPackageManager.<ExecuteNuGetProjectActionsAsync>d__76.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at NuGet.PackageManagement.NuGetPackageManager.<ExecuteNuGetProjectActionsAsync>d__75.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
at NuGet.PackageManagement.NuGetPackageManager.<ExecuteNuGetProjectActionsAsync>d__74.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at NuGet.PackageManagement.UI.UIActionEngine.<ExecuteActionsAsync>d__16.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
at NuGet.PackageManagement.UI.UIActionEngine.<>c__DisplayClass12_0.<<PerformActionImplAsync>b__0>d.MoveNext()
Is there an update on this issue. I'm seeing it with C++ projects and get the identical failure with regards to the top-level message "the result of evaluating...".
Worse still, the failure is a destructive operation because the roll-back does not put back the original .props
import.
The top of my project, before the attempted nuget update
operation was this:
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\packages\MindWorks.Nimbus.BuildTools.5.0.0\build\MindWorks.Nimbus.BuildTools.props" Condition="Exists('..\packages\MindWorks.Nimbus.BuildTools.5.0.0\build\MindWorks.Nimbus.BuildTools.props')" />
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
After the update attempt, failure, and rollback, the Import
is missing. The project file looks like this:
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
+1 for requesting an update on this issue.
Is there an update on this issue? I still have this problem with the recent version of SourceLink (1.0.0) and Visual Studio 2019.
Any update? Also experiencing this issue with Microsoft Visual Studio Professional 2019 Version 16.6.5, NuGet Package Manager 5.6.0 and Microsoft.Build.Tasks.Git v1.0.0-beta2-19554-01
I am seeing this when I attempt to migrate my .NET Framework (4.8) package to use PackageReference instead of packages.config.
When I try to migrate, here is the output:
Removed package 'Dapper.2.0.35' from 'packages.config'
Successfully uninstalled 'Dapper.2.0.35' from Integrations
Removed package 'DocumentFormat.OpenXml.2.11.3 : System.IO.Packaging [4.7.0, )' from 'packages.config'
Successfully uninstalled 'DocumentFormat.OpenXml.2.11.3 : System.IO.Packaging [4.7.0, )' from Integrations
Removed package 'FluentAssertions.5.10.3' from 'packages.config'
Successfully uninstalled 'FluentAssertions.5.10.3' from Integrations
Removed package 'Microsoft.Build.Tasks.Git.1.0.0' from 'packages.config'
Install failed. Rolling back...
Package 'Microsoft.Build.Tasks.Git.1.0.0' already exists in folder 'C:\Users\roger.cook\source\repos\NICServices\nws-testautomation-webuitests\NWS.TestAutomation.WebUITests\packages'
Added package 'Microsoft.Build.Tasks.Git.1.0.0' to 'packages.config'
Package 'FluentAssertions.5.10.3' already exists in folder 'C:\Users\roger.cook\source\repos\NICServices\nws-testautomation-webuitests\NWS.TestAutomation.WebUITests\packages'
Added package 'FluentAssertions.5.10.3' to 'packages.config'
Package 'DocumentFormat.OpenXml.2.11.3 : System.IO.Packaging [4.7.0, )' already exists in folder 'C:\Users\roger.cook\source\repos\NICServices\nws-testautomation-webuitests\NWS.TestAutomation.WebUITests\packages'
Added package 'DocumentFormat.OpenXml.2.11.3 : System.IO.Packaging [4.7.0, )' to 'packages.config'
Package 'Dapper.2.0.35' already exists in folder 'C:\Users\roger.cook\source\repos\NICServices\nws-testautomation-webuitests\NWS.TestAutomation.WebUITests\packages'
Added package 'Dapper.2.0.35' to 'packages.config'
Executing nuget actions took 1.04 sec
Microsoft.Build.Exceptions.InvalidProjectFileException: The result "" of evaluating the value "$(MicrosoftBuildTasksGitAssemblyFile)" of the "AssemblyFile" attribute in element <UsingTask> is not valid. C:\Users\roger.cook\source\repos\NICServices\nws-testautomation-webuitests\NWS.TestAutomation.WebUITests\packages\Microsoft.Build.Tasks.Git.1.0.0\build\Microsoft.Build.Tasks.Git.targets
at Microsoft.Build.Shared.ProjectErrorUtilities.ThrowInvalidProject(String errorSubCategoryResourceName, IElementLocation elementLocation, String resourceName, Object[] args)
at Microsoft.Build.Shared.ProjectErrorUtilities.VerifyThrowInvalidProject[T1,T2,T3,T4](Boolean condition, String errorSubCategoryResourceName, IElementLocation elementLocation, String resourceName, T1 arg0, T2 arg1, T3 arg2, T4 arg3)
at Microsoft.Build.Execution.TaskRegistry.RegisterTasksFromUsingTaskElement[P,I](ILoggingService loggingService, BuildEventContext buildEventContext, String directoryOfImportingFile, ProjectUsingTaskElement projectUsingTaskXml, TaskRegistry taskRegistry, Expander`2 expander, ExpanderOptions expanderOptions, IFileSystem fileSystem)
at Microsoft.Build.Evaluation.Evaluator`4.EvaluateUsingTaskElement(String directoryOfImportingFile, ProjectUsingTaskElement projectUsingTaskElement)
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(EvaluationContext evaluationContext)
at NuGet.PackageManagement.VisualStudio.MicrosoftBuildEvaluationProjectUtility.RemoveImportStatement(Project msBuildProject, String targetsPath)
at NuGet.PackageManagement.VisualStudio.VsMSBuildProjectSystem.RemoveImportStatement(String targetsPath)
at NuGet.PackageManagement.VisualStudio.VsMSBuildProjectSystem.<>c__DisplayClass43_0.<<RemoveImport>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.VisualStudio.Threading.JoinableTask.CompleteOnCurrentThread()
at NuGet.PackageManagement.VisualStudio.VsMSBuildProjectSystem.RemoveImport(String targetFullPath)
at NuGet.ProjectManagement.MSBuildNuGetProject.<UninstallPackageAsync>d__37.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at NuGet.PackageManagement.NuGetPackageManager.<ExecuteUninstallAsync>d__86.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
at NuGet.PackageManagement.NuGetPackageManager.<ExecuteNuGetProjectActionsAsync>d__76.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at NuGet.PackageManagement.NuGetPackageManager.<ExecuteNuGetProjectActionsAsync>d__76.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at NuGet.PackageManagement.NuGetPackageManager.<ExecuteNuGetProjectActionsAsync>d__76.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at NuGet.PackageManagement.NuGetPackageManager.<ExecuteNuGetProjectActionsAsync>d__75.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
at NuGet.PackageManagement.UI.PackagesConfigToPackageReferenceMigrator.<DoUpgradeAsync>d__0.MoveNext()
NuGet upgrade failed to uninstall packages from packages.config so rolled back to previous state.
Visual Studio Info:
Microsoft Visual Studio Community 2019
Version 16.7.7
VisualStudio.16.Release/16.7.7+30621.155
Microsoft .NET Framework
Version 4.8.04084
Installed Version: Community
.NET Portability Analyzer 1.1.10808.0
Evaluates portability of assemblies across .NET platforms.
ADL Tools Service Provider 1.0
This package contains services used by Data Lake tools
ASA Service Provider 1.0
ASP.NET and Web Tools 2019 16.7.532.28833
ASP.NET and Web Tools 2019
ASP.NET Core Razor Language Services 16.1.0.2035807+72d099b977d3a85e65fa3b0614ca8cfc803fef02
Provides languages services for ASP.NET Core Razor.
ASP.NET Web Frameworks and Tools 2019 16.7.532.28833
For additional information, visit https://www.asp.net/
Azure App Service Tools v3.0.0 16.7.532.28833
Azure App Service Tools v3.0.0
Azure Data Lake Node 1.0
This package contains the Data Lake integration nodes for Server Explorer.
Azure Data Lake Tools for Visual Studio 2.6.2000.0
Microsoft Azure Data Lake Tools for Visual Studio
Azure Functions and Web Jobs Tools 16.7.532.28833
Azure Functions and Web Jobs Tools
Azure Stream Analytics Tools for Visual Studio 2.6.2000.0
Microsoft Azure Stream Analytics Tools for Visual Studio
C# Tools 3.7.0-6.20514.1+600c0dadd199296df3ed07dfabdc014563a77f7c
C# components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.
Common Azure Tools 1.10
Provides common services for use by Azure Mobile Services and Microsoft Azure Tools.
Extensibility Message Bus 1.2.6 (master@34d6af2)
Provides common messaging-based MEF services for loosely coupled Visual Studio extension components communication and integration.
Fabric.DiagnosticEvents 1.0
Fabric Diagnostic Events
GitHub.VisualStudio 2.11.106.19330
A Visual Studio Extension that brings the GitHub Flow into Visual Studio.
IntelliCode Extension 1.0
IntelliCode Visual Studio Extension Detailed Info
Microsoft Azure HDInsight Azure Node 2.6.2000.0
HDInsight Node under Azure Node
Microsoft Azure Hive Query Language Service 2.6.2000.0
Language service for Hive query
Microsoft Azure Service Fabric Tools for Visual Studio 16.0
Microsoft Azure Service Fabric Tools for Visual Studio
Microsoft Azure Stream Analytics Language Service 2.6.2000.0
Language service for Azure Stream Analytics
Microsoft Azure Stream Analytics Node 1.0
Azure Stream Analytics Node under Azure Node
Microsoft Azure Tools 2.9
Microsoft Azure Tools for Microsoft Visual Studio 2019 - v2.9.30701.1
Microsoft Continuous Delivery Tools for Visual Studio 0.4
Simplifying the configuration of Azure DevOps pipelines from within the Visual Studio IDE.
Microsoft JVM Debugger 1.0
Provides support for connecting the Visual Studio debugger to JDWP compatible Java Virtual Machines
Microsoft Library Manager 2.1.79+ge3567815aa.RR
Install client-side libraries easily to any web project
Microsoft MI-Based Debugger 1.0
Provides support for connecting Visual Studio to MI compatible debuggers
Microsoft Visual Studio Tools for Containers 1.1
Develop, run, validate your ASP.NET Core applications in the target environment. F5 your application directly into a container with debugging, or CTRL + F5 to edit & refresh your app without having to rebuild the container.
Mono Debugging for Visual Studio 16.7.5 (112c7bc)
Support for debugging Mono processes with Visual Studio.
NuGet Package Manager 5.7.0
NuGet Package Manager in Visual Studio. For more information about NuGet, visit https://docs.nuget.org/
ProjectServicesPackage Extension 1.0
ProjectServicesPackage Visual Studio Extension Detailed Info
SQL Server Data Tools 16.0.62008.03130
Microsoft SQL Server Data Tools
ToolWindowHostedEditor 1.0
Hosting json editor into a tool window
TypeScript Tools 16.0.20702.2001
TypeScript Tools for Microsoft Visual Studio
Visual Basic Tools 3.7.0-6.20514.1+600c0dadd199296df3ed07dfabdc014563a77f7c
Visual Basic components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.
Visual F# Tools 10.10.0.0 for F# 4.7 16.7.0-beta.20361.3+3ef6f0b514198c0bfa6c2c09fefe41a740b024d5
Microsoft Visual F# Tools 10.10.0.0 for F# 4.7
Visual Studio Code Debug Adapter Host Package 1.0
Interop layer for hosting Visual Studio Code debug adapters in Visual Studio
Visual Studio Container Tools Extensions (Preview) 1.0
View, manage, and diagnose containers within Visual Studio.
Visual Studio Tools for Containers 1.0
Visual Studio Tools for Containers
Visual Studio Tools for Kubernetes 1.0
Visual Studio Tools for Kubernetes
VisualStudio.DeviceLog 1.0
Information about my package
VisualStudio.Foo 1.0
Information about my package
VisualStudio.Mac 1.0
Mac Extension for Visual Studio
Xamarin 16.7.000.463 (d16-7@5209782)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.
Xamarin Designer 16.7.0.495 (remotes/origin/d16-7@79c0c522c)
Visual Studio extension to enable Xamarin Designer tools in Visual Studio.
Xamarin Templates 16.7.85 (1bcbbdf)
Templates for building iOS, Android, and Windows apps with Xamarin and Xamarin.Forms.
Xamarin.Android SDK 11.0.2.0 (d16-7/025fde9)
Xamarin.Android Reference Assemblies and MSBuild support.
Mono: 83105ba
Java.Interop: xamarin/java.interop/d16-7@1f3388a
ProGuard: Guardsquare/proguard/proguard6.2.2@ebe9000
SQLite: xamarin/sqlite/3.32.1@1a3276b
Xamarin.Android Tools: xamarin/xamarin-android-tools/d16-7@017078f
Xamarin.iOS and Xamarin.Mac SDK 14.2.0.12 (e0ce49680)
Xamarin.iOS and Xamarin.Mac Reference Assemblies and MSBuild support.
Are there any updates? Does anyone have any suggestions on what I can do to get my solution migrated?
No comment? No workaround? No fix in 5 years?
How can a project run by Microsoft be so broken? If we had a bug like this in our system, it would be fixed within a week tops. If there were so many endemic problems, then we would have migrated the whole thing to a new platform but the standard MS response usually consists of "just update to dotnet core" as-if we aren't already doing that where possible. Lots of us have multiple Webforms projects, you can't just change them to dotnet core.
Copy from https://github.com/dotnet/sourcelink/issues/141
To repo: Visual Studio 2017, start a new .NET Framework Library project targeting .NET 4.5 or 4.0. Install Microsoft.SourceLink.Github from Package Manager Console. Build, get error
which is fine, we don't have github set up for this project yet.
But then if you call Update-Package -reinstall or Uninstall-Package, it would give errors like this:
Manually removing packages from NuGet Package Manager UI, could remove the other two but Microsoft.Build.Tasks.Git refuses to go.