getting No certificate found with the supplied thumbprint error in Xamarin project - xamarin.forms

I am creating a pipeline to Build a XAMARIN project.
The project compiles on my desktop but I am having trouble compiling it in classic DevOps. The project is under Team Foundation Version Control Repos.
I have followed the example in this link: https://yanxiaodi.medium.com/using-azure-devops-build-pipeline-for-xamarin-forms-436ddc6bcf97
I added the pfx file (created today, expires in a year) to the library Secure files and the pipeline successfully downloads the file. It seems to copy the file to right place because i do not get an error the file is missing. However, I do get the error shown below.
The thumbprint shown is the one that is in the secure file.
what am i doing wrong?
##[error]C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\VisualStudio\v17.0\AppxPackage\Microsoft.AppXPackage.Targets(854,5): Error : No certificate found with the supplied thumbprint: 738D7BBE2C2D55EA43D65CA94224E76296C10F1
C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\VisualStudio\v17.0\AppxPackage\Microsoft.AppXPackage.Targets(854,5): error : No certificate found with the supplied thumbprint: 738D7BBE2C2D55EA943D65CA4224E76296C10F1 [D:\a\9\s\App1.UWP\MyProgram.UWP.csproj]

Related

Unable to find fallback package folder

When I run the ASP.NET project, got the following error.
C:\Program Files\dotnet\sdk\7.0.102\Sdks\Microsoft.NET.Sdk\targets\Microsoft.PackageDependencyResolution.targets(267,5): error MSB4018: NuGet.Packaging.Core.PackagingException: Unable to find fallback package folder 'C:\Program Files (x86)\Microsoft\Xamarin\NuGet'.
Try creating a folder at the location it is asking for, i.e., 'C:\Program Files (x86)\Microsoft\Xamarin\NuGet'. For example, I added a blank folder here: C:\Users\USERNAME\NuGetRepository and got passed an error very similar to this.
I have no idea why this works (yet) but I no longer get the error message: The "ResolvePackageAssets" task failed unexpectedly Unable to find fallback package folder C:\Users\USERNAME\NuGetRepository (where username is my Windows username) when trying to Build a simple C# .Net 7 project that a colleague gave me.

Azure websites deployment fail - found conflicts between different versions of the same dependent assembly

My azure websites deployment is failing. Everything is working fine on my local machine: I can't see any problems or conflicts when log verbosity is set to detailed in Visual Studio's output window.
But I can't figure out how to see logs and fix the following error in Kudu when trying to deploy to Azure:
Command: "D:\home\site\deployments\tools\deploy.cmd"
Handling .NET Web Application deployment.
MSBuild auto-detection: using msbuild version '14.0' from 'D:\Program Files (x86)\MSBuild\14.0\bin\amd64'.
All packages listed in packages.config are already installed.
MyProject.Broadbean -> D:\home\site\repository\MyProject.Broadbean\bin\Release\MyProject.Broadbean.dll
MyProject.Domain -> D:\home\site\repository\MyProject.Domain\bin\Release\MyProject.Domain.dll
MyProject.Mandrill -> D:\home\site\repository\Mandrill\bin\Release\MyProject.Mandrill.dll
D:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets(1819,5): warning MSB3277: Found conflicts between different versions of the same dependent assembly that could not be resolved. These reference conflicts are listed in the build log when log verbosity is set to detailed. [D:\home\site\repository\MyProject.WebUI\MyProject.WebUI.csproj]
D:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\TypeScript\Microsoft.TypeScript.targets(242,5): warning : No compiler log specified, 'Clean' won't work. [D:\home\site\repository\MyProject.WebUI\MyProject.WebUI.csproj]
CSC : error CS1703: Multiple assemblies with equivalent identity have been imported: 'D:\home\site\repository\packages\System.Xml.ReaderWriter.4.3.1\lib\net46\System.Xml.ReaderWriter.dll' and 'D:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.6.1\Facades\System.Xml.ReaderWriter.dll'. Remove one of the duplicate references. [D:\home\site\repository\MyProject.WebUI\MyProject.WebUI.csproj]
CSC : error CS1703: Multiple assemblies with equivalent identity have been imported: 'D:\home\site\repository\packages\System.ComponentModel.Annotations.4.5.0\lib\net461\System.ComponentModel.Annotations.dll' and 'D:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.6.1\Facades\System.ComponentModel.Annotations.dll'. Remove one of the duplicate references. [D:\home\site\repository\MyProject.WebUI\MyProject.WebUI.csproj]
Failed exitCode=1, command="D:\Program Files (x86)\MSBuild\14.0\Bin\MSBuild.exe" "D:\home\site\repository\MyProject.WebUI\MyProject.WebUI.csproj" /nologo /verbosity:m /t:Build /t:pipelinePreDeployCopyAllFilesToOneFolder /p:_PackageTempDir="D:\local\Temp\8d69b9dee0afc5a";AutoParameterizationWebConfigConnectionStrings=false;Configuration=Release;UseSharedCompilation=false /p:SolutionDir="D:\home\site\repository.\"
An error has occurred during web site deployment.
\r\nD:\Program Files (x86)\SiteExtensions\Kudu\79.20129.3767\bin\Scripts\starter.cmd "D:\home\site\deployments\tools\deploy.cmd"
How do I see this build log in Kudu or the Azure websites environment and fix these errors? I'm obviously missing something. The background is that I updated a lot of nuget packages, the site now breaks on deployment, and I can't quite figure out how to fix it.
To fix the "Multiple assemblies with equivalent identity have been imported. Remove one of the duplicate references." error, I removed the references for those assemblies.
That allowed me to deploy. But on deployment I got error screens because of conflicts between different assemblies.
To fix the "Found conflicts between different versions of the same dependent assembly that could not be resolved." conflicts, I removed the binding redirects for problematic assemblies in the web.config file.
What it is trying to say that
.net framework itself has System.Xml.ReaderWriter.dll so you don't have add it separately.
Please remove any reference of System.Xml.ReaderWriter.dll from your project .
similarly you have to do it for other assemblies .
Please debug you deploy.cmd using log in every steps which you think could cause build failure.
It seems that due to nuget update in your project, you have conflicts between different versions of the same dependent assembly. Please look at the assemblies you have upgraded and check their compatibility in your project.
I believe you must be running your build using some build agent, if you have access to the build agent and log in to the VM and try to debug your cmd file.
Also, please replicate and install the same environment in your Agent VM as you have it in your local, most of the time , this is the reason of build failure.
Hope it helps.

