A previous question was answered here for retrieving pipeline configuration (yaml) from Bluemix.
https://console.bluemix.net/devops/pipelines/<pipeline id>/yaml
How do I get the equivalent for the toolchain and deploy configurations?
Related
We are migrating our application from .NET 4.6.1 to .NET 6.0.
after deploying the migrated application, it is failing to find framework dlls. After logging into cluster VM looks like .NET 6.0 is not installed on machines. Do we have to have to separately install .NET 6 on cluster?
existing cluster is configured for auto fabric upgrade and current fabric version is 9.0.1028.9590
Thanks
You definitely don't need to install .NET frameworks on Service Fabric - this should be bundled as part of your Service Fabric application packages. We recently went through the exact process of upgrading our applications and I can also confirm that our cluster does not have any recent .NET frameworks installed.
How do you create your deployment packages? I suspect this may be the source of your problem...
For example, if using Azure DevOps, basically you need the following build tasks:
Use Net Core => to install 6.0.x SDK
Restore nuget packages
Build your .sln file via VS Studio build task
Build your .sfproj file via another VS Studio build task with parameters /t:Package /p:PackageLocation=$(build.artifactstagingdirectory)\applicationpackage
And publish artifact using source $(build.artifactstagingdirectory)
Finally, use the default powershell script Deploy-FabricApplication.ps1 that comes with default VS Studio to register and deploy your application to cluster.
We have an on-premises Azure DevOps 2019 server, with build pipelines for numerous .Net 4.x solutions that our small team maintains using VS2019.
The team is about to upgrade to VS2022, and at some point I would like to migrate some solutions to .Net 6. Can DevOps 2019 build .Net 6 solutions, and if so what changes are needed to support this (such as presumably installing VS2022 on the server)?
Will those solutions' build pipelines require any changes or should they continue to work as-is? They don't contain anything too clever, with steps such as: NuGet restore, build solution, run unit tests, NuGet pack & push. (The build pipelines are managed via the web GUI, not YAML, if that makes a difference).
Some solutions will remain .Net 4.x, so the server will still need to support (build) these.
You should just need two things:
First you have to install the corresponding SDK for building the apps (see sdk download - Build apps - SDK) on your build-agents.
(Optional) Add or modify your set SDK Task in your pipelines (see use dotnet core task).
One more hint, you don't need to install a whole VS on the server. The Build-Tools are enough (VS2022 Buildtools preview).
I have an Azure pipeline setup for my builds. I have been running into this issue recently and cannot figure out a way to fix this:
##[error]C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(1220,5): Error MSB3644: The reference assemblies for .NETFramework,Version=v4.6.1 were not found. To resolve this, install the Developer Pack (SDK/Targeting Pack) for this framework version or retarget your application. You can download .NET Framework Developer Packs at https://aka.ms/msbuild/developerpacks
About a week or so ago lots of our builds were failing, MS had changed something and we were getting this sort of thing:
[error]C:\Users\VssAdministrator\.nuget\packages\codegeneration.roslyn.buildtime\0.6.1\build\CodeGeneration.Roslyn.BuildTime.targets(73,5): Error CGR1001: CodeGeneration.Roslyn.Tool (dotnet-codegen) is not available, code generation won't run. Please check https://github.com/AArnott/CodeGeneration.Roslyn for usage instructions.
However was able to solve this by explicitily adding a task to include the netcore2.1 sdk
- task: UseDotNet#2
inputs:
packageType: 'sdk'
version: '2.x'
Now this issues is fixed we are now posed with the error complaining it cannot find .NET Framework 4.6.1.
Anyways any idea whats going on, this is driving me banannas - any advice or insight greatly appreciated.
The .Net framework version 4.6.1 has been deprecated by Azure DevOps Microsoft-hosted agent. For now, there are two kinds of Microsoft-hosted agents:
windows-2019 OR windows-latest: .Net framework version 4.7.2 and 4.8 preinstalled. This is documented here.
windows-2022: .Net framework version 4.8 preinstalled. This is documented here.
That is, you need to use self-hosted agent to use .Net framework 4.6.1 in the pipeline.
From Agent pool - Change Agent Specification from Window-Latest to Window-2019 ,It seems MS has done some changes in default agent
I've installed the latest VS Build Tools (2022), but my on-prem build agent isn't picking up the VisualStudio-related capabilities. I've been under the impression that we no longer need to install the full application in order to get these capabilities.
An example from this blog post:
I've added all workloads to my offline layout, and I've included them in my installation.
I know this is possible, because earlier I accidentally included Python and VS 2019 Build Tools in my Node.js installation configuration. The VS-related capabilities were found by the agent then.
But I'm trying to get 2022, so I uninstalled 2019.
How can I get the 2022 VS-related capabilities to be installed and detected by my build agent, without installing the full Visual Studio product?
You need to upgrade the agent to a recent enough version. You can download the agent from the azure-pipelines-agent repository's releases page. Or manually specify the capabilities.
You may need to set a special environment flag on the agent to prevent it from automatically being downgraded to whatever version shipped with your version if Azure DevOps Server or Team Foundation Server.
And then you'll also need to install the latest version of the vsbuild/msbuild and vstest tasks
Required agent version
You will need to install the most recent agent from the azure-pipelines-agent repository for it to auto-detect Visual Studio 2022, or alternatively add the capabilities to the agent manually.
You may need to force Azure DevOps Server to not downgrade back to its preferred agent version. You can do so by setting the following environment variable at the system level on your server before launching the agent:
AZP_AGENT_DOWNGRADE_DISABLED=true
These tricks will work for most tasks in the azure-pipelines-tasks repository, as long as it doesn't depend on a UI extension or service connection type that isn't available in your version of Azure DevOps Server.
https://jessehouwing.net/adding-visual-studio-2022-to-azure-devops-server-2020/
I've successfully setup and run a self hosted docker build agent using the instructions here: https://learn.microsoft.com/en-us/azure/devops/pipelines/agents/docker?view=azure-devops however VS builds won't run on that agent because it doesn't fulfil a demand for Visual Studio. So my question is
How do install Visual Studio in the docker build agent?
However I've got a feeling this is the wrong question as the project can be build from the command line using dotnet, so an alternative question might be
How to I remove this demand for VS from my build pipeline?
I can't see as I've declared this demand anywhere in the YAML.
How do install Visual Studio in the docker build agent?
For this issue, you can install Visual Studio Build Tools in docker file and then use the built image in the container.
For details, please refer to this official document.