Содержание
- error NU1101: Unable to find package — Azure DevOps (Private Nuget) #8132
- Comments
- Environment
- Detailed repro steps so we can see the same problem
- Nuget restore details
- Error log
- error NU1101: Unable to find package Microsoft.NET.Sdk.Functions. #1345
- Comments
- Error nu1101 unable to find package
- Вопрос
- Все ответы
- Error nu1101 unable to find package
- Asked by:
- Question
- All replies
- error: NU1101: Unable to find package runtime.win-x86.Microsoft.DotNet.ILCompiler #630
- Comments
error NU1101: Unable to find package — Azure DevOps (Private Nuget) #8132
Environment
VS version (if appropriate): 2017 or 2019
OS version : Hosted Ubuntu 1604
Environment: Azure Devops Build Pipeline
Detailed repro steps so we can see the same problem
- Create a new ASP.NET Core Web Application
- Under Nuget Package Manager add a «Package Source» that point to my private source.
- Install the nuget package from your source.
- Add docker support to the project. (Rick click project, Add, Docker Support). Edit the Dockerfile.
`FROM mcr.microsoft.com/dotnet/core/aspnet:2.2-stretch-slim AS base
WORKDIR /app
FROM mcr.microsoft.com/dotnet/core/sdk:2.2-stretch AS build
WORKDIR /src
COPY . .
COPY *.csproj ./
COPY nuget.config /
RUN dotnet restore
COPY . .
WORKDIR «/src»
RUN dotnet build «TestPipeline.csproj» -c Release -o /app
FROM build AS publish
RUN dotnet publish «TestPipeline.csproj» -c Release -o /app
FROM base AS final
WORKDIR /app
COPY —from=publish /app .
ENTRYPOINT [«dotnet», «TestPipeline.dll»]`
- Upload to Azure git Repo.
- Create a Build pipeline with the following steps.
6.1 Nuget Installer
6.2 Nuget restore (This is successfull and restore packages. I added a Connect Feed for my Nuget package)
6.3 Commandline task that does docker build -t testpipeline ./TestPipeline - Queue a build
Nuget restore details
============================================================================== Task : NuGet Description : Restore, pack, or push NuGet packages, or run a NuGet command. Supports NuGet.org and authenticated feeds like Package Management and MyGet. Uses NuGet.exe and works with .NET Framework apps. For .NET Core and .NET Standard apps, use the .NET Core task. Version : 2.151.0 Author : Microsoft Corporation Help : [More Information](https://go.microsoft.com/fwlink/?LinkID=613747) ==============================================================================
`NuGet Config files used:
/home/vsts/work/1/Nuget/tempNuGet_264.config
Installed:
60 package(s) to /home/vsts/work/1/s/TestPipeline/TestPipeline.csproj
##[section]Finishing: NuGet restore`
Error log
Step 9/18 : RUN dotnet restore #»TestPipeline/TestPipeline.csproj» —> Running in 0843de55d156 /src/TestPipeline.csproj : error NU1101: Unable to find package Company.Connect.Shared.Logging. No packages exist with this id in source(s): nuget.org Restore failed in 1.5 sec for /src/TestPipeline.csproj. The command ‘/bin/sh -c dotnet restore #»TestPipeline/TestPipeline.csproj»‘ returned a non-zero code: 1 ##[error]Bash exited with code ‘1’. ##[section]Finishing: Build Docker Image
The text was updated successfully, but these errors were encountered:
From your error log, I see:
No packages exist with this id in source(s): nuget.org
which means that the nuget.config file that was copied into your docker image did not contain your private feed. When you use Azure DevOps to do a NuGet restore and tell it to use your private feed, it creates a temporary nuget.config file and uses that, as you can see in the other log:
NuGet Config files used:
/home/vsts/work/1/Nuget/tempNuGet_264.config
At the beginning of your repro steps, you said you added your private feed as a package source in Visual Studio, however, Visual Studio’s NuGet sources list edits your user profile’s nuget.config , which means those settings don’t apply to other users on the same computer or any other computer. It does apply to all solutions on your machine when run as your user account. You should manually create a nuget.config in your repo, either at the root or in the same directory as your .sln file and add your private source there if you want it to apply to all machines that clone your repo. However, if the nuget.config that is copied into the docker image doesn’t contain authentication information for the private feed (the temporary nuget.config file that Azure DevOps created), restoring within the image will likely fail with an unauthorized error.
There is already work planned to improve NuGet hierarchical config management in Visual Studio, but for now you need to do it manually. That won’t solve the authentication issues inside docker contains/images though.
Thanks, I will try manually creating the nuget.config. We are using a Linux container, but I found a solution for Windows containers. If I add a Visual Studio Build task before my Docker build task (Not doing a dotnet restore as part of the docker build task), it works
- task: VSBuild@1
displayName: ‘Build solution TestPipeline.sln’
inputs:
solution: TestPipeline.sln
msbuildArchitecture: x64`
I have tried various ways of using a nuget.config file. I have a custom nuget step that populate the authorization credentials.
sources update -Name «ConnectFeed» -Username «vsts» -Password «$(System.AccessToken)» -StorePasswordInClearText -ConfigFile ./TestPipeline/nuget.config
Then step runs fine
But then on the RUN dotnet restore I still get the same error
Источник
error NU1101: Unable to find package Microsoft.NET.Sdk.Functions. #1345
Repro steps:
All done via Windows Powershell
Followed these instructions for installation for Azure Functions:
https://docs.microsoft.com/en-us/azure/azure-functions/functions-run-local
1.Initialise new Azure Function with command func init
2.Create new function with func new command
3. Select HttpTrigger option
4. Give it a name e.g. test
- open project in VS code (v. 1.35.1)
- press F5 to debug
I get the following error:
error NU1101: Unable to find package Microsoft.NET.Sdk.Functions. No packages exist with this id in source(s): Microsoft Visual Studio Offline Packages
Tried to restore by clicking on the popup stating
«There are unresolved dependencies. Please execute the restore command to continue»
I get this error.:
_ error NU1101: Unable to find package Microsoft.NET.Sdk.Functions. No packages exist with this id in source(s): Microsoft Visual Studio Offline Packages_
Action: azureFunctions.pickProcess
Error type: Error
Error Message: Failed to start debugging. Task «build» failed with exit code «1».
Version: 0.17.1
OS: win32
Product: Visual Studio Code
Product Version: 1.35.1
Language: en
The text was updated successfully, but these errors were encountered:
Источник
Error nu1101 unable to find package
Вопрос
Help me please to fix it.
«Severity Code Description Project File Line Suppression State
Error NU1101 Unable to find package System.Numerics.Vectors. No packages exist with this id in source(s): Microsoft Visual Studio Offline Packages SimpleApp D:DownloadXAMARINSimpleAppSimpleAppSimpleApp.csproj 1 »
Все ответы
Welcome to the MSDN forum.
This error usually shown the package cannot be found on any sources.
The solution 1: Examine the project’s dependencies in Visual Studio to be sure you’re using the correct package identifier and version number. Also check that the NuGet configuration identifies the package sources you are expected to be using.
The solution 2: In Visual Studio go to Tools -> NuGet Package Manager -> Package Manager Settings . Here select the Package Sources tab in the tree on the left. You should see the following:
Источник
Error nu1101 unable to find package
This forum has migrated to Microsoft Q&A. Visit Microsoft Q&A to post new questions.
Asked by:
Question
Help me please to fix it.
«Severity Code Description Project File Line Suppression State
Error NU1101 Unable to find package System.Numerics.Vectors. No packages exist with this id in source(s): Microsoft Visual Studio Offline Packages SimpleApp D:DownloadXAMARINSimpleAppSimpleAppSimpleApp.csproj 1 »
Welcome to the MSDN forum.
This error usually shown the package cannot be found on any sources.
The solution 1: Examine the project’s dependencies in Visual Studio to be sure you’re using the correct package identifier and version number. Also check that the NuGet configuration identifies the package sources you are expected to be using.
The solution 2: In Visual Studio go to Tools -> NuGet Package Manager -> Package Manager Settings . Here select the Package Sources tab in the tree on the left. You should see the following:
Источник
error: NU1101: Unable to find package runtime.win-x86.Microsoft.DotNet.ILCompiler #630
Hello,
I am trying to build x86 and x64 version of the sample library, but I am getting the Nuget error in the title because can’t find the relative package:
info : GET https://pkgs.dev.azure.com/dnceng/9ee6d478-d288-47f7-aacc-f6e6d082ae6d/_packaging/fe324174-469a-4296-a9cb-1fd885bb6f2b/nuget/v3/flat2/runtime.win-x64.microsoft.dotnet.ilcompiler/6.0.0-preview.2.21103.1/runtime.win-x64.microsoft.dotnet.ilcompiler.6.0.0-preview.2.21103.1.nupkg info : NotFound https://api.nuget.org/v3-flatcontainer/runtime.win-x64.microsoft.dotnet.ilcompiler/index.json 515ms info : NotFound https://api.nuget.org/v3-flatcontainer/runtime.win-x86.microsoft.dotnet.ilcompiler/index.json 587ms info : NotFound https://pkgs.dev.azure.com/dnceng/9ee6d478-d288-47f7-aacc-f6e6d082ae6d/_packaging/fe324174-469a-4296-a9cb-1fd885bb6f2b/nuget/v3/flat2/runtime.win-x86.microsoft.dotnet.ilcompiler/index.json 674ms info : OK https://pkgs.dev.azure.com/dnceng/9ee6d478-d288-47f7-aacc-f6e6d082ae6d/_packaging/fe324174-469a-4296-a9cb-1fd885bb6f2b/nuget/v3/flat2/runtime.win-x64.microsoft.dotnet.ilcompiler/6.0.0-preview.2.21103.1/runtime.win-x64.microsoft.dotnet.ilcompiler.6.0.0-preview.2.21103.1.nupkg 1571ms info : Installing runtime.win-x64.Microsoft.DotNet.ILCompiler 6.0.0-preview.2.21103.1.
error: NU1101: Unable to find package runtime.win-x86.Microsoft.DotNet.ILCompiler. No packages exist with this id in source(s): dotnet-experimental, nuget
I followed the instructions in the readme, but I am not sure if they refer to old and obsolete source/packages:
nuget.config
dotnet add package Microsoft.DotNet.ILCompiler -v 6.0.0-*
I am also wondering if it is possible to do everything inside VS without being forced to open the shell just like happens with regular NuGet packages.
Thanks
The text was updated successfully, but these errors were encountered:
Источник
#asp.net-core #.net-core #nuget #nuget-package-restore #dotnet-cli
Вопрос:
Я опубликовал пакет NuGet (BuildingBlocks) для пакетов Github. Я использую файл nuget.config для указания источников nuget для моего проекта, а также учетных данных для моего пакета (учетные данные специально заменены заполнителями).:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<!--To inherit the global NuGet package sources remove the <clear/> line below -->
<clear />
<add key="nuget" value="https://api.nuget.org/v3/index.json" />
<add key="github" value="https://nuget.pkg.github.com/<username>/index.json" />
</packageSources>
<packageSourceCredentials>
<github>
<add key="Username" value="<username>" />
<add key="ClearTextPassword" value="<password>" />
</github>
</packageSourceCredentials>
</configuration>
Когда я запускаю восстановление dotnet локально на своей машине Fedora, это работает нормально. Но когда я пытаюсь восстановить пакеты в контейнере Docker, полученном из mcr.microsoft.com/dotnet/sdk
образа, восстановление завершается со следующими ошибками:
Determining projects to restore...
/app/src/DocumentService.Application/DocumentService.Application.csproj : error NU1101: Unable to find package BuildingBlocks.Annotations. No packages exist with this id in source(s): github, nuget
/app/src/DocumentService.Application/DocumentService.Application.csproj : error NU1101: Unable to find package BuildingBlocks.Localization. No packages exist with this id in source(s): github, nuget
/app/src/DocumentService.Application/DocumentService.Application.csproj : error NU1101: Unable to find package BuildingBlocks.IoC. No packages exist with this id in source(s): github, nuget
/app/src/DocumentService.Application/DocumentService.Application.csproj : error NU1101: Unable to find package BuildingBlocks.Nullability. No packages exist with this id in source(s): github, nuget
/app/src/DocumentService.Application/DocumentService.Application.csproj : error NU1101: Unable to find package BuildingBlocks.Domain. No packages exist with this id in source(s): github, nuget
/app/src/DocumentService.Application/DocumentService.Application.csproj : error NU1101: Unable to find package BuildingBlocks.Commands. No packages exist with this id in source(s): github, nuget
/app/src/DocumentService.Application/DocumentService.Application.csproj : error NU1101: Unable to find package BuildingBlocks.Option. No packages exist with this id in source(s): github, nuget
/app/src/DocumentService.Application/DocumentService.Application.csproj : error NU1101: Unable to find package BuildingBlocks.Queries. No packages exist with this id in source(s): github, nuget
В моем пакете BuildingBlocks нет пространства имен, такого как Аннотации и локализация, поэтому я не знаю, почему CLI dotnet записывает их в выходные данные. У кого-нибудь есть идеи о том, как это решить или почему это происходит?
Ответ №1:
добавьте следующие строки в свой файл Dockerfile
COPY nuget.config .
RUN dotnet restore --configfile nuget.config
Ответ №2:
Я предполагаю, что ваш пакет BuildingBlocks определен в ленте пакетов GitHub. Если это так, то это противоречит уже существующему пакету в https://www.nuget.org/packages/BuildingBlocks. К сожалению, NuGet не имеет детерминированного поведения при разрешении пакетов, и в файле NuGet.config указано несколько каналов. Причина фактических ошибок заключается в том, что пакет BuildingBlocks в nuget.org имеет зависимости от тех других пакетов, перечисленных в ошибках, которые не были опубликованы в nuget.org.
Самый простой способ решить эту проблему-переименовать пакет, чтобы он не конфликтовал с именем пакета, существующим в nuget.org.
Другой вариант-создать единый канал NuGet с вышестоящими источниками, которые позволят вам детерминированно управлять источником подачи пакетов. Я не знаю, можно ли это сделать в GitHub, но я знаю, что это можно сделать с помощью Azure DevOps: исходные источники.
Преимущества восходящих источников
Исходные источники позволяют управлять всеми зависимостями вашего продукта в одном канале. Мы рекомендуем публиковать все пакеты для данного продукта в ленте этого продукта и управлять его зависимостями от удаленных каналов в той же ленте через вышестоящие источники. Эта настройка имеет несколько преимуществ:
- Простота: ваш файл NuGet.config, .npmrc или settings.xml содержит ровно один канал (ваш канал).
- Детерминизм: ваш канал разрешает запросы пакетов по порядку, поэтому при перестроении одной и той же кодовой базы при одной и той же фиксации или наборе изменений используется один и тот же набор пакетов.
- Происхождение: ваш канал знает происхождение пакетов, сохраненных в вышестоящих источниках, поэтому вы можете убедиться, что используете оригинальный пакет, а не пользовательскую или вредоносную копию, опубликованную в вашем канале.
- Спокойствие: пакеты, используемые через вышестоящие источники, гарантированно сохраняются в ленте при первом использовании. Если вышестоящий источник отключен/удален, или удаленный канал выходит из строя или удаляет пакет, от которого вы зависите, вы можете продолжить разработку и сборку.
Комментарии:
1. Спасибо за ваш ответ. Я переименую пакет, так как в настоящее время я не использую Azure для своего проекта, но я добавлю ссылку в закладки для дальнейшего использования. Еще раз спасибо, что нашли время помочь.
- Remove From My Forums
-
Question
-
Help me please to fix it.
Error:
«Severity Code
Description Project
File Line
Suppression State
Error NU1101
Unable to find package System.Numerics.Vectors. No packages exist with this id in source(s): Microsoft Visual Studio Offline Packages
SimpleApp D:DownloadXAMARINSimpleAppSimpleAppSimpleApp.csproj
1 «
All replies
-
Hi Dan
Welcome to the MSDN forum.
This error usually shown the package cannot be found on any sources.
The solution 1: Examine the project’s dependencies in Visual Studio to be sure you’re using the
correct package identifier and version number. Also check that theNuGet configuration identifies the package sources you are expected to be using.
The solution 2:
In Visual Studio go to Tools -> NuGet
Package Manager -> Package Manager Settings. Here select the Package
Sources tab in the tree on the left. You should see the following:
If the nuget.org package source
is missing, add it manually by clicking the green plus button in the top right corner and setting:- Name: nuget.org
- Source: https://api.nuget.org/v3/index.json
Sincerely
May
MSDN Community Support Please remember to click «Mark as Answer» the responses that resolved your issue, and to click «Unmark as Answer» if not. This can be beneficial to other community members reading this thread. If you have any
compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com-
Proposed as answer by
Wednesday, May 15, 2019 8:56 AM
-
Unproposed as answer by
Jack Zhai-MSFTMicrosoft contingent staff
Tuesday, May 21, 2019 6:55 AM -
Proposed as answer by
Jack Zhai-MSFTMicrosoft contingent staff
Tuesday, May 21, 2019 6:55 AM
-
Hi Dan,
Long time no hear you. Did you solve this issue or not?
Have any update you would like to share us?
May
MSDN Community Support Please remember to click «Mark as Answer» the responses that resolved your issue, and to click «Unmark as Answer» if not. This can be beneficial to other community members reading this thread. If you have any
compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com -
I had same issue. Solution 2 worked for me. Thanks
Я пытаюсь опубликовать самое простое приложение WinForms в виде одного файла, это просто кнопка, которая показывает MessageBox, ориентированный на Windows и .NET 5.
Я установил .NET SDK 5.0.102, затем VS 16.8.5, который установил 5.0.103.
У меня были другие ошибки ранее при попытке опубликовать приложение, и, погуглив здесь и там, я добрался до этой точки.
Теперь публикация dotnet завершается с ошибкой:
Path.csproj: ошибка NU1101: не удалось найти пакет имя_пакета. Пакетов с таким идентификатором в источниках (и т. д.) не существует.
Три раза с отсутствием этих пакетов:
Microsoft.NETCore.App.Runtime.win-x64
Microsoft.WindowsDesktop.App.Runtime.win-x64
Microsoft.AspNetCore.App.Runtime.win-x64
Это автономный компьютер, поэтому я понимаю «проблему», хотя я не понимаю, почему установка SDK или VS также не сбрасывает все пакеты куда-то на диск.
Однако, если я перейду на страницу NuGet для этих пакетов, их описание будет таким:
«Пакет внутренней реализации не предназначен для прямого использования. Пожалуйста, не ссылайтесь напрямую».
И это заставляет меня думать, что должен быть другой способ правильно решить эту проблему.
Что я должен сделать?
Спасибо!
Обновите/измените, чтобы добавить дополнительные сведения и файл .csproj:
Это чистая установка Windows 7 Ultimate x64 с накопительными пакетами до 2019-12 (поскольку у 2020-01 есть проблемы). Нет антивируса или другого программного обеспечения, которое могло бы помешать, я установил только драйверы, .NET SDK 5.0.102, .NET Framework 4.7.2 SDK, затем установил Visual Studio 2019 16.8.5 из макета (проверено) и VS также установил .NET SDK версии 5.0.103 «из Visual Studio».
Это то чем я занимаюсь:
Откройте Visual Studio, создайте новый проект, используя шаблон «Приложение Windows Forms (.NET)». Я также пытался оставить его имя и местоположение по умолчанию, но я все равно никогда не использую имена с пробелами или неанглийскими буквами и цифрами.
Если я просто запускаю приложение из редактора, оно строится и работает нормально.
Затем я открываю командную строку разработчика и запускаю это:
Dotnet publish -c Release -r win-x64 —self-contained true
Я получаю вышеуказанные ошибки. То же самое только:
Публикация dotnet -c выпуск -r win-x64
Это нетронутый файл .csproj:
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>netcoreapp3.1</TargetFramework>
<UseWindowsForms>true</UseWindowsForms>
</PropertyGroup>
</Project>
Если я изменю целевую структуру на .NET 5.0, файл .csproj останется прежним, за исключением TargetFramework, который изменится на «net5.0-windows». Затем я получаю предупреждение NETSDK1137 (больше нет необходимости использовать Microsoft.NET.Sdk.WindowsDesktop SDK. Рассмотрите возможность изменения атрибута Sdk корневого элемента Project на «Microsoft.NET.Sdk»). или нет, ошибки при публикации остаются такими же, как и раньше.
Я также попытался изменить файл .csproj на файл на этой странице: https://learn.microsoft.com/en-us/ dotnet/core/deploying/single-file
(Попытался использовать его полностью, как он есть, или просто добавив некоторые отсутствующие свойства, во всяком случае, я получил бы другие ошибки таким образом.)
Если я попробую другие способы публикации вместо использования командной строки, я все равно буду получать ошибки.
Я думаю, что у вас есть неправильный узел PackageReference в вашем файле csproj.
Я думаю, вы добавили вот это в свой файл csproj:
<ItemGroup>
<PackageReference Include="Microsoft.NETCore.App.Runtime.win-x64" Version="5.0.3"></PackageReference>
<PackageReference Include="Microsoft.WindowsDesktop.App.Runtime.win-x64" Version="5.0.3"></PackageReference>
<PackageReference Include="Microsoft.AspNetCore.App.Runtime.win-x64" Version="5.0.3"></PackageReference>
</ItemGroup>
Если это так, обратите внимание, что это пакеты среды выполнения внутренней реализации для Net5.0
, и они не устанавливаются nuget.
И они по-прежнему содержатся в Net Core 5.0
SDK. Если вы измените свою платформу на x64
, она уже активирует эти пакеты среды выполнения.
Поэтому удалите этот узел xml, а затем повторно опубликуйте свой проект winform.
Кроме того, если проблема не устранена, поделитесь с нами своим файлом csproj, и мы сможем устранить проблему более оперативно.
1
Mr Qian
8 Мар 2021 в 09:54