Error when publishing Migrated ASP.Net web application with framework 4.6.2

We have a requirement to migrated the ASP .Net web app from .Net framework 3.5 to 4.6.2. I have migrated the application to frame work 4.6.2 and able to run the application.
problem comes here when publishing the code. I am getting an error:
Copying file obj\Debug\Project.dll to obj\Release\Package\PackageTmp\obj\Debug\Project.dll failed
in migrated (frame work 4.6.2) code, however i don't see any error when publishing the old code(frame work 3.5).
i have tried many things:
delete the Obj folder from the solution
ran msbuild.exe command to publish (custom msbuild xml)
restarted the IDE(VS2015)
restarted machine
What else should i do?
Error
When tried from VS : Publish
Error Copying file obj\Debug\Project.dll to obj\Release\Package\PackageTmp\obj\Debug\Project.dll failed. Could not find file 'obj\Debug\Project.dll'
When tried from custom msbuild
Build FAILED.
"\Build1.xml" (default target) (1) ->
"project.csproj" (default target) (2) ->
(_CopyWebApplicationLegacy target) ->
C:\Program Files\MSBuild\Microsoft\VisualStudio\v14.0\WebApplications\Microso
ft.WebApplication.targets(182,5): error MSB3030: Could not copy the file "js\id
le-timer.js" because it was not found.
C:\Program Files\MSBuild\Microsoft\VisualStudio\v14.0\WebApplications\Microso
ft.WebApplication.targets(182,5): error MSB3030: Could not copy the file "js\jq
uery-idleTimeout-iframes.min.js" because it was not found.
0 Warning(s)
2 Error(s)
Here are the steps i followed to solve this issue
Upgrade all the dll's (non solution dll's) with nuget package manager along with the solution migration from 3.5 to 4.6.2 framework.
Remove un-used dll's from the project
rebuild and publish!!
My issue resolved after following the above steps.
Thanks

sqllite3.dll issues with UWP app development for Mobile

