Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nuget authentication rewrites the source keys of the nuget feeds if they are internal #402

Open
paule96 opened this issue Oct 17, 2024 · 0 comments · May be fixed by #403
Open

Nuget authentication rewrites the source keys of the nuget feeds if they are internal #402

paule96 opened this issue Oct 17, 2024 · 0 comments · May be fixed by #403

Comments

@paule96
Copy link

paule96 commented Oct 17, 2024

I have the following nuget config in my project:

<?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="privateFeed" value="https://pkgs.dev.azure.com/myfunnycompany/_packaging/myfunnycompany/nuget/v3/index.json" />
	</packageSources>
	<packageSourceMapping>
		<packageSource key="privateFeed">
			<package pattern="privatepackage.*" />
		</packageSource>
		<packageSource key="nuget">
			<package pattern="*" />
		</packageSource>
	</packageSourceMapping>
</configuration>

Local with a for expample dotnet restore it works. If I run it in azure devops I get the following error:

path/project.jscproj : error NU1100: Unable to resolve 'privatepackage.numberone (>= 0.1.1-15)' for 'net8.0'. PackageSourceMapping is enabled, the following source(s) were not considered: , feed-privateFeed, nuget. [/path/solution.sln]

In my nuget config the feed is called privateFeed but in the error message feed-privateFeed. That will mean that the source mapping get's invalid.

The issue is produced in the following line:

For me their a two ways to fix the issue:

  • stop prefixing the feed.
    • on the current implementation are some nuget issues linked that are maybe important to solve that
  • make a string replace in the whole config that adds everywhere the prefix
    • this can be quite complecated because you want only replace sourcekey strings and not other substrings that have maybe the name letters but different meaning
@paule96 paule96 linked a pull request Oct 17, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant