Currently it's time consuming to work with NuGet packages in development state. To make it easier to develop and consume NuGet packages in an early state, it would be good to have something similiar to bower/npm link. This would save developers from the need of publishing unstable packages before using them. For this scenario, a workflow with npm is much smoother. You just reference a local folder to the source files. This would be nice to have in NuGet as well.
See this npm example as a gist: https://docs.npmjs.com/cli/link
NuGet already supports using a local package folder, you do not need to publish them anywhere, just add a second source pointing to the package folder.
Either of these two I'd like to be able to do (if it's possbile today, that's great):
<package id="MyPackage" targetFramework="net46" src="<path-to-project-folder>" />
nuget link
in the package folder which creates a locally accessible project. In the consuming project folder, I'd then run nuget link <package ID>
to reference the package.That is, I want to be able to set a package source for a specific package. Is that already supported by NuGet?
You can't do either of these. But you can add a folder to a local nuget.config with that package. That achieves exactly the same result.
Closing as we are tracking this discussion in #1822
Sorry for commenting on such an old issue but I don't see how the current flow fulfills the original request.
But you can add a folder to a local nuget.config with that package. That achieves exactly the same result.
I don't think it does. npm link
just makes a symlink to the referenced package so with a theoretical nuget link
I could make a change in the referenced project A (and rebuild), and then move to the referencing project B and rebuild & run and see the changes from A.
From what I can tell, currently with Nuget I cannot do that because the nupkg from A is copied locally to B, and if I were to delete that it would be restored from one of Nuget's many caches.
Is there a way to make a change in one project and have it show up in the referencing project without multiple steps in-between to clear cache or remove/re-add the package?
@nexussays unfortunately there is no way. nuget still lacks linking and as far as I follow, there's no plan or awareness on their side.
since we've been using multi repositories on our projects, the importance of the issue became critical. so far, we tried conditional msbuild references but it didn't work.
there should be a way without breaking developer experience w/ annoyance and distraction.
@nexussays @eserozvataf
You may want to check NuLink tool, which does exactly that:
https://github.com/nwheels-io/NuLink
@yishaigalatzer why is this closed, the issue you are tracking is irrelevant. We are talking about the development stage. also NuLink looks amazing @felix-b
Most helpful comment
Sorry for commenting on such an old issue but I don't see how the current flow fulfills the original request.
I don't think it does.
npm link
just makes a symlink to the referenced package so with a theoreticalnuget link
I could make a change in the referenced project A (and rebuild), and then move to the referencing project B and rebuild & run and see the changes from A.From what I can tell, currently with Nuget I cannot do that because the nupkg from A is copied locally to B, and if I were to delete that it would be restored from one of Nuget's many caches.
Is there a way to make a change in one project and have it show up in the referencing project without multiple steps in-between to clear cache or remove/re-add the package?