I am trying to learn how to develop apps for UWP for both Desktop and Mobile. I have been currently working on getting the Entity Framework working in my app to store application state and followed the following link:
https://learn.microsoft.com/en-us/ef/core/get-started/uwp/getting-started
It worked well for Desktop, the issue however is that when I try to run it on the Windows Mobile emulator I get the following error in debug mode when the code reaches the db.Database.Migrate() step:
Unable to load DLL 'sqlite3': The specified module could not be found
In the link I pasted above, someone else had the same issue and in the comments they recommended to try the following:
Step 1: Install SQLite VSIX pacakge for Universal Windows Platform development using Visual Studio 2015
https://www.sqlite.org/2016/sqlite-uwp-3130000.vsix
Step 2: Install NuGet package SQLite.NET-PCL
Install-Package SQLite.NET-PCL
Step 3: Add references
Add Reference -> Universal Windows ->Extensions -> Make sure the following packages have been checked: "SQLite for Universal Windows Platform" "Visual C++ 2015 Runtime for Universal Windows Platform Apps"
After that, if you get the error "Payload contains two or more files with the same destination path 'sqlite3.dll', do the following:
copy sqlite3.dll from
C:\Program Files (x86)\Microsoft SDKs\UAP\v0.8.0.0\ExtensionSDKs\SQLite.UAP.2015\3.8.11.1\Redist\Debug\ARM\sqlite3.dll
past to (override it)
C:\Users\%USERNAME%\.nuget\packages\SQLitePCL.raw_basic\0.7.1\build\native\sqlite3_dynamic\winrt81\arm\sqlite3.dll
The problem after doing those steps is that I am now seeing the issue when doing a build for "Payload contains two or more files" however not in the SQLitePCL.raw_basic directory (I don't even seem that have that). Instead my error is the following:
Payload contains two or more files with the same destination path 'sqlite3.dll'. Source files:
C:\Users\admin\.nuget\packages\SQLite\3.13.0\runtimes\win7-x86\native\sqlite3.dll
C:\Program Files (x86)\Microsoft SDKs\UAP\v0.8.0.0\ExtensionSDKs\SQLite.UWP.2015\3.13.0\Redist\Debug\x86\sqlite3.dll
I have been searching everywhere and am truly stumped as to how to get my UWP program working on Mobile. Thanks a lot for your help!
It seems like you got the solution for resolving the exception The specified module could not be found from #Leandro_Medeiros_Machado 's comment on this document. If you got the Payload contains two or more files with the same destination path 'sqlite3.dll' exception after you done the above three steps you may be also found the next solution from the comment.
After that, if you get the error "Payload contains two or more files with the same destination path 'sqlite3.dll', do the following:copy sqlite3.dll from
C:\Program Files (x86)\Microsoft SDKs\UAP\v0.8.0.0\ExtensionSDKs\SQLite.UAP.2015\3.8.11.1\Redist\Debug\ARM\sqlite3.dll
past to (override it)
C:\Users\%USERNAME%\.nuget\packages\SQLitePCL.raw_basic\0.7.1\build\native\sqlite3_dynamic\winrt81\arm\sqlite3.dll
For you, you may need to copy from
C:\Program Files (x86)\Microsoft SDKs\UAP\v0.8.0.0\ExtensionSDKs\SQLite.UWP.2015\3.13.0\Redist\Debug\x86\sqlite3.dll to(override) C:\Users\admin\.nuget\packages\SQLite\3.13.0\runtimes\win7-x86\native\sqlite3.dll.
But actually, for using EF core you don't need the above steps and I recommend you check your environment instead of using the above workaround. I created a simple EF project by following the document and without install the VSIX I can run successfully on the emulator (build 10586). My VS build is 2015 update 3, my OS version is build 14393 and the EF core version is Microsoft.EntityFrameworkCore.Sqlite 1.1.0. So please firstly check if your environment met the following requirements:
Windows 10
Visual Studio 2015 Update 3
The latest version of Windows 10 Developer Tools
And if your EF core and EF core tools versions are right.

"Illegal characters in path" error when building UWP project with SQLite extension on VSTS Hosted agent

When using a Hosted agent to build my UWP application on VSTS I'm getting an error:
_GenerateAppxSymbolPackage:
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\AppxPackage\PDBCopy.exe C:\a\1\s\App\MyApp\bin\ARM\Debug\MyApp.pdb obj\ARM\Debug\Stripped\MyApp.pdb
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\AppxPackage\PDBCopy.exe C:\a\1\s\App\Extensions\UAP\v0.8.0.0\ExtensionSDKs\SQLite.UWP.2015\3.11.1\Redist\Debug\ARM\sqlite3.pdb obj\ARM\Debug\Stripped\sqlite3.pdb
##[error]C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\AppxPackage\Microsoft.AppXPackage.Targets(2550,5): Error APPX0002: Task 'GenerateAppxSymbolPackage' failed. Illegal characters in path.
My build definition runs for app solution file against VS15 with params:
/p:AppxBundlePlatforms="$(BuildPlatform)" /p:AppxPackageDir="$(Build.BinariesDirectory)\AppxPackages\" /p:AppxBundle=Always /p:UapAppxPackageBuildMode=CI
Everything else is default UWP build definition configuration on VSTS.
Note: my CI build for the same project builds successfully. The only difference there is the lack of /p:UapAppxPackageBuildMode=CI flag.
Any ideas / hints on what might be wrong with those paths? Or is it some bug in VSTS?
The MSBuild Arguments should be like:
/p:AppxBundlePlatforms="$(BuildPlatform)" /p:AppxPackageDir="$(Build.BinariesDirectory)\AppxPackages\\" /p:AppxBundle=Always
There is a \\ after AppxPackages, not \ .
Deleting everything except .git folder and then doing hard reset helped.

Resources