Search code examples
asp.net-coreazure-web-app-servicetfsbuilddnxazure-devops

Error when publishing ASP.NET 5 RC1 project from Visual Studio Team Services with hosted build agent


I'm trying to publish ASP.NET 5 RC1 project to azure web site from Visual Studio Team Services with hosted build agent as it's shown here: https://msdn.microsoft.com/en-us/Library/vs/alm/Build/azure/deploy-aspnet5

However, on Build step I get error when publishing to file system:

[error]C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\Web\Microsoft.DNX.Publishing.targets(156,5): Error : The project being published does not support the runtime 'dnx-clr-win-x86.1.0.0-rc1-final'

I tried publishing to file system locally on my PC and it worked fine.


Solution

  • I was able to fix this issue by

    1. Initializing the right DNX before (so it is available). Watchout, the common PreBuild script loads you the right version, but defaults for runtime (to clr) and architecture (x64 ... assume the build server). You can modify the script for that purpose.
    2. for the MSBuild on the xproj, add the parameter /p:PublishDNXVersion=dnx-coreclr-win-x64.1.0.0-rc1-final (or whatever you need AND matches to (1))

    ps: Tooling is a desaster for DNX right now. Especially in the Team Services.