microsoft / service-fabric

Service Fabric is a distributed systems platform for packaging, deploying, and managing stateless and stateful distributed applications and containers at large scale.
https://docs.microsoft.com/en-us/azure/service-fabric/
MIT License
3.02k stars 399 forks source link

Service Fabric project nuget packages are not getting restored in VSTS #826

Closed mraipsec-mra closed 1 year ago

mraipsec-mra commented 6 years ago

On latest Service Fabric SDK / .NET Core SDK / VS2017 community edition, we have 1 package reference Microsoft.VisualStudio.Azure.Fabric.MSBuild for service fabric project. I have checkin the solution and triggered build in VSTS it is failing to restore packages for .sfproj

2018-02-08T04:51:51.4074522Z C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\bin\msbuild.exe "D:\a_temp\NuGetScratch\azh3fxfq.a3u.nugetinputs.targets" /t:GenerateRestoreGraphFile /nologo /nr:false /v:q /p:NuGetRestoreTargets="D:\a_temp\NuGetScratch\mcjmon3n.xty.nugetrestore.targets" /p:RestoreTaskAssemblyFile="D:\a_tool\NuGet\4.5.1\x64\nuget.exe" /p:RestoreSolutionDirectory="D:\a\3\s\xyz" /p:RestoreConfigFile="D:\a\3\Nuget\tempNuGet_23.config" /p:SolutionDir="D:\a\3\s\xyz" 2018-02-08T04:51:51.4075226Z D:\a\3\s\xyz\xyz\xyz.sfproj(59,5): error : Unable to find the '..\packages\Microsoft.VisualStudio.Azure.Fabric.MSBuild.1.6.4\build\Microsoft.VisualStudio.Azure.Fabric.Application.props' file. Please restore the 'Microsoft.VisualStudio.Azure.Fabric.MSBuild' Nuget package. 2018-02-08T04:51:51.4075606Z D:\a\3\s\xyz\xyz\xyz.sfproj : warning NU1503: Skipping restore for project 'D:\a\3\s\xyz\xyz\xyz.sfproj'. The project file may be invalid or missing targets required for restore. [D:\a_temp\NuGetScratch\azh3fxfq.a3u.nugetinputs.targets] 2018-02-08T04:51:51.4075817Z 2018-02-08T04:51:51.4075948Z All packages listed in packages.config are already installed.

2018-02-08T04:52:39.3020087Z ##[error]xyz\xyz\xyz.sfproj(59,5): Error : Unable to find the '..\packages\Microsoft.VisualStudio.Azure.Fabric.MSBuild.1.6.4\build\Microsoft.VisualStudio.Azure.Fabric.Application.props' file. Please restore the 'Microsoft.VisualStudio.Azure.Fabric.MSBuild' Nuget package. 2018-02-08T04:52:39.3020738Z Project "D:\a\3\s\xyz\xyz.sln" (1) is building "D:\a\3\s\xyz\xyz\xyz.sfproj" (4) on node 1 (Clean target(s)). 2018-02-08T04:52:39.3022703Z D:\a\3\s\xyz\xyz\xyz.sfproj(59,5): error : Unable to find the '..\packages\Microsoft.VisualStudio.Azure.Fabric.MSBuild.1.6.4\build\Microsoft.VisualStudio.Azure.Fabric.Application.props' file. Please restore the 'Microsoft.VisualStudio.Azure.Fabric.MSBuild' Nuget package. 2018-02-08T04:52:39.3023682Z Done Building Project "D:\a\3\s\xyz\xyz\xyz.sfproj" (Clean target(s)) -- FAILED. 2018-02-08T04:52:39.3024211Z Done Building Project "D:\a\3\s\xyz\xyz.sln" (Clean target(s)) -- FAILED. 2018-02-08T04:52:39.3566326Z 2018-02-08T04:52:39.3567113Z Build FAILED. 2018-02-08T04:52:39.3614454Z 2018-02-08T04:52:39.3628772Z "D:\a\3\s\xyz\xyz.sln" (Clean target) (1) -> 2018-02-08T04:52:39.3628987Z "D:\a\3\s\xyz\xyz\xyz.sfproj" (Clean target) (4) -> 2018-02-08T04:52:39.3629188Z (ValidateMSBuildFiles target) -> 2018-02-08T04:52:39.3629452Z D:\a\3\s\xyz\xyz\xyz.sfproj(59,5): error : Unable to find the '..\packages\Microsoft.VisualStudio.Azure.Fabric.MSBuild.1.6.4\build\Microsoft.VisualStudio.Azure.Fabric.Application.props' file. Please restore the 'Microsoft.VisualStudio.Azure.Fabric.MSBuild' Nuget package. 2018-02-08T04:52:39.3629651Z 2018-02-08T04:52:39.3630272Z 0 Warning(s) 2018-02-08T04:52:39.3630552Z 1 Error(s) 2018-02-08T04:52:39.3633535Z 2018-02-08T04:52:39.3633896Z Time Elapsed 00:00:21.14 2018-02-08T04:52:39.7984353Z ##[error]Process 'msbuild.exe' exited with code '1'.

