UWP Create App Package fails for release mode - c#

I am trying to create app package for a UWP app (side loading) in release mode it fails with below error. It works fine for debug mode
Severity Code Description Project File Line Suppression State
Error ILT0021: Could not resolve type
'System.Security.SecurityZone' MyApp.ModuleName
Project Properties
When I enable Compile with .NET Native tool chain, I get following error
Severity Code Description Project File Line Suppression State
Error ILT0005:
'C:\Users\username.nuget\packages\runtime.win10-x86.microsoft.net.native.compiler\2.1.8\tools\x86\ilc\ilc.exe
--gatekeeper #"C:\Projects......\obj\x86\Release\ilc\intermediate\gkargs.rsp"'
returned exit code 1 MyApp.Module
When I try to do build on Azure DevOps I get this error
(BuildNativePackage target) -> 2019-02-06T15:14:28.4996296Z
C:\Program Files (x86)\Microsoft
SDKs\UWPNuGetPackages\microsoft.net.native.compiler\2.2.1\tools\Microsoft.NetNative.targets(792,5):
error : ILT0021: Could not resolve type 'System.Security.SecurityZone'
[D:\a\1\s\ProjectFolder\MyApp.ModuleName.csproj]
Update 02/14/2019
Problem was with bunch of Powershell packages I installed from nuget, I removed it all now I am able to create the package. But the package fails to pass App Certification Kit test with the following errors
Windows security features test
FAILED Binary analyzer Error Found: The binary analyzer test detected
the following errors: File C:\Program
Files\windowsapps\myapp.module.subver_1.0.21.0_x64__7p23rrj50tgdp\clrcompression.dll
has failed the AppContainerCheck check.
Supported API test
FAILED Supported APIs Error Found: The supported APIs test detected
the following errors: API sysctl in libc.dll is not supported for this
application type. Microsoft.DotNet.PlatformAbstractions.dll calls this
API. API RtlGetVersion in ntdll.dll is not supported for this
application type. Microsoft.DotNet.PlatformAbstractions.dll calls this
API. API LoadLibraryExW in kernel32.dll is not supported for this
application type. clrcompression.dll calls this API. API
RtlCaptureContext in kernel32.dll is not supported for this
application type. clrcompression.dll calls this API. API
RtlVirtualUnwind in kernel32.dll is not supported for this application
type. clrcompression.dll calls this API. API UnhandledExceptionFilter
in kernel32.dll is not supported for this application type.
clrcompression.dll calls this API. API ExecuteAssembly in uwphost.dll
is not supported for this application type.
MyApp.Subver.exe calls this API. API
DllGetActivationFactory in uwphost.dll is not supported for this
application type. Myapp.subver.exe has an export that
forwards to this API.

Related

Error : Unable to load DLL 'libgmp-10.dll' when testing azure function c# .net 5.0

I published my c# .NET 5.0 code to azure functions (windows) and im getting this weird error message:
2021-06-21T01:56:53.465 [Error] Executed 'Function1' (Failed, Id=fdefdbba-49a7-44ad-8082-841d2941d90b, Duration=169ms)Unable to load DLL 'libgmp-10.dll' or one of its dependencies: The specified module could not be found. (0x8007007E)
I tried to see the \wwwroot files on the azure functions console but then i get this error:
3 [main] ls (8392) C:\Program Files\Git\usr\bin\ls.exe: *** fatal error - Couldn't set directory to \\?\PIPE\ temporarily.
Any hints?
It seems that the deployment is not done correctly.
Libgmp-10.dll a DLL (Dynamic Link Library) file which is referred to
essential system files of the Windows OS. It usually contains a set of
procedures and driver functions, which may be applied by Windows.
Please delete the Azure Function and, re-create and deploy a fresh code using Develop and publish .NET 5 functions using Azure Functions OR if you are using ADO, Setting up a CI/CD pipeline for Azure Functions.
Let me know if you have any follow up questions.

An error has occurred during web site deployment in App Service Editor

