0
votes

I am trying to deploy specific changeset using the SourceVersion variable in the Azure pipeline with no luck. Every time it is anything other than latest build task fails with below error, but works perfectly fine for latest code (no value for SourceVersion):

[error]C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Microsoft\NuGet\16.0\Microsoft.NuGet.targets(186,5):

Error : Your project does not reference ".NETFramework,Version=v4.6.1" framework. Add a reference to ".NETFramework,Version=v4.6.1" in the "TargetFrameworks" property of your project file and then re-run NuGet restore.

I am not sure where to even check for the issue. Really appreciate any input.

Thanks!!

2

2 Answers

1
votes

You can try to specify /p:TargetFrameworkVersion=v4.6.1 in the MSBuild Arguments column of the MSBuild task.

enter image description here

MSBuild lets you set properties on the command line by using the -property (or -p) switch. These global property values override property values that are set in the project file. This includes environment properties, but does not include reserved properties, which cannot be changed.

For details ,please refer to this document.

0
votes

After I updated value for "Clean" under "Get Sources" to "true" and "Clean Option" to "Sources Directory", that did the trick.

enter image description here