Search code examples
azure-devopsnuget-packagexaf

How do I set up Azure Dev Ops to build Dev Express XAF-XPO project?


I want to set up continuous integration and deployment for an XAP Mobile app in Azure Devops.

In order to get CI/CD I need to set up the Azure Pipeline to install the right packages.

There is some information in the docs on Hosting your own NuGet feeds and Get started with NuGet packages in Azure DevOps

Dev Express explained that they do not currently provide a Nuget feed for XAF, but I can make my own Delegate's DCNugetPackageBuilder

Using DXNugetPackageBuilder to make Nuget packages

As per the instructions I downloaded the .pdb files extracted them to c:\tmp\symbols

I also downloaded DXNugetPackageBuilder and edited buildPackages.bat according to instructions.

Next I ran build.ps1 in elevated Powershell

This created the .nupkg files at C:\tmp\Nuget

By default this uses the files located at

 C:\Program Files (x86)\DevExpress 18.1\Components\Bin\Framework

and the .pdb files located at

c:\tmp\symbols

Using Nuget.Exe and the Credential Provider to push the packages to the feed

The Connect To Feed screen mentions I need to download Nuget.exe and the credential provider download credential provider

Here are the docs on the Credentials Provider

I unzipped the VSTS CredentialProviders Nuget.Exe is included.

The next step is to follow the instructions given by the "add this feed" section of the Connect To Feed screen.

For example

nuget.exe push -Source "SBDDevExpress" -ApiKey VSTS c:\tmp\Nuget\DevExpress.Data.18.1.6.0.nupkg

I ran into an access denied issue that got solved here

then I was able to push all the packages I wanted.

Set the Nuget Package Source

In VS2017 with my solution open I used Tools -> Nuget Package Manager -> Package Manager Settings

I added package settings with the Azure endpoint set up as a package source.

Errors building

When I run the build pipeline I get errors like

The type or namespace DevExpress could not be found are you missing a directive or assembly reference?

looking at the pipeline error

From studying Updater.cs and Module.cs It seems I am missing the following namespaces from the Nuget feed.

DevExpress.ExpressApp.DC;
DevExpress.ExpressApp.Updating;
DevExpress.Persistent.BaseImpl.PermissionPolicy;

[Update]

DevExpress suggested I compare the dlls generated in the bin folder with my package feed.

I found several missing files and pushed their packages.

I now have

XafMobile.Module\Properties\licenses.licx(1.0): Error LC0003: Unable to resolve type 'DevExpress.ExpressApp.ModuleBase"

showing in the build output

I can see from the source code that ModuleBase is a public class in DevExpress.ExpressApp

I am wondering if this is something to do with reflection.

There is some mention of it at Dev Express support

[Update]

I tried removing the licence files and syncing the project. Now the errors show as missing assembly references

missing assembly references

Also When I rebuild my solution the license files are missing from the properties folders

I wonder if this helps explain it

[Update]

Manuel Grunder [DevExpress MVP] and DXNugetPackageBuilder author explained that

" When working with nuget.packages you need to reference them via nuget as well as he explains here "


Solution

  • As is explained here

    "When working with nuget.packages you need to reference them via nuget as well. Thats the reason why it did not work in the first place."