Nuget command to replace existing references with nuget references?

走远了吗. 提交于 2019-12-11 06:06:49

问题


In VS2017 I created a new Winforms project using the XAF Solutions Wizard ( Entity Framework Code - First)

The wizard adds references according to options I select.

Now I want to change all the packages to use my Nuget Feed for the Dev Express References.

XAF does have Nuget packages

Is there a Nuget command that I can use to do this automatically?

Cross posted to Dev Express


回答1:


There is no way to do this with Nugets unless you script your way out as we are doing in XAF community project expandFramework. For some cases it won't work, however for a similar case here is what we do.

  1. Parse all your projects for References start with DevExpress and construct a list of assemblies
  2. For all assemblies in the list add them to packages.config
  3. For all assemblies use the DevExpress.PackageContent project to link to the containing the packages.
Get-DxNugets 18.2.6
  1. Install the found packages from step 3
`Nuget  Install packageName -OutputFolder $commonOutputFolder
  1. Update the DevExpress references HintPath to the packages installation folder.
Update-HintPath -OutputPath "$packageInstallationfolder" -SourcesPath $rootPath -filter "DevExpress*"

all powershell functions come from the XpandPosh project. There are many helpful methods there unfortunately no docs. But you can get support



来源:https://stackoverflow.com/questions/55132859/nuget-command-to-replace-existing-references-with-nuget-references

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!