Restoring packages wrong version
Hi!
I'm trying to buuild project with multiple TargetFrameworks:
<TargetFrameworks>netcoreapp3.1;net472</TargetFrameworks>
I have PackageReference to System.Net.Http Version="4.3.4":
<PackageReference Include="System.Net.Http" Version="4.3.4" />
but when I'm trying to build it on Appveyour I receive error on nuget restore step:
Failed to retrieve information about 'System.Net.Http' from remote source 'http://localhost:80//nuget/appveyor-6a5dnn7gbp6e/FindPackagesById()?id='System.Net.Http'&semVerLevel=2.0.0'. Response status code does not indicate success: 404 (Not Found). Command exited with code 1
Build failed
Why it trying to find version 2.0.0?
Here is my appveyor.yml
configuration: Release
before_build:
- nuget restore
cache:
#- packages
build:
project: Some.sln
verbosity: normal
publish_nuget: true
dotnet_csproj:
patch: true
file: '**\*.csproj'
version: '{version}'
package_version: '{version}'
assembly_version: '{version}'
file_version: '{version}'
informational_version: '{version}'
nuget:
account_feed: true
project_feed: false
Comments are currently closed for this discussion. You can start a new one.
Keyboard shortcuts
Generic
? | Show this help |
---|---|
ESC | Blurs the current field |
Comment Form
r | Focus the comment reply box |
---|---|
^ + ↩ | Submit the comment |
You can use Command ⌘
instead of Control ^
on Mac
Support Staff 1 Posted by Feodor Fitsner on 03 Nov, 2020 07:12 PM
Is it AppVeyor Server?
2 Posted by aspnetman on 03 Nov, 2020 10:35 PM
AppVeyor Server hosted in machine in my local network with Appveyor.Server service
Support Staff 3 Posted by Feodor Fitsner on 04 Nov, 2020 07:11 PM
Check what AppVeyor URL you have on "General" tab of system settings. That URL is used to build NuGet URLs.
4 Posted by aspnetman on 05 Nov, 2020 10:52 AM
When my csproj file have this configuration all ok:
here is a part of build log of nuget restore step:But I want to convert my project to multiple frameworks supporting: netcoreapp3.1 and net472 .
I changed my csproj:
I replaced
withand added PackageReference:
after this changes nuget restore step changed:please pay attention that MSBuild file is not generated and NuGet Config files are not used and build failed
Support Staff 5 Posted by Feodor Fitsner on 05 Nov, 2020 06:06 PM
Remove this section from
appveyor.yml
and try again:6 Posted by aspnetman on 06 Nov, 2020 08:23 AM
I removed this section but this is not help. Same error.
What is the easiest/most straightforward way to create a nupkg (nuget package) targeting multiple framework versions? In my case netcoreapp3.1 and net472
Support Staff 7 Posted by Feodor Fitsner on 07 Nov, 2020 05:29 AM
From the log I see it's trying to restore from multiple NuGet sources:
http://appveyor.theabyss.local
,http://localhost:80
and evenhttp://localhost//
. Where do you have those sources configured: project level, user level, somewhere else?What do you see when running
nuget sources
?8 Posted by aspnetman on 09 Nov, 2020 03:31 PM
Feodor, Thank you for your answer.
Yes, the list of nuget sources is strange.
nuget sources
gived me this result:About NuGet sources: in C:\Users\appveyor\AppData\Roaming\NuGet\NuGet.Config I founded this content:
But when I'm tried to remove AppveyorAccountFeed with command
I received an error:Unable to find any package source(s) matching name: AppveyorAccountFeed.
I'm tried to remove AppveyorAccountFeed manually from this config, but after new build this record recovered again.
See new build log below. Please pay attention that nuget.org is not used.
The configuration of appveyor.yml is same like in my first post in this thread.
Build log:
9 Posted by aspnetman on 09 Nov, 2020 05:00 PM
The problem is gone after I edited appveyor.yml and added:
nuget source removed ok and build completed.Thanks for help.
By the way why same command in cmd is not removed this nuget source?
Support Staff 10 Posted by Feodor Fitsner on 09 Nov, 2020 05:22 PM
Thanks for the update. It's hard to tell why it wasn't deleted in the first place.
Feodor Fitsner closed this discussion on 09 Jan, 2021 09:03 PM.