我想在 Azure Devops 中为 XAP 移动应用程序设置持续集成和部署。
为了获得 CI/CD,我需要设置 Azure Pipeline 来安装正确的包。
文档中有一些信息托管您自己的 NuGet 源 https://learn.microsoft.com/en-us/nuget/hosting-packages/overview
and
Dev Express 解释说,他们目前不提供 XAF 的 Nuget feed,但我可以自己制作委托的 DCNugetPackageBuilder http://blog.delegate.at/2016/02/26/nuget-packages-devexpress-components.html
使用DXNugetPackageBuilder制作Nuget包
按照说明,我下载了 .pdb 文件,将它们解压到 c:\tmp\symbols
我还下载了 DXNugetPackageBuilder 并根据说明编辑了 buildPackages.bat。
接下来我在提升的 Powershell 中运行 build.ps1
这在 C:\tmp\Nuget 创建了 .nupkg 文件
默认情况下,这使用位于
C:\Program Files (x86)\DevExpress 18.1\Components\Bin\Framework
.pdb 文件位于
c:\tmp\symbols
使用 Nuget.Exe 和凭据提供程序将包推送到源
The Connect To Feed screen mentions I need to download Nuget.exe and the credential provider
这是有关的文档凭证提供者 https://learn.microsoft.com/en-us/nuget/reference/extensibility/nuget-exe-credential-providers
我解压了 VSTS CredentialProviders Nuget.Exe。
下一步是按照“连接到源”屏幕的“添加此源”部分给出的说明进行操作。
例如
nuget.exe push -Source "SBDDevExpress" -ApiKey VSTS c:\tmp\Nuget\DevExpress.Data.18.1.6.0.nupkg
我遇到了访问被拒绝的问题在这里解决了 https://stackoverflow.com/questions/52798199/how-do-i-grant-access-to-nugetcredentialprovider-to-push-my-package-into-my-azur
然后我就可以推送所有我想要的包裹了。
设置Nuget包源
在 VS2017 中,打开我的解决方案,我使用了 Tools -> Nuget Package Manager -> Package Manager Settings
我添加了包设置,并将 Azure 端点设置为包源。
构建错误
当我运行构建管道时,我收到如下错误
The type or namespace DevExpress could not be found are you missing a directive or assembly reference?
来自学习 Updater.cs 和 Module.cs
我似乎缺少 Nuget feed 中的以下命名空间。
DevExpress.ExpressApp.DC;
DevExpress.ExpressApp.Updating;
DevExpress.Persistent.BaseImpl.PermissionPolicy;
[Update]
DevExpress 建议我将 bin 文件夹中生成的 dll 与我的包源进行比较。
我发现了几个丢失的文件并推送了它们的包。
我现在有
XafMobile.Module\Properties\licenses.licx(1.0): Error LC0003: Unable to resolve type 'DevExpress.ExpressApp.ModuleBase"
从源代码中可以看到ModuleBase是DevExpress.ExpressApp中的公共类
我想知道这是否与反思有关。
Devexpress 上有一些提到它support https://www.devexpress.com/Support/Center/Question/Details/T490157/the-unable-to-resolve-type-defined-in-licenses-licx-error-appears
[Update]
我尝试删除许可证文件并同步项目。
现在错误显示为缺少程序集引用
另外,当我重建解决方案时,属性文件夹中缺少许可证文件
我怀疑是否这有助于解释它 https://www.devexpress.com/Support/Center/Question/Details/Q525711/licenses-licx-file-not-generated
[Update]
Manuel Grunder [DevExpress MVP] 和 DXNugetPackageBuilder 作者解释说
”
使用 nuget.packages 时,您还需要通过 nuget 引用它们正如他在这里解释的那样 https://www.devexpress.com/Support/Center/Question/Details/T681650/missing-name-spaces-from-self-made-nuget-packages
"