Unable to find fallback package folder - asp.net

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.

Related

getting No certificate found with the supplied thumbprint error in Xamarin project

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]

Unable to add NuGet packages

I have started a new sample .NET Core 3.1 project to use Gremlin.NET to connect to CosmosDB Graph API and can't seem to get the Gremlin.NET package installed. The problem is when I run dotnet add package Gremlin.NET, I get the following output:
Writing C:\Users\xxx\AppData\Local\Temp\tmp343B.tmp
info : Adding PackageReference for package 'Gremlin.NET' into project 'C:\opt\Source\...\gremlin-spike\gremlin-spike.csproj'.
info : Restoring packages for C:\opt\Source\...\gremlin-spike\gremlin-spike.csproj...
error: The local source 'C:\Program Files\Microsoft SDKs\Service Fabric\packages\' doesn't exist.
The problem is the last line where it is attempting save package into the Service Fabric packages directory, but I no longer have Service Fabric installed and the directory no longer exists. I have looked at all the nuget.config files I can find and none of them have a package source pointing to that directory. How do I reset .NET Core to use the default packages folder location instead of this value?
Create an empty folder here:
C:\Program Files\Microsoft SDKs\Service Fabric\packages

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.

My .cshtml page does not open

I am getting this error could not load file or assembly
microsoft.visualstudio.projectsystem.dotnet.14.0
version=14.0.0.0,culture=neutral,,public key token=b03f5f7f11a3a
or one of it's dependancies.the system cannot find the file specified.
Check the version of microsoft.visualstudio.projectsystem.dotnet in packages.config and see if it is different then the version of your DLL. If the problem still persists, run the code
update-package -reinstall
in your Package Manager Console.
Let me know for further problems regarding this.

Mono's XSP webserver can't find MySql.Web.dll on Linux

I'm working on getting my ASP.Net project working on Linux. I've been testing my code using XSP on windows, but now I am trying to make sure that I can develop and test on Linux as well. To that end I've gotten Ubuntu running and have MonoDevelop and MySQL running. I've downloaded the latest MySQL Connector/Net and I think I have it installed correctly.
There is no package that will automatically install the MySQL Connector/Net for distribution so I downloaded the 6.2.3 zip file from the MySQL website. Now I've already discovered the issue with case sensitivity because the zip file contains filenames in lowercase, and Mono expects them in uppercase. So I've changed the names of the files to MySql.Data.dll, and MySql.Web.dll respectively. I've also used gacutil to install both files to the GAC. Likewise I have added the files to the Mono Lib directory. The following files do exist on my machine:
/usr/lib/mono/gac/MySql.Data/6.2.3.0__c5687fc88969c44d/MySql.Data.dll
/usr/lib/mono/gac/MySql.Web/6.2.3.0__c5687fc88969c44d/MySql.Web.dll
/usr/lib/mono/2.0/MySql.Data.dll
/usr/lib/mono/2.0/MySql.Web.dll
I've also created package files so that I can add references to the the assemblies in MonoDevelop. The folder /usr/lib/mono/2.0 contains two .pc files that I added.
MySql.Web.pc:
Name: MySql.Web
Description: ASP Membership, Role and Profile providers powered by MySQL
Version: 6.2.3
Libs: -r:/usr/lib/mono/gac/MySql.Web/6.2.3.0__c5687fc88969c44d/MySql.Web.dll
MySql.Data.pc:
Name: MySql.Data
Description: Provides connectivity to MySQL databases
Version: 6.2.3
Libs: -r:/usr/lib/mono/gac/MySql.Data/6.2.3.0__c5687fc88969c44d/MySql.Data.dll
At this point I can use the assemblies in projects inside MonoDevelop. The Assemblies appear in the list of available assemblies when I edit the project references. The project now compiles without error inside MonoDevelop. However when I run the compiled web project in XSP the following error is displayed in the browser:
System.IO.FileNotFoundException: Could not load file or assembly 'MySql.Web.dll, Version=6.2.3.0, Culture=neutral, PublicKeyToken=C5687FC88969C44D' or one of its dependencies. The system cannot find the file specified.
What is fustrating is that originally the error was that it could not load MySql.Data.dll and now the error message is that it can not load MySql.Web.dll. Which means that I somehow fixed the problem I was having with the Data dll, and now I have the problem with the Web dll. I have gone and re-done I learned to fix the problem for the Data dll, but I am unable to get the Web dll working.
Unfortunately I'm still pretty new to Linux and Mono (but not to ASP.Net) and I've run out of things to try. Likewise I haven't found anything on Google to try other than what has been described above which leaves me asking for help.
Can anyone help me find out why XSP can't find the assembly and what I can do about it?
Thanks,
-Will
You can try setting some environment variables which should tell you where all Mono is looking for assemblies:
MONO_LOG_LEVEL="debug" MONO_LOG_MASK="dll" xsp2
Not a perfect fix (I don't know why its going wrong), but if you're in a hurry, copy MySql.Web.dll to the bin directory of your app.

Resources