Building UWP apps on VSTS fails with MSBuild - xamarin

I'm trying to set up CI builds for a Xamarin app using VSTS. The solution builds fine locally but in VSTS its failing on the build task on the UWP app. The android project builds fine in VSTS. As mentioned, everything builds and runs fine locally.
The only error I can see is:
##[error]Process 'msbuild.exe' exited with code '-1'.
Which doesn't help me much, when I look through the rest of the log file, which can be found here (I cant post it here as it doesn't format correctly and is unreadable)

According to the error logs, you are building a UWP project which target to "15063" SDK on a Hosted Build Agent while the Win10 SDK installed on Hosted Agent is 14393 which cause the error.
2017-04-27T14:48:04.8813251Z Could not use a link to copy "C:\Program Files (x86)\Windows Kits\10\UnionMetadata\10.0.15063.0\Windows.winmd" to "C:\a\1\s\MyProject\MyProject\MyProject.UWP\obj\x86\release\ilc\in\WinMetadata\Windows.winmd". Copying the file instead. Unspecified error
2017-04-27T14:48:04.8822945Z
2017-04-27T14:48:04.8822945Z 'MyProject.UWP' violates pattern constraint of '\bms-resource:.{1,256}'
The workaround is deploying your own build agent and install 15063 SDK on it.

Related

Azure Pipelines setup issues with .NET5 Specflow NUnit Project

Having an issue setting up an Azure Pipeline with my .Net5 Specflow NUnit project.
Those the list off jobs I currently have set up however as you can see I am getting an error in the build:
##[error]C:\Program Files\dotnet\sdk\5.0.202\Sdks\Microsoft.NET.Sdk\targets\Microsoft.PackageDependencyResolution.targets(241,5): Error NETSDK1005: Assets file 'D:\a\1\s\obj\project.assets.json' doesn't have a target for 'net5.0'. Ensure that restore has run and that you have included 'net5.0' in the TargetFrameworks for your project.
I have checked my project file and the reference to net5.0 is in there.
It looks like that you didn't install the .NET 5 SDK on the build agents. You can use the .NET core task (https://learn.microsoft.com/en-us/azure/devops/pipelines/tasks/tool/dotnet-core-tool-installer?view=azure-devops) to install it on your agent.
You should also update the NuGet client you are using in your pipeline. 4.4.1 is really old.

Visual Studio Build Not Deploying Upon Build

I am trying to do a Visual Studio Build on TFS 2017. So far, it seems to do the build, but will not do the standard Publish/Deploy I am used to on my local file system, with the Precompiled WCF app, etc. This is what I have so far attached as images, and the PublishProfile I have switched to in desperation. They have VS 2017 installed on the build server, and have updated the MS Build to the latest version. Please help! :)
Visual Studio Build
VM Deploy XML
Check the build log to see whether the deployment executed.
Run the MSBuild command locally on the build agent machine to see whether it works.
Try the following arguments:
/p:SkipInvalidConfigurations=true /p:DeployOnBuild=true /p:WebPublishMethod=FileSystem /p:publishUrl="$(build.artifactstagingdirectory)\\" /p:DeployDefaultTarget=WebPublish

Why am I getting "File type is not supported" on TeamCity 9 when using NUnit 3?

I'm using TeamCity Enterprise 9.1.5 (build 37377).
I have created a Build Configuration.
I have created an NUnit Build Step.
For NUnit Runner I selected NUnit 3.
For Path to NUnit Console Runner I entered: packages\NUnit.ConsoleRunner.3.7.0\tools\nunit3-console.exe
In my Visual Studio solution I have installed the NUnit.Runner package.
When I run the Build Configuration I get the following error in the logs:
File type is not supported
How do I get my NUnit tests to run in TeamCity?
What worked for me:
I uninstalled NUnit.Runner and installed the following packages:
NUnit.ConsoleRunner
NUnit.Extension.NUnitProjectLoader
NUnit.Extension.TeamCityEventListener (not sure if this is needed, or not)
Why is the error being generated?
The ConsoleRunner can't handle .nunit files. That ability is part of NUnit.Extension.NUnitProjectLoader. The directory that extension is in will need to be listed as part of the .addins file. (I can't find the GitHub links where I found that information.)
How I troubleshooted:
TeamCity generated an .nunit file. I copied that file from the agent to my development machine to troubleshoot and run nunit3-console.exe myself. Once it ran on my development machine, TeamCity worked, too.

unable to find nunit assembly for xamarin test cloud in VSTS

Hi I am using VSTS for CI. For my Xamarin Android application during the build process it is trying to test the app on cloud, it's failing as it is not able to find nunit.framework.dll file in the project. I am using Nunit Version 2.6.4
The NuGets in the project are included in the output directory but still, I am getting the issue, can you please help me with it?
VSTS: Test Assembly Directory: Solution/Droid.UITests
Error:
Unable to find the nunit.framework.dll in the assembly directory. In Xamarin Studio you may have to right-click on the nunit.framework reference and choose Local Copy for it to be included in the output directory.
I got it. I had to remove the old references from the solution's nuget package collection.

PhoneGap 3.3.0 WP8 project giving MSBuild error

I've decided to try PhoneGap and installed the Node package for it. (Phonegap 3.3.0)
Android projects work fine. But when I try to build a WP8 (or WP7) App I get this error:
An error occurred while building the wp7 project.ERROR: MSBuild failed
to create .xap when building cordova-wp7 for debugging.
I'm running Windows 8 Pro 64 bit, Visual Studio 2013 Ultimate, NodeJS & PhoneGap 3.3.0
A sidenote: WP8 Projects created with the Cordova Project Templates work perfectly fine.
It's the command line version that's giving me trouble.
I faced the same issue...
Perhaps it's an issue of the required files (for compilation) not being at the said path, since I could resolve it by running in the Visual Studio Command Prompt & compile successfully:

Resources