-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to build .NET 5 app in Azure DevOps Pipelines #5120
Comments
@rbhanda this can be closed as it is by design. Starting with preview 8 the SDK depends on a new MSBuild feature which is only available in 16.8 and above. |
Closing as by design |
Yes, you need to have a recent enough version of MSBuild on the machine, so you can update your images to carry the latest preview of VS16.8. |
Is there a way to get these on hosted builds? |
I don't know, @mmitche? |
You may be able to build your app with |
I don't think there is currently any way to get the preview version of VS on the hosted pools. I'll bring it up in Tactics on Tuesday. |
Azure DevOps used to have a pool for the latest VS build, they need to bring that back. Also, they aren't even keeping the version on the existing instances current. The team needs to stay on top of this... I have projects that require both .NET Framework and .NET Core, and maintaining two different versions of my solution just to handle lack of effort on Microsoft's end costs my company money. |
I had a side conversation with Isaac, you can do this with two tasks. Putting the solution here for others who come here:
You can also use the DotNetCoreCLI@2 task in Azure Piplines, for example:
|
Appreciate this, and it works great when you are building from the CLI. The problem is I don't think you folks are testing this in multi-Framework configurations. I have a solution that has BOTH .NET Framework and .NET Core projects, and the code above will not help in that situation because Visual Studio is doing the compiling. Using CLI tasks will not stop the MSBuild process from failing, which will fail the whole process. |
I'm in the same boat as @robertmclaws. We have a mixed framework solution, in preparation for the .NET 5 release. |
Is there any solution for this yet, or are there no other solutions for mixed-solution projects until after the .NET 5 release. |
Since .NET 5 is released now, is there any ETA on when this will be fixed?? |
I have a solution for this before the Azure DevOps team deploys a new version within the next 2 weeks. Here's how it works: Task 1: Install the .NET 5.0 SDK.
THIS IS SUPER FREAKIN IMPORTANT:You need to add the following build variables to re-map what would already be working under MSBuild:
Build normally. Keep an eye on this page for VM image updates. When the Visual Studio version hits 16.8.0, you can remove these extra steps. |
@robertmclaws thanks so much. |
This is what I used for SimpleMessageBus:
|
I tried all of the steps posted by @robertmclaws but got an error in the Build task:
Nothing else seemed to fail. The one item I'm confused about is whether to use:
I tried appending these to the build task and got:
|
@jaybo Yeah that isn't the problem. There are more build variables you need to remap where to look for the .targets files. Working on getting my 30-project build working... once I have it then I'll update my post above with more details. Thanks! |
I updated this comment with additional build variables that I discovered you need to add in order to make this work. NOTE: I did not add those variables to the YAML, you will need to do that yourself (I don't use YAML). HTH! |
I am managing to build and create an artifact for my asp.net (.net 5) project using this yaml.
Edit: my release CD that pushes the artifact to an azure app service isnt finding any artifact... but in the CI build I am not getting any errors |
@public-void-code Yes, that is the standard way to build .NET 5 apps, and it works because your project appears to be a pure .NET 5 app. As I mentioned, if you are doing any kind of mixed Framework configuration in the .sln, that will not work, and you will have to use my solution until they push another VM image within the next week. |
@robertmclaws Ahh I see. Thanks anyway for the use net5 task that I was missing anyway. |
General
When I try to build a .net5 project in Azure Pipelines, I get this error
I have been building the app this way for multiple previews of .NET 5 now, so not sure what changed with Preview 8
The text was updated successfully, but these errors were encountered: