Build error on Appveyor with newest ASP.NET 5 - appveyor

I'm trying to build an ASP.NET 5 web api and build it on Appveyor. I get this error:
Build started
git clone -q --branch=master https://github.com/nikolaschou/TodolistService01.git C:\projects\todolistservice01
git checkout -qf 3c97bb95ecf54662069b6ae8fa25a60f598a564d
msbuild "TodolistService.sln" /verbosity:minimal /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"
Microsoft (R) Build Engine version 14.0.24720.0
Copyright (C) Microsoft Corporation. All rights reserved.
Cannot find DNX runtime dnx-clr-win-x86.1.0.0-rc1-update1 in the folder: C:\Users\appveyor.dnx\runtimes
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\DNX\Microsoft.DNX.targets(126,5): error : The Dnx Runtime package needs to be installed. See output window for more details. [C:\projects\todolistservice01\src\TodolistService\TodolistService.xproj]
Command exited with code 1
This project is based on .NET framework 4.6.1 and ASP.NET 5. The references are DNX 4.5.1 and DNX Core 5.0.
Feel free to reproduce the error by building this public repository:
https://github.com/nikolaschou/TodolistService01
Can anyone explain why it fails? Is Appveyor not yet ready for these new versions?

Basically, you have to do two things:
install .NET framework
restore packages
This is appveyor.yml to build your project:
os: Visual Studio 2015
install:
- dnvm upgrade -r clr
- dnu restore
build:
verbosity: minimal
Build results: https://ci.appveyor.com/project/FeodorFitsner/todolistservice01

Also, you may need to select right version in your global.json:
{
"sdk": {
"version": "1.0.0-rc1-final"
}
}

Related

Azure DevOps Pipelene doesn't compile .netstandard 2.0 projects

I'm stuck in a rut with this proble. After converting some solution projects in .netstandard 2.0 the pipeline doesn't compile. Other are .NET Framework 4.8 projects.
Here the errors
Installed SDKs: No .NET SDKs were found.
Install the [6.0.400] .NET SDK or update
[E:\myApplicationFolder\global.json] to match an installed SDK.
Download a .NET SDK: https://aka.ms/dotnet-download
I tried the following steps:
installed VS 2022 and tells to the pipeline to use VS 2022 msbuild
installed the .NET sdk
created the global.json choerent with the solution
checked the environment variables (they point to C:\Program Files\dotnet)
checked the version of .NET SDK
This is the global.json
{
"sdk": {
"version": "6.0.400"
}
}
There are the configuration on the pipeline
I don't have any troubles building the solution with msbuild from powershell.
Any other suggestions? Thanks
Many problems, Azure DevOps isn't updated to the latest version and can't manage .NET 6.0 solutions. I had to specify the msbuild of VS 2022 also to restore nuget packages

how to call boost libraries on appveyor, how to set environment variable to run boost test successfully?

I want to run boost test in appveyor. My code can built successfully without boost test. When I run boost test, it has compile error.
Build started
2
git clone -q --branch=master https://github.com/Gaussma/StaticLibrary.git c:\projects\myproject
3
git checkout -qf 857f43f706d59e6ed74d7af6771d102850e615a0
4
msbuild "c:\projects\myproject\StaticLibrary.sln" /verbosity:minimal /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"
5
Microsoft (R) Build Engine version 15.9.21+g9802d43bc3 for .NET Framework
6
Copyright (C) Microsoft Corporation. All rights reserved.
7
8
LinkedListcpp.cpp
9
MathFuncsLib.cpp
10
Generating Code...
11
MathFuncsLib.vcxproj -> c:\projects\myproject\x64\Debug\MathFuncsLib.lib
12
boostTest_LinkedList.cpp
13
c:\projects\myproject\myexecrefslib\boosttest_linkedlist.cpp(3): fatal error C1083: Cannot open include file: 'boost/test/included/unit_test.hpp': No such file or directory [c:\projects\myproject\MyExecRefsLib\MyExecRefsLib.vcxproj]
Cleary, the appveyor can not find the boost library.
Locally, I am using Visual Studio 2017 and boost library 1_68_0 to generate the MyExecRefsLib.vcxproj file.
I search on the stackoverflow and find others implement the .yml file in this way.
environment:
BOOST_ROOT: C:\Libraries\boost_1_59_0
BOOST_LIBRARYDIR: C:\Libraries\boost_1_59_0\lib64-msvc-14.0
I update it correspondingly for boost_1_67_0 since I am using Visual Studio 2017 in appveyor and boost already installed in appveyor Virtual Machine.
https://www.appveyor.com/docs/windows-images-software/#boost
environment:
BOOST_ROOT: C:\Libraries\boost_1_67_0
BOOST_LIBRARYDIR: C:\Libraries\boost_1_67_0\lib64-msvc-14.1
I do not have .yml file , I set those two the environmental variables manually in the project's setting in appveyor.
I am wondering what is the correction setting for those two environment variables to run boost test? Current setting has compile error.
Acutually, this is very easy question. We should make the build environment are same between my local machine and appveyor.
In appveyor :
environment:
BOOST_ROOT: C:\Libraries\boost_1_64_0
BOOST_LIBRARYDIR: C:\Libraries\boost_1_64_0\lib64-msvc-14.1
In Visual Studio :
Project-> Properties-> C/C++ ->General -> Additional Include Directories : C:\Libraries\boost_1_64_0
Project-> Properties->Linker -> Additional Library Dependencies : C:\Libraries\boost_1_64_0\lib64-msvc-14.1
Just move the boost_1_64_0 in the Libraries and change the library from stage_x8\lib to lib64-msvc-14.1 is OK.