To expel this issue, i have checkin the packages folder manually as a work around.

dbreshears commented 6 years ago

@ravindraaditya , can you export your build definition from VSTS and attach the json.

NCarlsonMSFT commented 6 years ago

The package is available on nuget.org: https://www.nuget.org/packages/Microsoft.VisualStudio.Azure.Fabric.MSBuild/1.6.4 What does your nuget restore task in VSTS look like? Are you using NuGet.org? image

mraipsec-mra commented 6 years ago

@dbreshears here is the file xyz-CI.zip

@NCarlsonMSFT yes you are right, we have already done this before.

"phases":[{"steps":[{"environment":{},"enabled":true,"continueOnError":false,"alwaysRun":false,"displayName":"Use NuGet 4.5.1","timeoutInMinutes":0,"refName":"NuGetToolInstaller1","task":{"id":"2c65196a-54fd-4a02-9be8-xyz","versionSpec":"0.","definitionType":"task"},"inputs":{"versionSpec":"4.5.1","checkLatest":"true"}},{"environment":{},"enabled":true,"continueOnError":false,"alwaysRun":false,"displayName":"NuGet restore","timeoutInMinutes":0,"refName":"NuGetCommand2","task":{"id":"xyz-d341-40d9-afcf-xyz","versionSpec":"2.","definitionType":"task"},"inputs":{"command":"restore","solution":"$(Parameters.solution)","selectOrConfig":"select","feedRestore":"","includeNuGetOrg":"true","nugetConfigPath":"","externalEndpoints":"","noCache":"true","packagesDirectory":"","verbosityRestore":"Detailed","searchPatternPush":"$(Build.ArtifactStagingDirectory)/.nupkg","nuGetFeedType":"internal","feedPublish":"","allowPackageConflicts":"false","externalEndpoint":"","verbosityPush":"Detailed","searchPatternPack":"/.csproj"**,"configurationToPack":"$(BuildConfiguration)","outputDir":"$(Build.ArtifactStagingDirectory)","versioningScheme":"off","includeReferencedProjects":"false","versionEnvVar":"","requestedMajorVersion":"1","requestedMinorVersion":"0","requestedPatchVersion":"0","packTimezone":"utc","includeSymbols":"false","buildProperties":"","verbosityPack":"Detailed","arguments":""}}

I think what is missing was restoring of nuget packages for .sfproj

assadf commented 6 years ago

Hi,

I'm getting this exact same issue as well. When I look at the existing Nuget Restore step (for sln) I noticed this error message:

: error : Unable to find the '..\packages\Microsoft.VisualStudio.Azure.Fabric.MSBuild.1.6.4\build\Microsoft.VisualStudio.Azure.Fabric.Application.props' file. Please restore the 'Microsoft.VisualStudio.Azure.Fabric.MSBuild' Nuget package.

 : warning NU1503: Skipping restore for project 'D:\a\1\s\MyFolder\MySFProj.sfproj'. The project file may be invalid or missing targets required for restore. [D:\a\_temp\NuGetScratch\54wapxvf.z4w.nugetinputs.targets]

I thought maybe just adding a Nuget restore step for .sfproj would resolve it (I don't know if this is valid for an sfproj) but then get the following error:

2018-02-22T19:46:27.4707517Z ##[error]The nuget command failed with exit code(1) and error(Cannot determine the packages folder to restore NuGet packages. Please specify either -PackagesDirectory or -SolutionDirectory.)
2018-02-22T19:46:27.4708192Z ##[error]Packages failed to restore

Would appreciate a resolution for this.

Assad

SamHard commented 6 years ago

Make sure you delete the "ServiceFabricBackup" folder, which is created automatically when Visual Studio updates the .sfproj file. The contents of that folder were causing issues with MSBuild for my team.

assadf commented 6 years ago

@SamHard, I deleted the ServiceFabricBackup folders from my local file system (I had 4 of them), made a fake change in the solution and committed to kick off a new build and to my amazement, it worked. it makes no sense as to why it worked as the ServiceFabricBackup folders were on my local machine and they were not committed or at least I couldn't see them in the GIT repository in VSTS. Many thanks @SamHard.

Assad

kishorebarik26 commented 6 years ago

: error : Unable to find the '..\packages\Microsoft.VisualStudio.Azure.Fabric.MSBuild.1.6.4\build\Microsoft.VisualStudio.Azure.Fabric.Application.props' file. Please restore the 'Microsoft.VisualStudio.Azure.Fabric.MSBuild' Nuget package.

I found this issue after upgrading the nuget package of Microsoft.VisualStudio.Azure.Fabric.MSBuild from 1.6.4 to 1.6.5. So I edited the sfproj (SF project file) and replaced all Microsoft.VisualStudio.Azure.Fabric.MSBuild.1.6.4 to Microsoft.VisualStudio.Azure.Fabric.MSBuild.1.6.5 and these error messages gone for all.

dbreshears commented 6 years ago

@kishorebarik26 , thanks for letting us know, we will look into what is going on when updating the package in VS and why it is not updating the .sfproj automatically, for now it seems manually editing the .sfproj file and updating all occurrences from 1.6.4 to 1.6.5 would be the workaround.

dbreshears commented 6 years ago

@kishorebarik26, looked into this and the real workaround is to unload the project/solution and reload after updating the Microsoft.VisualStudio.Azure.Fabric.MSbuild Nuget package. There is an issue in Nuget that we working around https://github.com/NuGet/Home/issues/1850 and we have logic in place to detect and fixup the .sfproj but during project load.

alexwilsh commented 6 years ago

Hi,

I tried all workarounds mentioned here and in other threads but the issue is still there. I already tried 1.6.2, 1.6.3, 1.6.4 and 1.6.5. I can successfully build my sfproj locally and deploy it to Azure. But running dotnet build on VSTS for my solution brings the issue with Microsoft.VisualStudio.Azure.Fabric.Application.props file in every case.

What am I missing? I would appreciate any ideas and suggestions.

dbreshears commented 6 years ago

@alexwilsh, Any reason why you are using dotnet build? Building the solution with .sfproj will require using MSBuild in the VSTS build definition. Also, you should make sure to use "Use Nuget 4.3.0" and "NuGet restore" tasks prior to the Build solution task

alexwilsh commented 6 years ago

@dbreshears, That is interesting question :) I used dotnet build in my local scripts before we decided to go with VSTS. I have .NET Core projects and that was like the option by default. The most interesting thing - it worked locally and that was something that confused me when we switched to VSTS. But after your question I switched to Visual Studio Task. I also added NuGet tasks before VS Task as you suggested. The build is successful now. Thanks a lot for the tip.

francescocristallo commented 6 years ago

This just happened to me updating to the new 3.0.472. I had to uninstall all the packages and reinstall them.

These are all the updates.

capture

The order for the update is important.

1) Microsoft.Service Fabric updates correctly. 2) Microsoft.ServiceFabric.Data updates correctly

Trying to install the others give this error

wewewe

Rebooting Visual studio, uninstalling them all and reinstalling in the end works. Please fix this

bklooste commented 5 years ago

Same issue in Team City its the way, SF requires MSBuild.

delradie commented 5 years ago

Just to add our issue to this, as I think it's related.

We have a large solution based on the full framework (currently 4.6.1, but in progress of updating to 4.7.2), that we've recently added a service fabric project to.

Our automated build runs on custom build servers based on Cake and in the clean section of the script it is blowing up on the sfproj as it is hitting the ValidateMSBuildFiles. This checks for the existence of

\Microsoft.VisualStudio.Azure.Fabric.MSBuild.1.6.7\build\Microsoft.VisualStudio.Azure.Fabric.Application.props and \Microsoft.VisualStudio.Azure.Fabric.MSBuild.1.6.7\build\Microsoft.VisualStudio.Azure.Fabric.Application.targets Obviously these file don't exist at this point as the nugets haven't been restored. The 2 workarounds I can think of are to switch the clean and restore sections of the build script around (I'm guessing there could be unintended consequences to this), or commit the package into our git repo (which seems like a really dumb hack) I'm guessing the underlying issue is that it shouldn't be hitting the ValidateMSBuildFiles target at this stage (otherwise we'd hit this sort of problem a LOT more often). Any thoughts would be much appreciated. Thanks @delradie
Falconne commented 5 years ago

To workaround this and ensure clean builds work in in CI environments, I run nuget restore twice for any solution containing .sfproj files.

You must use nuget.exe (not msbuild /t:restore as the ValidateMSBuildFiles target causing it to abort right away). nuget.exe will complain and say it's not going to restore any PackageRefeference packages, but it will restore packages in package.config files (which .sfproj files use) and will get you Microsoft.VisualStudio.Azure.Fabric.MSBuild downloaded.

The second nuget restore will now work properly and restore any PackageRefeference packages.

fiatkongen commented 5 years ago

I get the same in VSTS: Error : Unable to find the '..\packages\Microsoft.VisualStudio.Azure.Fabric.MSBuild.1.6.3\build\Microsoft.VisualStudio.Azure.Fabric.Application.props' file. Please restore the 'Microsoft.VisualStudio.Azure.Fabric.MSBuild' Nuget package

If I check my sfproj file, 1.6.7 is referenced. I have no clue as to why the sfproj file in ServiceFabricBackup contains a reference to 1.6.3. I have tried to manually correct the sfproj file in ServiceFabricBackup, but it is overwritted when a new build is started. Has anyone found a solution to this?

jreancsu commented 5 years ago

Our situation was this: We were changing .NET Framework Service Fabric service projects over to netcoreapp2.2 and forcing all target platforms to x64 only. Once we added the AnyCPU configuration back, the package successfully gets restored.

jreancsu commented 5 years ago

You can also get it to build with x64 only by doing these build steps:

  1. dotnet restore the .sln file
  2. "visual studio build" step the .csproj with the "restore nuget packages" option checked and build target MS x64.
  3. dotnet test
  4. nuget pack
  5. nuget push
websitewill commented 5 years ago

I was directed here from the Visual Studio Developer Community. Seems like I am having the exact same issue. Using the standard build template that comes with Azure Devops. Using a specific NuGet restore (v4.4.1). My SF project is referencing MSBuild package v1.6.7

I can see in the log from Nuget Restore that the package is being pulled. "Completed installation of Microsoft.VisualStudio.Azure.Fabric.MSBuild 1.6.7 Adding package 'Microsoft.VisualStudio.Azure.Fabric.MSBuild.1.6.7' to folder 'D:\a\1\Nuget\External\Packages'"

But the Visual Studio Build task to package the sfproj is failing with this error. "Error : Unable to find the '.......nuget\External\Packages\Microsoft.VisualStudio.Azure.Fabric.MSBuild.1.6.7\build\Microsoft.VisualStudio.Azure.Fabric.Application.props' file. Please restore the 'Microsoft.VisualStudio.Azure.Fabric.MSBuild' Nuget package."

All builds locally just fine, issue is only in Azure DevOps. I've verified that all ServiceFabricBackup folders have been deleted. Building x64 as required.

I have tried adding a NugetRestore for the solution and a separate one pointing to the package.config inside the sfproj, did not make any difference.

Thanks for any help, Will

websitewill commented 5 years ago

Just for grins, I created a basic SF project - straight out of the box, no changes of any kind. Verified that it builds/packages/deploys locally. Committed it to Azure Devops. Created a new build definition using the Azure Service Fabric application template, made no changes. Same error. Definitely not something I've misconfigured.

ththiem commented 5 years ago

Running into this issue again, just trying to upgrade the nuget packages in my SF projects to the latest version caused the Fabric MSBuild target to update from 1.6.7 to 1.6.9 everywhere and in the packages.json file but the .sfproj itself still had 1.6.7 references all over it, and manually changing to 1.6.9 fixed it.

There needs to be a better way than running into this error, googling this thread, and then manually fixing it, every time.

lineker commented 5 years ago

To workaround this and ensure clean builds work in in CI environments, I run nuget restore twice for any solution containing .sfproj files.

You must use nuget.exe (not msbuild /t:restore as the ValidateMSBuildFiles target causing it to abort right away). nuget.exe will complain and say it's not going to restore any PackageRefeference packages, but it will restore packages in package.config files (which .sfproj files use) and will get you Microsoft.VisualStudio.Azure.Fabric.MSBuild downloaded.

The second nuget restore will now work properly and restore any PackageRefeference packages.

Calling nuget restore twice worked for me. I'm using Jenkins FYI.

specialforest commented 5 years ago

You must use nuget.exe (not msbuild /t:restore

If you see an error: "The OutputPath property is not set for project '***.sfproj'" this is why.

cjfarrelly commented 4 years ago

On the SF proj file it usually says 'InitialTargets=";ValidateMSBuildFiles">' delete this along with the target at the bottom of the file for completeness for me it looked like the code below.

Calling nuget twice isn't a fix, its a hack.

`

<Error Condition="!Exists('..\packages\Microsoft.VisualStudio.Azure.Fabric.MSBuild.1.6.7\build\Microsoft.VisualStudio.Azure.Fabric.Application.targets')" Text="Unable to find the '..\packages\Microsoft.VisualStudio.Azure.Fabric.MSBuild.1.6.7\build\Microsoft.VisualStudio.Azure.Fabric.Application.targets' file. Please restore the 'Microsoft.VisualStudio.Azure.Fabric.MSBuild' Nuget package." />

`

Doomblaster commented 4 years ago

The reason I got this error was because the sfproj project by default has both Build and Deploy set in Configuration Manager for the solution. Removing Build makes it possible to use "dotnet restore/build" on solution file. image

As far as I know the Build shouldn't really be there and it doesn't have to either. Later on in the pipeline, after successful restore/build with dotnet, I do a nuget restore on the sfproj file and a VSBuild with target Package on sfproj file. There isn't really anything to build in the sfproj.

Finglas commented 4 years ago

cjfarrelly that worked a treat. Nice one.

The double restore thing did indeed work but I agree - that is no solution. I'm not sure if we lose anything by not doing this, but I've a green build now so will test further.

This whole thread/issue is a disgrace. Does anyone actually use/test Service Fabric? I'm sick of dealing with these problems such as the sfproj format, and the issue where updating the packages.config doesn't update the sfproj either.

johnm123 commented 4 years ago

It seems like Microsoft have informally dumped it.

mrohera commented 4 years ago

To the repo owner(s), is the proposal from @cjfarrelly above: https://github.com/Azure/service-fabric-issues/issues/840#issuecomment-572615400 the solution to this problem?

We were running into issues when using nuget 5.5.1 and the newer msbuild 16.5.x. Using the proposed changes seems to have fixed our issues. If not are there any steps we can take?

It seems like this was one some boilerplate configuration that was used across the board which is now incompatible with the latest toolset.

NCarlsonMSFT commented 4 years ago

@mrohera Removing the "ValidateMSBuildFiles" from InitialTargets is recommended (we have changed out templates to no longer add this). Removing the target altogether is not necessary, but also not harmful (you just won't get as helpful a message in the case of the NuGet not being restored).

mrohera commented 4 years ago

@NCarlsonMSFT, thanks for getting back to me :). Are you saying that we keep the ValidateMSBuildFiles checks as is just not triggered via InitialTargets? If yes, where should we keep the checks to make sure our stuff is restored and built correctly? The idea here is to not have silent build failures and catch anything early on.

If it helps this is what we have now:


<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory),Microsoft.ServiceFabric.props))\Microsoft.ServiceFabric.props" />
...
...
<Target Name="ValidateMSBuildFiles">
    <Error Condition="!Exists('$(NUGET_PACKAGES)\Microsoft.VisualStudio.Azure.Fabric.MSBuild\$(ServiceFabricMSBuildVersion)\build\Microsoft.VisualStudio.Azure.Fabric.Application.props')" Text="Unable to find the '$(NUGET_PACKAGES)\Microsoft.VisualStudio.Azure.Fabric.MSBuild\$(ServiceFabricMSBuildVersion)\build\Microsoft.VisualStudio.Azure.Fabric.Application.props' file. Please restore the 'Microsoft.VisualStudio.Azure.Fabric.MSBuild' Nuget package." />
    <Error Condition="!Exists('$(NUGET_PACKAGES)\Microsoft.VisualStudio.Azure.Fabric.MSBuild\$(ServiceFabricMSBuildVersion)\build\Microsoft.VisualStudio.Azure.Fabric.Application.targets')" Text="Unable to find the '$(NUGET_PACKAGES)\Microsoft.VisualStudio.Azure.Fabric.MSBuild\$(ServiceFabricMSBuildVersion)\build\Microsoft.VisualStudio.Azure.Fabric.Application.targets' file. Please restore the 'Microsoft.VisualStudio.Azure.Fabric.MSBuild' Nuget package." />
  </Target>