I made some changes in the QnAMakerBasDialog.cs file, in trying to edit the default threshold. I did not change any other thing. When I tried deploying my changes at first, I was not getting the expected response and so I went back the editor to reverse my changes. It was at this point I started getting this error message.
I need help in reversing all changes if possible but most expecially in getting "test web chart" and all my channels working again.
Please see error message error:
kindly note that I tried this in the kudu console but still got the same error message
\> build.cmd
1 file(s) copied.
Installing Kudu Sync
D:\local\AppData\npm\kudusync -> D:\local\AppData\npm\node_modules\kudusync\bin\kudusync
+ kudusync#0.3.0
added 7 packages from 8 contributors in 3.22s
Handling ASP.NET Core Web Application deployment.
Failed to add 'D:\local\UserProfile\.dotnet\tools' to the PATH environment variable. Add this directory to your PATH to use tools installed with 'dotnet tool install'.
Welcome to .NET Core 3.1!
---------------------
SDK Version: 3.1.301
Telemetry
---------
The .NET Core tools collect usage data in order to help us improve your experience. The data is anonymous. It is collected by Microsoft and shared with the community. You can opt-out of telemetry by setting the DOTNET_CLI_TELEMETRY_OPTOUT environment variable to '1' or 'true' using your favorite shell.
Read more about .NET Core CLI Tools telemetry: https://aka.ms/dotnet-cli-telemetry
----------------
Explore documentation: https://aka.ms/dotnet-docs
Report issues and find source on GitHub: https://github.com/dotnet/core
Find out what's new: https://aka.ms/dotnet-whats-new
Learn about the installed HTTPS developer cert: https://aka.ms/aspnet-core-https
Use 'dotnet --help' to see available commands or visit: https://aka.ms/dotnet-cli-docs
Write your first app: https://aka.ms/first-net-core-app
--------------------------------------------------------------------------------------
Unhandled exception. System.ComponentModel.Win32Exception (5): Access is denied.
at System.Diagnostics.Process.set_PriorityClassCore(ProcessPriorityClass value)
at System.Diagnostics.Process.set_PriorityClass(ProcessPriorityClass value)
at Microsoft.Build.CommandLine.MSBuildApp.Execute(String[] commandLine)
at Microsoft.Build.CommandLine.MSBuildApp.Main(String[] args)
MSBUILD : error MSB1025: An internal failure occurred while running MSBuild.
System.ComponentModel.Win32Exception (5): Access is denied.
at System.Diagnostics.Process.set_PriorityClassCore(ProcessPriorityClass value)
at System.Diagnostics.Process.set_PriorityClass(ProcessPriorityClass value)
at Microsoft.Build.CommandLine.MSBuildApp.Execute(String[] commandLine)
Failed exitCode=-532462766, command=dotnet restore "QnABot.sln"
An error has occurred during web site deployment.
Surprisingly, I also encountered this problem. I also encountered this problem in Buid after modifying the Azure Bot code!
Even with this error, my build is successful

My hosted Azure pipeline is failing with: rcz discover exited with code -2147450730

I have two aspnet core 3.1 applications and have set up two azure piplines:
One pipeline is working fine building and testing my project, the other one (similar structure and referencing same projects) is failing with following error:
C:\hostedtoolcache\windows\dotnet\sdk\3.1.101\Sdks\Microsoft.NET.Sdk.Razor\build\netstandard2.0\Sdk.Razor.CurrentVersion.targets(404,5): warning RAZORSDK1006: Detected Razor language version downgrade. This is typically caused by a reference to the Microsoft.AspNetCore.Razor.Design package. Consider removing this package reference. [d:\a\1\s\Sources\Web\Web.csproj]
CSC : warning CS8034: Unable to load Analyzer assembly C:\Users\VssAdministrator\.nuget\packages\microsoft.aspnetcore.mvc.analyzers\2.2.0\analyzers\dotnet\cs\Microsoft.AspNetCore.Mvc.Analyzers.dll : Assembly with same name is already loaded [d:\a\1\s\Sources\Web\Web.csproj]
C:\Users\VssAdministrator\.nuget\packages\microsoft.aspnetcore.razor.design\2.2.0\build\netstandard2.0\Microsoft.AspNetCore.Razor.Design.CodeGeneration.targets(79,5): error : rzc discover exited with code -2147450730. [d:\a\1\s\Sources\Web\Web.csproj]
54 Warning(s)
1 Error(s)
Time Elapsed 00:02:41.66
##[error]Error: The process 'C:\hostedtoolcache\windows\dotnet\dotnet.exe' failed with exit code 1
Info: Azure Pipelines hosted agents have been updated to contain .Net Core 3.x SDK/Runtime along with 2.2 & 2.1. Unless you have locked down a SDK version for your project(s), 3.x SDK might be picked up which might have breaking behavior as compared to previous versions.
Some commonly encountered changes are:
If you're using `Publish` command with -o or --Output argument, you will see that the output folder is now being created at root directory rather than Project File's directory. To learn about more such changes and troubleshoot, refer here: https://learn.microsoft.com/en-us/azure/devops/pipelines/tasks/build/dotnet-core-cli?view=azure-devops#troubleshooting
##[error]Dotnet command failed with non-zero exit code on the following projects : d:\a\1\s\Sources\Web\Web.csproj
Does someone have an idea what I can check?
Kind regards