I'm having issues using postsharp 5.0.31 and .net core 1.1 on macOS Sierra, I'm getting a build error

I'm trying to build a .netcore 1.1 console project using postsharp 5.0.31 on macOS Sierra, but when I run the command line:
dotnet build
The build fail and show the next output;
MacBook-Pro:PostsharpSample userx$ dotnet build
Microsoft (R) Build Engine version 15.1.548.43366
Copyright (C) Microsoft Corporation. All rights reserved.
PostsharpSample -> /Users/userx/Documents/VSCode/netcore/PostsharpSample/bin/Debug/netcoreapp1.1/PostsharpSample.dll/Users/userx/.nuget/packages/postsharp/5.0.31/build/PostSharp.targets(564,5): error MSB4062:
The "PostSharp.MSBuild.PostSharp30ChangeAppConfig" task could not be loaded from the assembly /Users/userx/.nuget/packages/postsharp/5.0.31/build/PostSharp.MSBuild.v5.0.31.Release.dll.
Could not load file or assembly 'Microsoft.Build.Utilities.v4.0, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.
The system cannot find the file specified. [/Users/userx/Documents/VSCode/netcore/PostsharpSample/PostsharpSample.csproj]/Users/userx/.nuget/packages/postsharp/5.0.31/build/PostSharp.targets(564,5):
error MSB4062: Confirm that the <UsingTask> declaration is correct, that the assembly and all its dependencies are available, and that the task contains a public class that implements Microsoft.Build.Framework.ITask. [/Users/userx/Documents/VSCode/netcore/PostsharpSample/PostsharpSample.csproj]
It is possible to use .netcore and Postsharp on macOS Sierra?
I need specific configuration?
As of version 5.0, PostSharp does not support building under any OS other the Windows. .NET Core is supported only as a target framework for your projects.
Please refer to http://doc.postsharp.net/requirements for latest information on compatibility.
You can also vote for adding support for .NET Core as a build platform on this UserVoice page: Support for CoreCLR as a build platform (including Linux, iOS).

Build Windows IoT Core application based on .netcore.app 1.1.2

I'm testing the possibilities of a raspberry pi2 and .NET Core 1.1.
If I create an application with .NET Core 1.1 and try to build it to RID "Win10-arm", I receive following error:
Unable to resolve 'runtime.win8-arm.Microsoft.NETCore.Jit (>= 1.1.2)'
for '.NETCoreApp,Version=v1.1 (win10-arm)'.
Is this something that is not supported yet?
I think this issue is similar to https://github.com/dotnet/coreclr/issues/9694 but I couldn't find any reference which stated that.
Thank you for your answer!
can you try this?
I created an .NET Core Console App and published successfully with win10-arm
Get this Nuget Package:
Install-Package runtime.win8-arm.Microsoft.NETCore.Jit -Version 2.0.0-preview1-25301-02 -Pre
then you can build and publish.
:\Users\x\Documents\Visual Studio 2017\Projects\TestArm\TestArm>dotnet publish -c Release -r win10-arm
Microsoft (R) Build Engine version 15.3.117.23532
Copyright (C) Microsoft Corporation. All rights reserved.
TestArm -> C:\Users\x\Documents\Visual Studio 2017\Projects\TestArm\TestArm\bin\Release\netcoreapp1.1\win10-arm\TestArm.dll
TestArm -> C:\Users\x\Documents\Visual Studio 2017\Projects\TestArm\TestArm\bin\Release\netcoreapp1.1\win10-arm\publish\

Visual Studio Team Services ASPNET CORE build failure

I'm trying to setup a build definition for a new ASPNET Core webapp.
The setup of the build definition is exactly this:
Official Docs
The build fails at building the solution with this error:
Issues
Build
File name doesn't indicate a full path to a executable file.
GETSDKTOOLINGINFO (0, 0)
The project is configured to use .NET Core SDK version 1.0.0-preview2-003131 which is not installed or cannot be found under the path C:\Program Files\dotnet. These components are required to build and run this project. Download the version of .NET Core SDK specified in global.json or update the SDK version in global.json to the version that is installed.
Process 'msbuild.exe' exited with code '1'.
Any guess on how to solve this?
Thanks
Francesco
You need to install the corresponding version of .Net SDK to build agent machine.
You can refer to this article to download .Net Core 1.0.0-preview2-003131 and install it on your build machine.
Assuming you are using hosted build agent. According to Software on the hosted build server, the hosted build server is deployed with the following .NET Framework:
.NET 4.6
.NET 4.5.2
.NET 4.5.1
.NET 4.5
.NET 3.5 SP1
.NET Core 1.0 with Preview 2 Tooling
You may try to deploy an on-premises build agent and install .NET Core 1.0.1 SDK 1.0.0-preview2-003131 to work with VSTS: https://www.visualstudio.com/en-us/docs/build/admin/index#deploy_agent.
If you insist on using hosted build agent, then you need to use version of Microsoft.NETCore.App that is installed in VSTS, for example:
"dependencies": {
"Microsoft.NETCore.App": {
"version": "1.0.0-rc2-3002702",
"type": "platform"
},
In my case, it was just a change in global.config:
{
"projects": [ "src", "test" ],
"sdk": {
"version": "1.0.0-preview2-003121"
}
}
As long as 1.0.0-preview2-003131 is not available on VSO build hosts