NCarlsonMSFT commented 4 years ago

The target should have a BeforeTargets attribute:

<Target Name="ValidateMSBuildFiles" BeforeTargets="PrepareForBuild">
brianvanderlugt commented 3 years ago

In spite of what this thread indicates, there are conditions in which InitialTargets=";ValidateMSBuildFiles" seems to be required. Or I just haven't been able to put the right solution together.

While building locally worked fine, my ADO build kept failing. I've got a solution of projects that has a mix of PackageReference and my sfproj's that have packages.config. I tried the various fixes, save for deleting the whole validation logic altogether, and they all failed for one reason or another. For some reason, including the InitialTargets condition causes my first nuget restore to do a packages.config restore and restore to both the global nuget cache and the solution level nuget cache the build tasks depend on via relative reference. Not sure why and giving up trying to figure out a better solution.

Leaving this here in case it saves someone else the headache of not trying because "it shouldn't be required".

MartinDemberger commented 3 years ago

I had the same problem with the restored package after I updated from 1.7.2 to 1.7.3.

In run on the devops pipeline with

  <Import Project="..\packages\Microsoft.VisualStudio.Azure.Fabric.MSBuild.1.7.3\build\Microsoft.VisualStudio.Azure.Fabric.Application.props" Condition="Exists('..\packages\Microsoft.VisualStudio.Azure.Fabric.MSBuild.1.7.3\build\Microsoft.VisualStudio.Azure.Fabric.Application.props')" />

