2
votes

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.

2
Which dnx version did you select when you published locally? Did you install the corresponding runtime of framework? - Cece Dong - MSFT
When I publish locally I select Target DNX Version: Default(dnx-coreclr-win-x86.1.0.0-rc1-final) and Configuration: release - twinmind
If change framework in project.json from dnxcore50 to dnx50 and publish locally again with dnx-clr-win-x86.1.0.0-rc1-final, I get the same error as on hosted build agent - twinmind
I also have this issue. Seems like the complete VS build is based on CLR and not CoreCLR for me. I find no setting to change it for the publish task. - Thomas

2 Answers

4
votes

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.

0
votes

I was getting the exact same error trying to do a native publish:

dnu publish --native --runtime 1.0.0-rc1-update2

I managed to get things working by first specifying a specific version to use and then doing a publish using the 'active' runtime:

dnvm use 1.0.0-rc1-update2 -r coreclr
dnu publish --native --runtime active

Hope this helps