When I publish in .Net5 I get the following Errors
Severity Code Description Project File Line Suppression State
Error Assets file 'C:\Users\cornelis.dejager\source\repos\Marel.MSAWebServiceAPI\Marel.MSAWebServiceAPI\obj\publish\win-x86\project.assets.json' not found. Run a NuGet package restore to generate this file. Marel.MSAWebServiceAPI 0
and
Severity Code Description Project File Line Suppression State
Error Failed to retrieve information about 'Microsoft.WindowsDesktop.App.Runtime.win-x86' from remote source 'https://api.nuget.org/v3-flatcontainer/microsoft.windowsdesktop.app.runtime.win-x86/index.json'.
An error occurred while sending the request.
The request was aborted: Could not create SSL/TLS secure channel. Marel.MSAWebServiceAPI 0
What caused it:
Not sure to be honest. After I changed code it stopped working. The project has been fine for weeks now and suddenly it changed.
I have tried
Cleaned solution
Build/Re-Build Solution
Restore The Nuget Packages
Update Visual Studio
Rebuild All projects
Delete Bin & Object folders
Update all packages
Restarting Visual Studio + Computer
Created new publishing profile
install dotnet-WindowsDesktop
Reinstall .Net5 Runtimes
Run the command:
Additional Info
It builds and run fine. Only when I publish it seems to give me an error.
I really do not why publishing isn't working. I've looked at several places but have not found a solution to it yet.
It may happen from the wrong package source,
In Visual Studio go to
Options=> Nuget Package Manager=> Package Sources
if you are using a custom source make sure you have entered the address correctly.
NuGet default source address is https://api.nuget.org/v3/index.json
Related
After I import the files from another system to my system, I get the following error
Severity Code Description Project File Line Suppression State
Error NETSDK1005 Assets file 'C:\Users\user\Desktop\project1\project1\project1\obj\project.assets.json' doesn't have a target for 'net5.0'. Ensure that restore has run and that you have included 'net5.0' in the TargetFrameworks for your project. project1 C:\Program Files\dotnet\sdk\6.0.301\Sdks\Microsoft.NET.Sdk\targets\Microsoft.PackageDependencyResolution.targets 267
Update to Nuget 5.8 Clear the local cache
error NETSDK1005: Assets file 'project.assets.json' ....
Try updating NuGet.exe to the 5.8.0 version or above:
nuget update -self
if you prefer to update the nuget version in Visual Studio, just follow this steps. Then, clear NuGet cache:
dotnet nuget locals all --clear
reference
I have a Visual studio solution with several projects in it, specifically a DotNet5 asp.net app, that has several netstandard 2.0 references on it. it builds and runs fine in the debugger but continuously throws the metadata errors. It keeps specifically referencing its looking for a net5 folder in the netstandard2 project. I cannot find where its getting this from, the problematic one used to be a multitargeted project against framework 4.7, 4.8, and net5.0, but i got annoyed with the multiple dll's and just migrated it to standard2.0 and had no issues till i want to publish it.
I've tried what a few other questions referenced, cleaning, rebuilding, remove and re add references to other projects, deleted the obj and bin folders out of the solution, the removing the sou file, tried VS 2019 (16.9.0 preview 2) preview vs 2019 (16.8.3) release, different computer (pulled back down from a lan git repository) and got the same error.... also tried searching the entire solution for references to net5.0 and didn't find it outside of the expected locations like the csproj for the asp.net project and its respective pubxml. And just for fun, I temporarily retargeted the library project back to net5.0 and it still threw the same error even when the exact file and path listed did exist.
Using enters for the error below for the different columns in the error message, and removed the "sensitive" info. There is no error code provided by Visual Studio. Anyone else got any more ideas on what to try?
Error
Metadata file 'C:\Users\UserName\source\repos\Solution\Project 2\bin\Release\net5.0\ref\Project 2.dll' could not be found.
Project 1
CSC
0
Edit: adding a couple other sections of the error messages:
1/2/2021 7:38:55 PM
System.AggregateException: One or more errors occurred. ---> Microsoft.WebTools.Shared.Exceptions.WebToolsException: Build failed. Check the Output window for more details.
--- End of inner exception stack trace ---
---> (Inner Exception #0) Microsoft.WebTools.Shared.Exceptions.WebToolsException: Build failed. Check the Output window for more details.<---
Microsoft.WebTools.Shared.Exceptions.WebToolsException: Build failed. Check the Output window for more details.
===================
And the end of the output window since full thing is a bit too long. still can't figure out where its getting the net5.0 for the one project reference
/reference:C:\Users\UserName\.nuget\packages\system.xml.xpath.xmldocument\4.0.1\ref\netstandard1.3\System.Xml.XPath.XmlDocument.dll /reference:C:\Users\UserName\.nuget\packages\mysql.data\8.0.22\lib\net5.0\Ubiety.Dns.Core.dll /reference:"C:\Users\UserName\source\repos\CheckNotes\Project 3\bin\Release\netstandard2.0\Project 3.dll" /reference:"C:\Users\UserName\source\repos\CheckNotes\Project 2\bin\Release\net5.0\ref\Project 2.dll" /reference:C:\Users\UserName\source\repos\CheckNotes\Project 4\bin\Release\netstandard2.0\Project 4.dll /reference:"C:\Program Files\dotnet\packs\Microsoft.NETCore.App.Ref\5.0.0\ref\net5.0\WindowsBase.dll" /reference:C:\Users\UserName\.nuget\packages\mysql.data\8.0.22\lib\net5.0\Zstandard.Net.dll /debug+ /debug:portable /filealign:512 /optimize+ /out:"obj\Release\net5.0\CheckNotes Web - Core.dll" /refout:"obj\Release\net5.0\ref\CheckNotes Web - Core.dll" /target:exe /warnaserror- /utf8output /deterministic+ /langversion:9.0 /analyzerconfig:"obj\Release\net5.0\CheckNotes Web - Core.GeneratedMSBuildEditorConfig.editorconfig" /analyzerconfig:"C:\Program Files\dotnet\sdk\5.0.200-preview.20601.7\Sdks\Microsoft.NET.Sdk\analyzers\build\config\AnalysisLevel_5_Default.editorconfig" /analyzer:"C:\Program Files\dotnet\sdk\5.0.200-preview.20601.7\Sdks\Microsoft.NET.Sdk.Web\analyzers\cs\Microsoft.AspNetCore.Analyzers.dll" /analyzer:"C:\Program Files\dotnet\sdk\5.0.200-preview.20601.7\Sdks\Microsoft.NET.Sdk.Web\analyzers\cs\Microsoft.AspNetCore.Mvc.Analyzers.dll" /analyzer:"C:\Program Files\dotnet\sdk\5.0.200-preview.20601.7\Sdks\Microsoft.NET.Sdk.Web\analyzers\cs\Microsoft.AspNetCore.Components.Analyzers.dll" /analyzer:"C:\Program Files\dotnet\sdk\5.0.200-preview.20601.7\Sdks\Microsoft.NET.Sdk\targets\..\analyzers\Microsoft.CodeAnalysis.CSharp.NetAnalyzers.dll" /analyzer:"C:\Program Files\dotnet\sdk\5.0.200-preview.20601.7\Sdks\Microsoft.NET.Sdk\targets\..\analyzers\Microsoft.CodeAnalysis.NetAnalyzers.dll" Controllers\AssemblyController.cs Controllers\CheckNotesController.cs Controllers\ContactsController.cs Controllers\CustomerController.cs Controllers\HomeController.cs Controllers\ImageController.cs Controllers\OperatorPagesController.cs Controllers\PalletsController.cs Controllers\SharedController.cs Controllers\StatisticsController.cs Models\ControllerClass\ctrlrAssembly.cs Models\ControllerClass\CtrlrCheckNotes.cs Models\ControllerClass\ctrlrContacts.cs Models\ControllerClass\CtrlrCustomer.cs Models\ControllerClass\CtrlrOperatorPages.cs Models\ControllerClass\CtrlrPallet.cs Models\ControllerClass\ctrlrStats.cs Models\DataClass\AppSettings.cs Models\ErrorViewModel.cs Models\renderAction.cs Program.cs Startup.cs "obj\Release\net5.0\.NETCoreApp,Version=v5.0.AssemblyAttributes.cs" "obj\Release\net5.0\CheckNotes Web - Core.AssemblyInfo.cs" "obj\Release\net5.0\CheckNotes Web - Core.RazorAssemblyInfo.cs" /warnaserror+:NU1605
CSC(0,0): Error CS0006: Metadata file 'C:\Users\UserName\source\repos\CheckNotes\Project 2\bin\Release\net5.0\ref\Project 2.dll' could not be found
10>Build failed. Check the Output window for more details.
========== Build: 9 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========
========== Publish: 0 succeeded, 1 failed, 0 skipped ==========
Got it to publish but I am so confused....something to do with the publish profile. If i delete that and generate a new one, works fine. as soon as i edit it using the GUI, broken....generate it again. So far seems ok to edit it manually but TBD. not sure if the "fix" will survive restarting Visual studio or not.
Edit - Scratch that, found the difference.
Remove the following line in Properties/FolderProfile.pubxml and it's fine.
<TargetFramework>net5.0</TargetFramework>
I am trying to publish web application as using a deployment package and while publish I'm getting the below error. Tried with different ways to resolve like update the JSON reference and … etc.
DLL is available, but no luck
Error :
Severity Code Description Project File Line Suppression State
Error Copying file packages\Newtonsoft.Json.11.0.1\lib\portable-net40+sl5+win8+wp8+wpa81\Newtonsoft.Json.dll to C:\Users\abc\AppData\Local\Temp\WebSitePublish\xyzwebapplication-150487496\obj\Debug\Package\PackageTmp\packages\Newtonsoft.Json.11.0.1\lib\portable-net40+sl5+win8+wp8+wpa81\Newtonsoft.Json.dll failed. Could not find a part of the path 'packages\Newtonsoft.Json.11.0.1\lib\portable-net40+sl5+win8+wp8+wpa81\Newtonsoft.Json.dll'. xyzwebapplication 0
This Has been solved After I did remove the unwanted packages from the solution.
Remove packages and clean solution ,rebuild followed by publish.
Project-->Packages-->remove
The folders like "Json" etc..
It was success
Can anyone help me fix this error? I am working on a project in ASP.NET MVC
Warning 1 The file '..\ProjectX.Data.CF\DbContextDatabase.cs' could not be added to the project. Cannot add a link to the file C:\Anže\Programi\ProjectXService\ProjectX.Data.CF\DbContextDatabase.cs. This file is within the project directory tree. ProjectX.Data.CF
Error 2 The system cannot find the path specified. WebPortal (WebPortal\WebPortal)
Error 3 The command ""C:\Anže\Programi\ProjectXService.nuget\NuGet.exe" install "C:\Anže\Programi\ProjectXService\WebPortal\packages.config" -source "" -NonInteractive -RequireConsent -solutionDir "C:\Anže\Programi\ProjectXService\ "" exited with code 3. WebPortal (WebPortal\WebPortal)
I tried:
clearing package cache
Allow NuGet to download missing packages during build" is checked.
clean solution
Something has got to be wrong with the database because I cannot run old "working" version of a project too.
EDIT:
I tried deleting database using the answer here:
How to re-create database for Entity Framework?
but I stopped at step 6 because I cannot run commands in PackageManagerConsole - it needs build, but I cannot build the project because of this error
Check your registry in this location:
HKEY_CURRENT_USER\Software\Microsoft\Command Processor
There could be an AutoRun key for something called ansicon - removing that could fix your problem.
I have a solution which has a two projects. In the both the projects I have packages.config file which has the list of packages that the project uses. Whenever I build the solution I'm getting the below error
The command "*\Tools\nuget install \packages.config -o \Packages" exited with code 3.**
(replaced folder path with **)
I have installed all the packages manually using package manager console. The installation is successful. When I build the solution now i'm getting the below error
The command "*\Tools\nuget install \packages.config -o \Packages" exited with code 1.**
I have cleared the cache of packages. Still I get this error. Not sure why the solution build is trying to install the packages.
You can try adding -verbosity detailed to your command *\Tools\nuget install \packages.config -o \Packages to get detailed error message to help you investigate the cause.
This was happening in a new CI build I set up yesterday. The problem was that NuGet.exe wasn't at the specified path.
"exited with code 3." wasn't an error from NuGet.exe but from MSBuild.
If you were using TFS, be sure to include the location of the Nuget package in the Source Settings of build definition. This error can indicate it cannot access the files.