but localy the package wasn't found. So I implemented the following workaround

  <PropertyGroup>
    <!-- This version number must be the same as in packages.config -->
    <ServiceFabricPackageVersion>1.7.3</ServiceFabricPackageVersion>
    <ServiceFabricPackageRootFolder>..\packages</ServiceFabricPackageRootFolder>
    <ServiceFabricPackageRootFolder Condition="!Exists('$(ServiceFabricPackageRootFolder)')">$(APPDATA)\BuildConfig\packages</ServiceFabricPackageRootFolder>
    <!-- Nothing found: back to start. -->
    <ServiceFabricPackageRootFolder Condition="!Exists('$(ServiceFabricPackageRootFolder)')">..\packages</ServiceFabricPackageRootFolder>
  </PropertyGroup>
  <Import Project="$(ServiceFabricPackageRootFolder)\Microsoft.VisualStudio.Azure.Fabric.MSBuild.$(ServiceFabricPackageVersion)\build\Microsoft.VisualStudio.Azure.Fabric.Application.props" Condition="Exists('$(ServiceFabricPackageRootFolder)\Microsoft.VisualStudio.Azure.Fabric.MSBuild.1.7.3\build\Microsoft.VisualStudio.Azure.Fabric.Application.props')" />

And at the end of the sfproj file I changed to:

  <Import Project="$(ServiceFabricPackageRootFolder)\Microsoft.VisualStudio.Azure.Fabric.MSBuild.$(ServiceFabricPackageVersion)\build\Microsoft.VisualStudio.Azure.Fabric.Application.targets" Condition="Exists('$(ServiceFabricPackageRootFolder)\Microsoft.VisualStudio.Azure.Fabric.MSBuild.$(ServiceFabricPackageVersion)\build\Microsoft.VisualStudio.Azure.Fabric.Application.targets')" />
  <Target Name="ValidateMSBuildFiles" BeforeTargets="PrepareForBuild">
    <Error Condition="!Exists('$(ServiceFabricPackageRootFolder)\Microsoft.VisualStudio.Azure.Fabric.MSBuild.$(ServiceFabricPackageVersion)\build\Microsoft.VisualStudio.Azure.Fabric.Application.props')" Text="Unable to find the '$(ServiceFabricPackageRootFolder)\Microsoft.VisualStudio.Azure.Fabric.MSBuild.$(ServiceFabricPackageVersion)\build\Microsoft.VisualStudio.Azure.Fabric.Application.props' file. Please restore the 'Microsoft.VisualStudio.Azure.Fabric.MSBuild' Nuget package." />
    <Error Condition="!Exists('$(ServiceFabricPackageRootFolder)\Microsoft.VisualStudio.Azure.Fabric.MSBuild.$(ServiceFabricPackageVersion)\build\Microsoft.VisualStudio.Azure.Fabric.Application.targets')" Text="Unable to find the '$(ServiceFabricPackageRootFolder)\Microsoft.VisualStudio.Azure.Fabric.MSBuild.$(ServiceFabricPackageVersion)\build\Microsoft.VisualStudio.Azure.Fabric.Application.targets' file. Please restore the 'Microsoft.VisualStudio.Azure.Fabric.MSBuild' Nuget package." />
  </Target>

Now it's running local and in the pipeline.

thales-man commented 3 years ago

the whole thing is not fit for purpose and hasn't been for years. the whole toolchain is questionable, nuget has over 2k issues logged against it. most of the devs have moved elsewhere. they seem to work on the principal, let's buy a phone company, ah, no we're bored now, let's dump it. let's build a voice system and embed in some speakers that seems like a good idea... ah, no we're bored now, let's give 20 bucks and f*** 'em off. let's build a dual screen android phone (but not call it a phone), because we've never failed at that before... you know we're not much cop at android... i wonder....

mraipsec-mra commented 1 year ago

Inderministic targets and should be available over built-in support for Dotnet build tool extension.

woeterman94 commented 6 months ago

I followed MartinDemberger's steps. And in my yaml I needed to add:

      - task: NuGetCommand@2
        displayName: 'NuGet restore'
        inputs:
          solution: $(SlnPath)
          restoreDirectory: '$(System.DefaultWorkingDirectory)/packages/'

restoreDirectory refering the the packages folder