Can i build C# projects on Ubuntu with Jenkins?

We have Jenkins running on an Ubuntu OS 18.04.01 LTS and an older project written in C# / .NET 4.5
The application was always build manually in the past and I would like to use Jenkins to introduce CI so nobody needs to build the project manually anymore. The application does not have to run on Linux or anything like that, we just need the buildfiles (executables and DLL files). Is it possible to build this C# solution with Jenkins on Ubuntu?
I know about MONO and XBUILD but actually I can't manage to build the project under ubuntu because of different issues which do not happen under Windows, e.g. see here:
UserControls/ExpandablePanel.cs(33,35): error CS1043: Invalid accessor body `=>', expecting `;' or `{'
UserControls/ExpandablePanel.cs(33,66): error CS1043: Invalid accessor body `=>', expecting `;' or `{'
UserControls/ExpandablePanel.cs(35,41): error CS1043: Invalid accessor body `=>', expecting `;' or `{'
UserControls/ExpandablePanel.cs(37,40): error CS1043: Invalid accessor body `=>', expecting `;' or `{'
UserControls/ExpandablePanel.cs(133,22): error CS1644: Feature `pattern matching' cannot be used because it is not part of the C# 6.0 language specification
UserControls/PagedDataGridView.cs(441,68): error CS1043: Invalid accessor body `=>', expecting `;' or `{'
1 Warning(s)
6 Error(s)
Is it even possible or do I definitely need to run Jenkins on a Windows machine?
It is possible. You can build C# project on Linux/Ubuntu. Try building using mono. When you will install mono package, one of the binaries that you will get will be xbuild. To build just invoke the following command:
xbuild <path to csproj/solution file>
Try building this manually first and then integrate with jenkins.

Unable to build application with "compile with .NET Native tool chain" option

First of all the biggest issue is that it seems I must use "compile with .NET Native tool chain" option. With out it I'm unable to pass verification with the following errors
◦API OpenSemaphore in api-ms-win-core-synch-l1-1-0.dll is not supported for this application type. System.Threading.dll calls this API.
◦API CreateSemaphore in api-ms-win-core-kernel32-legacy-l1-1-0.dll is not supported for this application type. System.Threading.dll calls this API.
◦API ExecuteAssembly in uwphost.dll is not supported for this application type. FileDownloader.exe calls this API.
◦API DllGetActivationFactory in uwphost.dll is not supported for this application type. FileDownloader.exe has an export that forwards to this API.
   I found on other forums that this errors usually happen because the application is build without "compile with .NET Native tool chain" option.
   Unfortunately, I cannot build with that option either because of the following error
C:\Program Files (x86)\MSBuild\Microsoft\.NetNative\x86\ilc\IlcInternals.targets(936,5): error : Internal compiler error: Unable to cast object of type 'Microsoft.Cci.Immutable.Vector' to type 'Microsoft.Cci.IGenericTypeInstance'.
   Does anybody know how to fix it?
Thank you
Alex

Categories

Resources