microsoft/azure-pipelines-tasks

Support for .NET Core .csproj files?

mikeesouth opened this issue · 90 comments

Hi,

I'm using ASP.NET Core with the latest dotnet CLI tools (.NET Command Line Tools (1.0.0-preview4-004233)) that uses .csproj files and no longer the project.json file.

The dotnet command uses msbuild internally if I understand it correctly but the VSTS Tasks marked with "Restore/Build/Publish .NET Core (Preview)" does not work. I get this error: error: Invalid input 'C:/a/1/s/server/server.csproj'. The file type was not recognized.

Maybe I can use the MSBuild tasks?

According to this link, the hosted pool should support .NET Core 1.1 and I would assume the latest dotnet CLI tools as well?

The full log for .NET Core (Preview) Restore task:

2016-12-27T09:12:58.5105042Z ##[section]Starting: Restore
2016-12-27T09:12:58.5544954Z ==============================================================================
2016-12-27T09:12:58.5544954Z Task         : .NET Core (PREVIEW)
2016-12-27T09:12:58.5544954Z Description  : Build, test and publish using dotnet core command-line.
2016-12-27T09:12:58.5544954Z Version      : 0.1.0
2016-12-27T09:12:58.5544954Z Author       : Microsoft Corporation
2016-12-27T09:12:58.5544954Z Help         : [More Information](https://go.microsoft.com/fwlink/?linkid=832194)
2016-12-27T09:12:58.5544954Z ==============================================================================
2016-12-27T09:13:00.1207826Z [command]C:\Program Files\dotnet\dotnet.exe restore C:/a/1/s/server/server.csproj
2016-12-27T09:13:55.3911318Z 
2016-12-27T09:13:55.3911318Z Welcome to .NET Core!
2016-12-27T09:13:55.3911318Z ---------------------
2016-12-27T09:13:55.3911318Z Learn more about .NET Core @ https://aka.ms/dotnet-docs. Use dotnet --help to see available commands or go to https://aka.ms/dotnet-cli-docs.
2016-12-27T09:13:55.3911318Z Telemetry
2016-12-27T09:13:55.3911318Z --------------
2016-12-27T09:13:55.3911318Z The .NET Core tools collect usage data in order to improve your experience. The data is anonymous and does not include commandline arguments. The data is collected by Microsoft and shared with the community.
2016-12-27T09:13:55.3911318Z You can opt out of telemetry by setting a DOTNET_CLI_TELEMETRY_OPTOUT environment variable to 1 using your favorite shell.
2016-12-27T09:13:55.3911318Z You can read more about .NET Core tools telemetry @ https://aka.ms/dotnet-cli-telemetry.
2016-12-27T09:13:55.3911318Z Configuring...
2016-12-27T09:13:55.3911318Z -------------------
2016-12-27T09:13:55.3911318Z A command is running to initially populate your local package cache, to improve restore speed and enable offline access. This command will take up to a minute to complete and will only happen once.
2016-12-27T09:13:55.3921321Z Decompressing 0%����������������Decompressing 1%����������������Decompressing 2%����������������Decompressing 3%����������������Decompressing 4%����������������Decompressing 5%����������������Decompressing 6%����������������Decompressing 7%����������������Decompressing 8%����������������Decompressing 9%����������������Decompressing 10%�����������������Decompressing 11%�����������������Decompressing 12%�����������������Decompressing 13%�����������������Decompressing 14%�����������������Decompressing 15%�����������������Decompressing 16%�����������������Decompressing 17%�����������������Decompressing 18%�����������������Decompressing 19%�����������������Decompressing 20%�����������������Decompressing 21%�����������������Decompressing 22%�����������������Decompressing 23%�����������������Decompressing 24%�����������������Decompressing 25%�����������������Decompressing 26%�����������������Decompressing 27%�����������������Decompressing 28%�����������������Decompressing 29%�����������������Decompressing 30%�����������������Decompressing 31%�����������������Decompressing 32%�����������������Decompressing 33%�����������������Decompressing 34%�����������������Decompressing 35%�����������������Decompressing 36%�����������������Decompressing 37%�����������������Decompressing 38%�����������������Decompressing 39%�����������������Decompressing 40%�����������������Decompressing 41%�����������������Decompressing 42%�����������������Decompressing 43%�����������������Decompressing 44%�����������������Decompressing 45%�����������������Decompressing 46%�����������������Decompressing 47%�����������������Decompressing 48%�����������������Decompressing 49%�����������������Decompressing 50%�����������������Decompressing 51%�����������������Decompressing 52%�����������������Decompressing 53%�����������������Decompressing 54%�����������������Decompressing 55%�����������������Decompressing 56%�����������������Decompressing 57%�����������������Decompressing 58%�����������������Decompressing 59%�����������������Decompressing 60%�����������������Decompressing 61%�����������������Decompressing 62%�����������������Decompressing 63%�����������������Decompressing 64%�����������������Decompressing 65%�����������������Decompressing 66%�����������������Decompressing 67%�����������������Decompressing 68%�����������������Decompressing 69%�����������������Decompressing 70%�����������������Decompressing 71%�����������������Decompressing 72%�����������������Decompressing 73%�����������������Decompressing 74%�����������������Decompressing 75%�����������������Decompressing 76%�����������������Decompressing 77%�����������������Decompressing 78%�����������������Decompressing 79%�����������������Decompressing 80%�����������������Decompressing 81%�����������������Decompressing 82%�����������������Decompressing 83%�����������������Decompressing 84%�����������������Decompressing 85%�����������������Decompressing 86%�����������������Decompressing 87%�����������������Decompressing 88%�����������������Decompressing 89%�����������������Decompressing 90%�����������������Decompressing 91%�����������������Decompressing 92%�����������������Decompressing 93%�����������������Decompressing 94%�����������������Decompressing 95%�����������������Decompressing 96%�����������������Decompressing 97%�����������������Decompressing 98%�����������������Decompressing 99%�����������������Decompressing 100% 6221 ms
2016-12-27T09:13:55.3921321Z Expanding 0%������������Expanding 1%������������Expanding 2%������������Expanding 3%������������Expanding 4%������������Expanding 5%������������Expanding 6%������������Expanding 7%������������Expanding 8%������������Expanding 9%������������Expanding 10%�������������Expanding 11%�������������Expanding 12%�������������Expanding 13%�������������Expanding 14%�������������Expanding 15%�������������Expanding 16%�������������Expanding 17%�������������Expanding 18%�������������Expanding 19%�������������Expanding 20%�������������Expanding 21%�������������Expanding 22%�������������Expanding 23%�������������Expanding 24%�������������Expanding 25%�������������Expanding 26%�������������Expanding 27%�������������Expanding 28%�������������Expanding 29%�������������Expanding 30%�������������Expanding 31%�������������Expanding 32%�������������Expanding 33%�������������Expanding 34%�������������Expanding 35%�������������Expanding 36%�������������Expanding 37%�������������Expanding 38%�������������Expanding 39%�������������Expanding 40%�������������Expanding 41%�������������Expanding 42%�������������Expanding 43%�������������Expanding 44%�������������Expanding 45%�������������Expanding 46%�������������Expanding 47%�������������Expanding 48%�������������Expanding 49%�������������Expanding 50%�������������Expanding 51%�������������Expanding 52%�������������Expanding 53%�������������Expanding 54%�������������Expanding 55%�������������Expanding 56%�������������Expanding 57%�������������Expanding 58%�������������Expanding 59%�������������Expanding 60%�������������Expanding 61%�������������Expanding 62%�������������Expanding 63%�������������Expanding 64%�������������Expanding 65%�������������Expanding 66%�������������Expanding 67%�������������Expanding 68%�������������Expanding 69%�������������Expanding 70%�������������Expanding 71%�������������Expanding 72%�������������Expanding 73%�������������Expanding 74%�������������Expanding 75%�������������Expanding 76%�������������Expanding 77%�������������Expanding 78%�������������Expanding 79%�������������Expanding 80%�������������Expanding 81%�������������Expanding 82%�������������Expanding 83%�������������Expanding 84%�������������Expanding 85%�������������Expanding 86%�������������Expanding 87%�������������Expanding 88%�������������Expanding 89%�������������Expanding 90%�������������Expanding 91%�������������Expanding 92%�������������Expanding 93%�������������Expanding 94%�������������Expanding 95%�������������Expanding 96%�������������Expanding 97%�������������Expanding 98%�������������Expanding 99%�������������Expanding 100% 19039 ms
2016-12-27T09:13:55.3921321Z error: Invalid input 'C:/a/1/s/server/server.csproj'. The file type was not recognized.
2016-12-27T09:13:55.4061327Z ##[error]Dotnet command failed with non-zero exit code: 1.
2016-12-27T09:13:55.4101313Z ##[section]Finishing: Restore
2016-12-27T09:12:58.5105042Z ##[section]Starting: Restore
2016-12-27T09:12:58.5544954Z ==============================================================================
2016-12-27T09:12:58.5544954Z Task         : .NET Core (PREVIEW)
2016-12-27T09:12:58.5544954Z Description  : Build, test and publish using dotnet core command-line.
2016-12-27T09:12:58.5544954Z Version      : 0.1.0
2016-12-27T09:12:58.5544954Z Author       : Microsoft Corporation
2016-12-27T09:12:58.5544954Z Help         : [More Information](https://go.microsoft.com/fwlink/?linkid=832194)
2016-12-27T09:12:58.5544954Z ==============================================================================
2016-12-27T09:13:00.1207826Z [command]C:\Program Files\dotnet\dotnet.exe restore C:/a/1/s/server/server.csproj
2016-12-27T09:13:55.3911318Z 
2016-12-27T09:13:55.3911318Z Welcome to .NET Core!
2016-12-27T09:13:55.3911318Z ---------------------
2016-12-27T09:13:55.3911318Z Learn more about .NET Core @ https://aka.ms/dotnet-docs. Use dotnet --help to see available commands or go to https://aka.ms/dotnet-cli-docs.
2016-12-27T09:13:55.3911318Z Telemetry
2016-12-27T09:13:55.3911318Z --------------
2016-12-27T09:13:55.3911318Z The .NET Core tools collect usage data in order to improve your experience. The data is anonymous and does not include commandline arguments. The data is collected by Microsoft and shared with the community.
2016-12-27T09:13:55.3911318Z You can opt out of telemetry by setting a DOTNET_CLI_TELEMETRY_OPTOUT environment variable to 1 using your favorite shell.
2016-12-27T09:13:55.3911318Z You can read more about .NET Core tools telemetry @ https://aka.ms/dotnet-cli-telemetry.
2016-12-27T09:13:55.3911318Z Configuring...
2016-12-27T09:13:55.3911318Z -------------------
2016-12-27T09:13:55.3911318Z A command is running to initially populate your local package cache, to improve restore speed and enable offline access. This command will take up to a minute to complete and will only happen once.
2016-12-27T09:13:55.3921321Z Decompressing 0%����������������Decompressing 1%����������������Decompressing 2%����������������Decompressing 3%����������������Decompressing 4%����������������Decompressing 5%����������������Decompressing 6%����������������Decompressing 7%����������������Decompressing 8%����������������Decompressing 9%����������������Decompressing 10%�����������������Decompressing 11%�����������������Decompressing 12%�����������������Decompressing 13%�����������������Decompressing 14%�����������������Decompressing 15%�����������������Decompressing 16%�����������������Decompressing 17%�����������������Decompressing 18%�����������������Decompressing 19%�����������������Decompressing 20%�����������������Decompressing 21%�����������������Decompressing 22%�����������������Decompressing 23%�����������������Decompressing 24%�����������������Decompressing 25%�����������������Decompressing 26%�����������������Decompressing 27%�����������������Decompressing 28%�����������������Decompressing 29%�����������������Decompressing 30%�����������������Decompressing 31%�����������������Decompressing 32%�����������������Decompressing 33%�����������������Decompressing 34%�����������������Decompressing 35%�����������������Decompressing 36%�����������������Decompressing 37%�����������������Decompressing 38%�����������������Decompressing 39%�����������������Decompressing 40%�����������������Decompressing 41%�����������������Decompressing 42%�����������������Decompressing 43%�����������������Decompressing 44%�����������������Decompressing 45%�����������������Decompressing 46%�����������������Decompressing 47%�����������������Decompressing 48%�����������������Decompressing 49%�����������������Decompressing 50%�����������������Decompressing 51%�����������������Decompressing 52%�����������������Decompressing 53%�����������������Decompressing 54%�����������������Decompressing 55%�����������������Decompressing 56%�����������������Decompressing 57%�����������������Decompressing 58%�����������������Decompressing 59%�����������������Decompressing 60%�����������������Decompressing 61%�����������������Decompressing 62%�����������������Decompressing 63%�����������������Decompressing 64%�����������������Decompressing 65%�����������������Decompressing 66%�����������������Decompressing 67%�����������������Decompressing 68%�����������������Decompressing 69%�����������������Decompressing 70%�����������������Decompressing 71%�����������������Decompressing 72%�����������������Decompressing 73%�����������������Decompressing 74%�����������������Decompressing 75%�����������������Decompressing 76%�����������������Decompressing 77%�����������������Decompressing 78%�����������������Decompressing 79%�����������������Decompressing 80%�����������������Decompressing 81%�����������������Decompressing 82%�����������������Decompressing 83%�����������������Decompressing 84%�����������������Decompressing 85%�����������������Decompressing 86%�����������������Decompressing 87%�����������������Decompressing 88%�����������������Decompressing 89%�����������������Decompressing 90%�����������������Decompressing 91%�����������������Decompressing 92%�����������������Decompressing 93%�����������������Decompressing 94%�����������������Decompressing 95%�����������������Decompressing 96%�����������������Decompressing 97%�����������������Decompressing 98%�����������������Decompressing 99%�����������������Decompressing 100% 6221 ms
2016-12-27T09:13:55.3921321Z Expanding 0%������������Expanding 1%������������Expanding 2%������������Expanding 3%������������Expanding 4%������������Expanding 5%������������Expanding 6%������������Expanding 7%������������Expanding 8%������������Expanding 9%������������Expanding 10%�������������Expanding 11%�������������Expanding 12%�������������Expanding 13%�������������Expanding 14%�������������Expanding 15%�������������Expanding 16%�������������Expanding 17%�������������Expanding 18%�������������Expanding 19%�������������Expanding 20%�������������Expanding 21%�������������Expanding 22%�������������Expanding 23%�������������Expanding 24%�������������Expanding 25%�������������Expanding 26%�������������Expanding 27%�������������Expanding 28%�������������Expanding 29%�������������Expanding 30%�������������Expanding 31%�������������Expanding 32%�������������Expanding 33%�������������Expanding 34%�������������Expanding 35%�������������Expanding 36%�������������Expanding 37%�������������Expanding 38%�������������Expanding 39%�������������Expanding 40%�������������Expanding 41%�������������Expanding 42%�������������Expanding 43%�������������Expanding 44%�������������Expanding 45%�������������Expanding 46%�������������Expanding 47%�������������Expanding 48%�������������Expanding 49%�������������Expanding 50%�������������Expanding 51%�������������Expanding 52%�������������Expanding 53%�������������Expanding 54%�������������Expanding 55%�������������Expanding 56%�������������Expanding 57%�������������Expanding 58%�������������Expanding 59%�������������Expanding 60%�������������Expanding 61%�������������Expanding 62%�������������Expanding 63%�������������Expanding 64%�������������Expanding 65%�������������Expanding 66%�������������Expanding 67%�������������Expanding 68%�������������Expanding 69%�������������Expanding 70%�������������Expanding 71%�������������Expanding 72%�������������Expanding 73%�������������Expanding 74%�������������Expanding 75%�������������Expanding 76%�������������Expanding 77%�������������Expanding 78%�������������Expanding 79%�������������Expanding 80%�������������Expanding 81%�������������Expanding 82%�������������Expanding 83%�������������Expanding 84%�������������Expanding 85%�������������Expanding 86%�������������Expanding 87%�������������Expanding 88%�������������Expanding 89%�������������Expanding 90%�������������Expanding 91%�������������Expanding 92%�������������Expanding 93%�������������Expanding 94%�������������Expanding 95%�������������Expanding 96%�������������Expanding 97%�������������Expanding 98%�������������Expanding 99%�������������Expanding 100% 19039 ms
2016-12-27T09:13:55.3921321Z error: Invalid input 'C:/a/1/s/server/server.csproj'. The file type was not recognized.
2016-12-27T09:13:55.4061327Z ##[error]Dotnet command failed with non-zero exit code: 1.
2016-12-27T09:13:55.4101313Z ##[section]Finishing: Restore

If you are using hosted agent - then the tooling there works only with project.json files. We will be working on adding support for csproj based .Net Core projects to hosted images. However, if you use your own agent and install the tools supporting csproj files - the task would work.

zidad commented

@sachinma, I don't fully understand, when using VS2017RC the project.json files are deprecated when converting the solution, so we can't build VS2017 projects now at all on a hosted build agent?

You are right about your understanding of the current state. VS2017 RC based .Net core projects cannot be compiled on the hosted build agent right now. As I mentioned, we are working to add that capability. In the meantime, as a workaround you can use a private build agent which has the right version of .net core tools and then use the task.

zidad commented

Thanks!

I was hoping there would be some hackety-hackety way we could still build it on the hosted build agent, but I'll end my quest here :)

vip32 commented

hi @sachinma any ETA for building core on vsts (hosted build)? will it be available when vs2017 RTMs early march?

It would be great if VSTS kept up more closely with .net core... right now, we re a bit stuck without any real timeline.

Yes. When it RTMs, it will be on our image. We've been keeping up with it. The issue is we have one hosted image. That image is at max size (128GB) due to all the versions of VS and other tools. So for that reason, we will have to pull older versions and replace with 2017. In parallel we have multi image support in the pipeline to address the main problem. With that, we'll have an image per era of VS and even be able to release preview images before RTM of next VS versions.

In the meantime, private agents are an option and private agents work with VSTS.

Why is this marked as closed though? It's clearly not fixed yet.

vip32 commented

this is really holding us back from doing any .net core projects at the moment. hope it will be fixed as soon as RTM releases next week! private agents are no solution, as we use this whole vsts as a service to stay out of that nightmare.

VS 2017 released and still not working

Not working for me either. Is the .Net Core (Preview) build step still the right one to use or should we be using the MSBuild step?

Is there a plan when the new (and now Released) Csproj Format Support will be there for Hosted Agents?
It would be helpfull to know, because when someone would say Q3 2017 then (for me) it would make sence to spent time to build a Strategy for Automating the Setup of Build Agents and just forget about the Hosted Agents. (And when i would have to care about the Agents why then not using directly an On-Promise Installation...)

Not working for me, either... sigh... Brand new core 1.1 web app project created in VS 2017, new VSO project collection. New build definition from the .NET Core (PREVIEW) template.. Bombs. Says that .csproj file not recognized. All rainbows and lollipops in the VS launch demos today, but in real life.. sigh..

I am having the same problem

2017-03-08T00:31:16.8747494Z ##[section]Starting: Restore
2017-03-08T00:31:16.9217495Z ==============================================================================
2017-03-08T00:31:16.9217495Z Task : .NET Core (PREVIEW)
2017-03-08T00:31:16.9217495Z Description : Build, test and publish using dotnet core command-line.
2017-03-08T00:31:16.9217495Z Version : 0.4.1
2017-03-08T00:31:16.9217495Z Author : Microsoft Corporation
2017-03-08T00:31:16.9217495Z Help : More Information
2017-03-08T00:31:16.9217495Z ==============================================================================
2017-03-08T00:31:18.5392559Z [command]C:\Program Files\dotnet\dotnet.exe restore D:\a\1\s\LifestyleFlexibility\LifestyleFlexibility.csproj
2017-03-08T00:32:41.2362472Z
2017-03-08T00:32:41.2372463Z Welcome to .NET Core!
2017-03-08T00:32:41.2422475Z ---------------------
2017-03-08T00:32:41.2422475Z Learn more about .NET Core @ https://aka.ms/dotnet-docs. Use dotnet --help to see available commands or go to https://aka.ms/dotnet-cli-docs.
2017-03-08T00:32:41.2422475Z Telemetry
2017-03-08T00:32:41.2432475Z --------------
2017-03-08T00:32:41.2432475Z The .NET Core tools collect usage data in order to improve your experience. The data is anonymous and does not include commandline arguments. The data is collected by Microsoft and shared with the community.
2017-03-08T00:32:41.2432475Z You can opt out of telemetry by setting a DOTNET_CLI_TELEMETRY_OPTOUT environment variable to 1 using your favorite shell.
2017-03-08T00:32:41.2432475Z You can read more about .NET Core tools telemetry @ https://aka.ms/dotnet-cli-telemetry.
2017-03-08T00:32:41.2432475Z Configuring...
2017-03-08T00:32:41.2432475Z -------------------
2017-03-08T00:32:41.2432475Z A command is running to initially populate your local package cache, to improve restore speed and enable offline access. This command will take up to a minute to complete and will only happen once.
2017-03-08T00:32:41.2445274Z error: Invalid input 'D:\a\1\s\test\test.csproj'. The file type was not recognized.
2017-03-08T00:32:41.2542476Z ##[error]Dotnet command failed with non-zero exit code: 1.
2017-03-08T00:32:41.2582479Z ##[section]Finishing: Restore

This is endlessly frustrating... the end to end tooling still isn't there. Every time you think we're good to start using Core in a meaningful way, something else isn't "done."

That is clearly not out yet.

still not working :(

for those who are blocked, i created a task group that downloads the latest tools and unzip in my sources directory. i then use command lines with what i downloaded. works fine if you don't mind downloading and unpacking everytime.

alternatively, you may use the dotnet install script (there is a version for linux and windows). havent tried that one...

Why is this closed? It is currently impossible to build csproj based .NET Core projects on VSO.

Is there an ETA at least? Every reference I can find says "by RTM".

Some people rely on VSO for dev-ops and production...

I agree with with dcarl.. Why is this closed???? I spent all day yesterday trying to get a VS 2017 .csproj to build on VSO. Tried MSbuild, Visual Studio 2017 build steps.. no success. In addition, another unit test project that was still project.json based starting failing on VSO the minute I upped it to .NET Core App 1.1.1. Had to rollback to 1.1.0. Sigh... I am really getting tired of the constant frustration of "RTM" products that are released which are clearly not ready. I am the lead developer at my company giving VS 2017 a test run. I can not recommend that our company upgrade to VS 2017 until at least SP 1 comes out. Sound familiar from the old days?

I'll reopen till your scenario works.

There's two separate things - the tasks (this repo) and the hosted pool image which doesn't have 2017 and new dotnet cli tooling installed on it (not covered in this repo).

Good news is that image is rolling out now ( we were waiting for final build which we have).

You will see another Queue for your def to target (VS2017).

Other piece of good news for the future we will have multi image support on hosted. That will allow us to have separate images with early previews of tooling, images for different toolsets like java etc... Smaller images that make us more nimble rolling out things (our monolithic image was 128GB and regen would reset testing on every dev scenario).

Hopefully that explains it a bit better.

@dcarl1 @srpeterson @moattarwork - we will wait for your ack and feedback on the overall scenario to close.

Sorry for you issues here.

Thank you for your quick response. I will give it another shot later on today and provide feedback

@bryanmacfarlane Good day. I understand the image is quite big, and may take some time to roll out. As of right now, I do not see that new Queue option. Is there an expected ETA for this to be completed?

@bryanmacfarlane Thank you. With newly released dev tools Github is the best (and often only) resource to get information about what is working within the tool chain. Having the ticket open until it works at least prevents people from wasting time trying to get it to work.

I don't see any difference too. That would be ideal if you add a quick steps as well.
Currently you have two templates for build in VSO both in preview which one is ASP.net Core and the other one is ASP.net and the latter has support for solution build but it can't find and compatible agent.

Hi. I just fired off another .NET Core (Preview) build on my VS 2017 .csproj web app on VSO. Sorry to say, but it is still failing. It fails on the "Restore" step before it actually builds:

rror: Invalid input 'D:\a\1\s\DocumentDb.Poc.Api\DocumentDb.Poc.Api.csproj'. The file type was not recognized.
Dotnet command failed with non-zero exit code: 1.
C:\Program Files\dotnet\dotnet.exe restore D:\a\1\s\DocumentDb.Poc.Tests\DocumentDb.Poc.Tests.csproj
error: Invalid input 'D:\a\1\s\DocumentDb.Poc.Tests\DocumentDb.Poc.Tests.csproj'. The file type was not recognized.
Dotnet command failed with non-zero exit code: 1.


Any ETA on when the new image might be up and running?

Are we talking hours, days, weeks, .. here?

This is hardly a surprise, this change to .NET Core has been coming for many, many months, and there has been the SDK tooling that supports .csproj and project.json availble for almost as long

It should go out with our current (114) sprints rollout. Sprints take 1 - 2 weeks to roll through scale units.

Per above, you will know you have it when you see a VS2017 queue. The hosted pool queue image does not have VS2017.

@benc-uk - correct this isn't a surprise. We've been working with .net core since it's inception. Our agent is even built with .net core and we've followed it's tooling closely (we recently changed our build from project.json to .csproj). The issue is what I outlined above - our single image only contains released products primarily because there is often SxS issues of pre-released software impacting other versions and currently stable builds. We are working on separate image support (realized as separate queues) so going forward we hope to have images with pre-released versions available in our hosted pool as they become available to users.

We realize this as a limitation and problem in our hosted pool which is why we're working on separate queue and image support in our hosted pool. We had originally hoped to make VS2017 available on the single image but it was too large and we couldn't remove VS2010 (to make room) without breaking some folks builds. So the work was pinned up behind the release, the new image and a subset of the new image support (enough to create another queue) on the VSTS build side.

Hope that clarifies.

The workaround is to create a private agent on an azure VM.

What does it mean "see a VS2017 queue?" You guys are talking about pools, images and queues as if we all know and understand the underlying infrastructure of VSTS. I understand build definitions and steps within them.

@jeffputz I think it means agent queues, we should see another one for VS 2017 appearing soon here:

image

@bryanmacfarlane please correct me if I'm wrong

For those in a non-production testing environment, I found creating a private agent on my local PC does the trick. It seems odd to push code up to VSTS, only for it to push it back to perform the build and tasks, but regardless, it allows continued movement on testing out the new features using VSTS.

@mbowman8 I originally moved to VSTS because I don't want to manage local infrastructure.

+1 - any updates?

Since it sounds like this is a week or two away from roll out I've spun up a private build agent on Azure. The process is pretty simple, I (roughly) documented it here:

  • Create an Azure VM
  • Install dotnet core on the VM
  • Install dotnet 462 SDK on the VM
  • Install any other agent requirements (IE Node for NODE/NPM, Gulp.)
  • Install Web Deploy (https://www.microsoft.com/en-us/download/details.aspx?id=43717)
  • Download the build agent (VSO Admin -> Agent Queues -> Download Agent )
  • Extract to a folder on the VM. If you are running as a service, the c:\ drive works best due to permissions
  • Create a PAT in VSO (https://www.visualstudio.com/en-us/docs/build/actions/agents/v2-windows)
  • Open a command prompt in the agents folder and run ./config
    • URL is https://.visualstudio.com/
    • PAT as defined above
    • I left everything else as default, except run as service
  • Ensure the service is started (note: I ended up running the service as my local user to get gulp to work. Not ideal, but this is temporary so I didn't look at fixing it)
  • You should now see the agent in VSO Settings -> Agent Queues
  • Select this queue in the build definition settings and run your build.

Pretty simple unless, as others have pointed out, you're in this in the first place to get out of the business of maintaining your own infrastructure.

@jeffputz Yes, but it is a temporary work around while the images roll out.

If anyone is using Docker I've created an VSTS build agent image with the latest .NET Core SDK installed. I've used this with VSTS to successfully build & publish .csproj based projects.
https://hub.docker.com/r/bencuk/vsts-agent/

@sachinma Could you provide an update? Clearly still not working at this point. I mean host does not build VS2017 with asp.net core issue.

Thanks

@sachinma As already pointed out, a current workaround is to install it as part of the build (it only takes about 3 minutes). Just copy this PowerShell script into your repository and call it as follows in a PowerShell build step (note that the installation and build somehow have to be in the same build step)
$currentPath = split-path $SCRIPT:MyInvocation.MyCommand.Path -parent # where this script and the installer script lives
cd $currentPath
.\dotnet-install.ps1
cd "InsertSourceDirectoryHere"
dotnet restore
dotnet build

the above workaround (while not ideal) seems to work just fine

@koenmetsu thanks for the updates.

I see that you can now choose Hosted VS2017 in Edit / General / Default agent queue.
Seems to work great 👍

@hallatore I can't find this, can you share a screenshot of where it is please?

@aloneguid I think it's rolling out atm. Not sure it's available to everyone yet.

The VS2017 agent queue has just appeared in my account, and my .NET Core .csproj builds are working fine with it. Thanks guys

@hallatore ah thank you, probably still rolling out, I don't have it:

image

image

Yeah, last ring is around mon/tue hopefully.

Thanks for confirming it works for you

Thanks. .Net Core preview tasks seems to run fine now. But now when I try to add nuget publisher as a last task I get an error stating that there are no available agents for 'Cmd' requirement.

rwlnd commented

I really find it incomprehensible that you would let people upgrade their solution without having the necessary tooling in place on VSTS! Lost an hour trying to fix my CI build before stumbling on this issue page. This is the reason why, for now, I am only using dotnet core for hobby projects and would not recommend using it for enterprise solutions at all!

@byatis, that is an issue with our capabilities we have listed for the new virtual agent. For now, you should be able to add a custom capability for CMD (you can copy it from the current setting in the regular hosted agent). I'm pushing a fix that should go out Monday to add this to the regular set of capabilities.

still not working for me

@hanwash - we need specifics. Are you not seeing the hosted vs2017 queue? ( my comment above says it's mon / tue for last rings ). Or is it issue with cod capability? Or is it something else? Maybe an error message?

@bryanmacfarlane I am not seeing the hosted vs2017. I did not your last comment. I will give it to Wed given the time diff. Thanks

@bryanmacfarlane I just created a new project in a new TFS account and Hosted VS2017 is not listed. :(

Is there anything I can do to accelerate the process?

@bryanmacfarlane Is the Mon/Tue comment still in good standing? Have been checking agent queues for last 3-4 days, still don't have it there:
image

Yes, it's on schedule to start rolling to ring 4 (our last ring) today (Mon). It's in progress now. Hopefully it's everywhere today or tomorrow. It's also carrying a patch for the CMD capability issue noted above.

IT'S ALIVE! Thanks @bryanmacfarlane and crew! 👍 👍 👍
image

Yap. It shows as above !

awcab commented

I'm running into a problem with nuget on the new VS 2017 queue:

[command]C:\Windows\system32\chcp.com 65001
2017-03-21T02:38:20.1855569Z Active code page: 65001
2017-03-21T02:38:20.2205594Z Detected NuGet version 3.5.0.1938 / 3.5.0
2017-03-21T02:38:20.2266017Z SYSTEMVSSCONNECTION exists true
2017-03-21T02:38:20.2295597Z [command]C:\a_tasks\NuGetInstaller_333b11bd-d341-40d9-afcf-b32d5ce6f23b\0.2.29\node_modules\nuget-task-common\NuGet\3.5.0\NuGet.exe restore -NonInteractive C:\a\1\s\WebUI\WebUI\WebUI.sln
2017-03-21T02:38:25.1588651Z Failed to load msbuild Toolset
2017-03-21T02:38:25.1588651Z Could not load file or assembly 'Microsoft.Build, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
2017-03-21T02:38:25.1885740Z ##[error]Error: C:\a_tasks\NuGetInstaller_333b11bd-d341-40d9-afcf-b32d5ce6f23b\0.2.29\node_modules\nuget-task-common\NuGet\3.5.0\NuGet.exe failed with return code: 1
2017-03-21T02:38:25.1895742Z ##[error]Packages failed to install
2017-03-21T02:38:25.1963035Z ##[section]Finishing: Restore Packages

I have a problem trying to build https://github.com/losttech/NKeyValue/ using new VS2017 hosted queue

dotnet build
Microsoft (R) Build Engine version 15.1.548.43366
Copyright (C) Microsoft Corporation. All rights reserved.
C:\Users\buildguest\AppData\Local\Temp\.NETStandard,Version=v1.4.AssemblyAttributes.cs(4,20): error CS0400: The type or namespace name 'System' could not be found in the global namespace (are you missing an assembly reference?) [C:\a\1\s\src\NKeyValue.csproj]
obj\Debug\netstandard1.4\NKeyValue.AssemblyInfo.cs(6,12): error CS0246: The type or namespace name 'System' could not be found (are you missing a using directive or an assembly reference?) [C:\a\1\s\src\NKeyValue.csproj]

Those errors appear in pretty much every file. I tried MSBuild, Visual Studio Build and simple Run Command dotnet run all with the same result. I can build it locally no problem.

I'm excited to see the "Hosted VS2017" agent queue option now appears in my account as of today. However, when I select it, I get a new error on restoring:

2017-03-21T06:12:15.2950927Z ##[section]Starting: Restore
2017-03-21T06:12:15.3260925Z ==============================================================================
2017-03-21T06:12:15.3260925Z Task         : .NET Core (PREVIEW)
2017-03-21T06:12:15.3260925Z Description  : Build, test and publish using dotnet core command-line.
2017-03-21T06:12:15.3260925Z Version      : 0.4.1
2017-03-21T06:12:15.3260925Z Author       : Microsoft Corporation
2017-03-21T06:12:15.3260925Z Help         : [More Information](https://go.microsoft.com/fwlink/?linkid=832194)
2017-03-21T06:12:15.3260925Z ==============================================================================
2017-03-21T06:12:16.3461107Z [command]C:\Program Files\dotnet\dotnet.exe restore C:\a\1\s\Saleslists.csproj
2017-03-21T06:12:17.2564047Z 
2017-03-21T06:12:17.2564047Z Unhandled Exception: System.BadImageFormatException: An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)
2017-03-21T06:12:17.2624051Z ##[error]
Unhandled Exception: System.BadImageFormatException: An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)
2017-03-21T06:12:17.2634048Z 
2017-03-21T06:12:17.2815203Z ##[error]Unable to process command '##vso[task.complete ]Dotnet command failed with non-zero exit code: 3762504530.' successfully. Please reference documentaion (http://go.microsoft.com/fwlink/?LinkId=817296)
2017-03-21T06:12:17.2824835Z ##[error]Command doesn't have valid result value.
2017-03-21T06:12:17.4745198Z ##[section]Finishing: Restore

My .csproj looks like this. I don't know if this is relevant, but I made the project with the dotnet CLI, rather than with Visual Studio 2017. "dotnet restore" works fine on both my mac and my windows PC.

<Project ToolsVersion="15.0" Sdk="Microsoft.NET.Sdk.Web">
  <PropertyGroup>
    <TargetFramework>netcoreapp1.1</TargetFramework>
    <TypeScriptCompileBlocked>true</TypeScriptCompileBlocked>
    <PackageTargetFallback>$(PackageTargetFallback);portable-net45+win8+wp8+wpa81;</PackageTargetFallback>
    <!--<GenerateDocumentationFile>true</GenerateDocumentationFile>-->
  </PropertyGroup>
  <ItemGroup>
    <PackageReference Include="Microsoft.AspNetCore" Version="1.1.0" />
    <PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="1.1.0" />
    <PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="1.1.0" />
    <PackageReference Include="Microsoft.AspNetCore.Mvc" Version="1.1.1" />
    <PackageReference Include="Microsoft.AspNetCore.SpaServices" Version="1.1.0" />
    <PackageReference Include="Microsoft.AspNetCore.StaticFiles" Version="1.1.0" />
    <PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="1.1.0" />
    <PackageReference Include="Microsoft.EntityFrameworkCore" Version="1.1.1" />
    <PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="1.1.0" />
    <PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="1.1.0" />
    <PackageReference Include="Microsoft.EntityFrameworkCore.Tools.DotNet" Version="1.0.0" />
    <PackageReference Include="Microsoft.DotNet.Watcher.Tools" Version="1.0.0" />
    <PackageReference Include="Microsoft.IdentityModel.Tokens" Version="5.1.2" />
    <PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="1.0.0" />
    <PackageReference Include="Swashbuckle.AspNetCore" Version="1.0.0-rc1" />
    <PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="5.1.2" />
  </ItemGroup>
  <ItemGroup>
    <DotNetCliToolReference Include="Microsoft.EntityFrameworkCore.Tools.DotNet" Version="1.0.0" />
    <DotNetCliToolReference Include="Microsoft.DotNet.Watcher.Tools" Version="1.0.0" />
    <DotNetCliToolReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Tools" Version="1.0.0" />
  </ItemGroup>
  <ItemGroup>
    <!-- Files not to show in IDE -->
    <None Remove="yarn.lock" />
    <!-- Files not to publish (note that the 'dist' subfolders are re-added below) -->
    <Content Remove="ClientApp\**" />
  </ItemGroup>
  <Target Name="RunWebpack" AfterTargets="ComputeFilesToPublish">
    <!-- As part of publishing, ensure the JS resources are freshly built in production mode -->
    <Exec Command="npm install" />
    <Exec Command="node node_modules/webpack/bin/webpack.js --config webpack.config.vendor.js --env.prod" />
    <Exec Command="node node_modules/webpack/bin/webpack.js --env.prod" />
    <!-- Include the newly-built files in the publish output -->
    <ItemGroup>
      <DistFiles Include="wwwroot\dist\**; ClientApp\dist\**" />
      <ResolvedFileToPublish Include="@(DistFiles->'%(FullPath)')" Exclude="@(ResolvedFileToPublish)">
        <RelativePath>%(DistFiles.Identity)</RelativePath>
        <CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
      </ResolvedFileToPublish>
    </ItemGroup>
  </Target>
</Project>

The queue has finally appeared for me as well, no problems with builds so far.

While this was going on I had to wrap my build process in a self-contained powershell script, which can do everything end-to-end. It was a good thing for the project as I'm not relying on a particular build server anymore. Now I just invoke the script from VSTS task and it just works.

I'm still using quite a few VSTS tasks which are not that trivial to replicate locally or for security reasons i.e. sharing endpoint credentials.

I'm happy to report that my .NET Core (Preview) build steps work correctly now.

@lostmsu my guess is you are not restoring your packages.

I just imported your repository and verified that it builds just fine on the VS 2017 queue. I simply had to dotnet restore on the solution and dotnet build on the solution.

awcab commented

I think I ran into this bug. Switching to nuget 3.3 allowed packages to restore.

@awcab you can also just run dotnet restore. In addition NuGet 4 will be rolling out starting next week.

awcab commented

Ah, thanks @chrisrpatterson ! I didn't think about that. Still getting used to the new core tools.

I got this errror:

2017-03-21T18:52:33.6424886Z
2017-03-21T18:52:33.6424886Z 'gulp' is not recognized as an internal or external command,
2017-03-21T18:52:33.6424886Z operable program or batch file.

anyone can help-me ?

I got a similar one about Bower. Worked fine in VSTS before I upgraded to 2017 csproj. Not had chance yet to work out why though.

@tiagorosendo, @dracan The VS 2017 does not have any npm packages installed globally, like the old image did (due to not installing Cordova). Do you have gulp or bower in your project.json file as a requirement? The tasks should be able to find those in the local npm module cache without a problem.

@tiagorosendo I ran into this issue today as well. My resolution was to invoke the npm, bower, and gulp task outside of the MSBuild using the VSTS tasks.

you will need to remove "PrepareForPublish" target in your csproj

<Target Name="PrepublishScript" BeforeTargets="PrepareForPublish">
    <!--<Exec Command="npm install" />-->
    <!--<Exec Command="bower install" />-->
    <!--<Exec Command="gulp all" />-->
  </Target>

image

I also had an issue with including dotnet core web jobs into the project.
this is my work around. If anyone knows of a better solution i'd love to hear it:

<Target Name="PostpublishScript" AfterTargets="Publish">
    <Exec Command="dotnet publish ..\WebJobContinuous\ -c Release -o $(PublishDir)\app_data\jobs\Continuous\WebJobContinuous\" />
    <Exec Command="dotnet publish ..\WebJobTriggered\ -c Release -o $(PublishDir)\app_data\jobs\Triggered\WebJobTriggered\" />
  </Target>

tested and working. much easier now :) thanks

@JacobAtchley Thanks for that info. I've tried what you described, but I get the following error in the bower install task ...

Your NPM global location is not in PATH, add the result of 'npm prefix -g' to your PATH and try again

Did you have to do anything additional to set that PATH?

awcab commented

@dracan Since node is included with visual studio, you can bootstrap the whole install like this:

<Target Name="InstallDeps" BeforeTargets="BeforeBuild">
   <Exec Command="node  ContinueOnError="false" />
   <!-- it is, so have npm install all dependencies -->
   <Exec WorkingDirectory="$(ProjectDir)" Command="npm install" ContinueOnError="false" />
   <!-- npm installed bower for us, so now let bower install it's dependencies -->
   <Exec WorkingDirectory="$(ProjectDir)" Command="node_modules\.bin\bower install" ContinueOnError="false" />
   <!-- run the gulp task for the appropriate configuration -->
   <Exec WorkingDirectory="$(ProjectDir)" Command="node_modules\.bin\gulp $(Configuration)" ContinueOnError="false" />
 </Target>

@dracan i did not have to do anything in the npm install task in VSTS. the only thing i changed in the task was my working folder to the root of my asp.net core app (where the .csproj and packages.json files are located)

I didn't have any luck getting that to work, so I tried recreating my project and copying my own code files back in, and it worked fine. I had previously created it a while back using the Yeoman tooling. This time I created it using the dotnet cli. I didn't need the additional VSTS build steps in this case either.

I'm using the HOSTED VS2017 build agent and the asp.net core preview still fails with:

C:\Program Files\dotnet\dotnet.exe restore C:\a\1\s\Blogs.csproj
C:\a\1\s\Blogs.csproj : error MSB4057: The target "Restore" does not exist in the project.

And if you add a command to get the dotnet.exe version it is still coming up as 1.0.0-preview3-004056 instead of final.

Everything works perfectly locally with the production versions of dotnet.

I tried the dotnet-install.ps1 script but it can't find the version that was just extracted in a Powershell execution step so I'm still stuck.

And I'm completely at a loss as to how this wasn't coordinated with the release of VS.net 2017 final and we're at almost a month now and this STILL isn't working reliably for everyone. BAD planning by people at MS.

Closing this since TFS2017 queue is available with the tooling. This is not an issue that will stay open to track any issue folks might have with building net core projects. Open separate issues for specific issues.

This is still an issue. Our Hosted2017 agent has an outdated version of dotnet core (dotnet.exe) on it that prevents dotnet restore/build/publish from functioning on release versions of VS.net 2017 and similar and it still hasn't been addressed now pushing a month from release of VS.net 2017 when this should have been timed with the release in the first place.

The image has the released VS2017 and it's tools. It has dotnet 1.0.0. Here's my output from a simple build running dotnet --version against the hosted vs2017 queue

2017-03-22T17:51:54.9286497Z ##[section]Starting: dotnet --version
2017-03-22T17:51:54.9306495Z ==============================================================================
2017-03-22T17:51:54.9306495Z Task         : .NET Core (PREVIEW)
2017-03-22T17:51:54.9306495Z Description  : Build, test and publish using dotnet core command-line.
2017-03-22T17:51:54.9306495Z Version      : 0.4.1
2017-03-22T17:51:54.9306495Z Author       : Microsoft Corporation
2017-03-22T17:51:54.9306495Z Help         : [More Information](https://go.microsoft.com/fwlink/?linkid=832194)
2017-03-22T17:51:54.9306495Z ==============================================================================
2017-03-22T17:51:55.9234330Z [command]C:\Program Files\dotnet\dotnet.exe --version
2017-03-22T17:51:56.0105221Z 1.0.0
2017-03-22T17:51:56.0215334Z ##[section]Finishing: dotnet --version

If you're not seeing that, then open a separate issue and we'll help you track your specific issue down.

We've confirmed with most the folks on this thread that it's working for them. As I said above, let's take the outliers on a case by case basic with specific logged issues. That benefits the OSS community as they get more targeted symptom searches and resolutions as opposed to reading through one long thread with multiple issues intertwined.

Respectfully @JohnGalt1717 , I'd open a new ticket for your issue. Could be something specific to your account/settings? It sounds like this is working for most people. Best of luck!

#3898 created.

Wanted to report that our VS2017 host is working as expected. Thanks for the efforts. Perhaps it could be shared with those who plan that this work would be better suited as finished on the date of release.

ace26 commented

It is May and I ran into the same issue when my default queue was set to "Hosted". The build kept on failing with the error message:

2017-05-24T16:04:43.8388172Z error: Invalid input 'd:\a\1\s****.csproj'. The file type was not recognized.

However, as @hallatore suggested, I switched the default queue to "HostedVS2017" and that did the magic.

@ace26 - yes, that is the solution. Select the vs2017 queue which selects a vs2017 machine which supports net core csproj