添加来自复制的引用 package.config
Add references from copied package.config
我想将项目的 packages.config
复制到新创建的项目中,并在 VS2015 SP3 中添加引用。
This post 介绍了 Update-Package -Reinstall -ProjectName Your.Project.Name
但它没有像我预期的那样工作。并非所有包都添加到项目中,即使它具有相同的构建环境(.NET 4.5.2 控制台应用程序)。此外,它会覆盖 packages.config
以仅在重新安装过程后添加包。
如何正确操作?
+追加下面是我的实际packages.config
内容
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Microsoft.Azure.KeyVault.Core" version="1.0.0" targetFramework="net452" />
<package id="Microsoft.Azure.WebJobs" version="1.1.2" targetFramework="net452" />
<package id="Microsoft.Azure.WebJobs.Core" version="1.1.2" targetFramework="net452" />
<package id="Microsoft.Azure.WebJobs.Extensions" version="1.0.1" targetFramework="net452" />
<package id="Microsoft.Data.Edm" version="5.8.1" targetFramework="net452" />
<package id="Microsoft.Data.OData" version="5.8.1" targetFramework="net452" />
<package id="Microsoft.Data.Services.Client" version="5.8.1" targetFramework="net452" />
<package id="Microsoft.EntityFrameworkCore" version="1.1.0" targetFramework="net452" />
<package id="Microsoft.EntityFrameworkCore.Relational" version="1.1.0" targetFramework="net452" />
<package id="Microsoft.EntityFrameworkCore.SqlServer" version="1.1.0" targetFramework="net452" />
<package id="Microsoft.Extensions.Caching.Abstractions" version="1.1.0" targetFramework="net452" />
<package id="Microsoft.Extensions.Caching.Memory" version="1.1.0" targetFramework="net452" />
<package id="Microsoft.Extensions.DependencyInjection" version="1.1.0" targetFramework="net452" />
<package id="Microsoft.Extensions.DependencyInjection.Abstractions" version="1.1.0" targetFramework="net452" />
<package id="Microsoft.Extensions.Logging" version="1.1.0" targetFramework="net452" />
<package id="Microsoft.Extensions.Logging.Abstractions" version="1.1.0" targetFramework="net452" />
<package id="Microsoft.Extensions.Options" version="1.1.0" targetFramework="net452" />
<package id="Microsoft.Extensions.Primitives" version="1.1.0" targetFramework="net452" />
<package id="Microsoft.NETCore.Platforms" version="1.1.0" targetFramework="net452" />
<package id="Microsoft.Tpl.Dataflow" version="4.5.24" targetFramework="net452" />
<package id="Microsoft.Web.WebJobs.Publish" version="1.0.12" targetFramework="net452" />
<package id="Microsoft.WindowsAzure.ConfigurationManager" version="3.2.3" targetFramework="net452" />
<package id="ncrontab" version="2.0.0" targetFramework="net452" />
<package id="NETStandard.Library" version="1.6.1" targetFramework="net452" />
<package id="Newtonsoft.Json" version="9.0.1" targetFramework="net452" />
<package id="Remotion.Linq" version="2.1.1" targetFramework="net452" />
<package id="SimpleInjector" version="3.3.2" targetFramework="net452" />
<package id="SimpleInjector.Extensions.ExecutionContextScoping" version="3.3.2" targetFramework="net452" />
<package id="SlowCheetah" version="2.5.15" targetFramework="net452" />
<package id="System.Collections" version="4.3.0" targetFramework="net452" />
<package id="System.Collections.Concurrent" version="4.3.0" targetFramework="net452" />
<package id="System.Collections.Immutable" version="1.3.1" targetFramework="net452" />
<package id="System.ComponentModel" version="4.3.0" targetFramework="net452" />
<package id="System.Diagnostics.Debug" version="4.3.0" targetFramework="net452" />
<package id="System.Diagnostics.DiagnosticSource" version="4.3.0" targetFramework="net452" />
<package id="System.Diagnostics.Tools" version="4.3.0" targetFramework="net452" />
<package id="System.Diagnostics.Tracing" version="4.3.0" targetFramework="net452" />
<package id="System.Globalization" version="4.3.0" targetFramework="net452" />
<package id="System.Interactive.Async" version="3.0.0" targetFramework="net452" />
<package id="System.IO" version="4.3.0" targetFramework="net452" />
<package id="System.IO.Compression" version="4.3.0" targetFramework="net452" />
<package id="System.Linq" version="4.3.0" targetFramework="net452" />
<package id="System.Linq.Expressions" version="4.3.0" targetFramework="net452" />
<package id="System.Linq.Queryable" version="4.3.0" targetFramework="net452" />
<package id="System.Net.Http" version="4.3.0" targetFramework="net452" />
<package id="System.Net.Primitives" version="4.3.0" targetFramework="net452" />
<package id="System.ObjectModel" version="4.3.0" targetFramework="net452" />
<package id="System.Reflection" version="4.3.0" targetFramework="net452" />
<package id="System.Reflection.Extensions" version="4.3.0" targetFramework="net452" />
<package id="System.Reflection.Primitives" version="4.3.0" targetFramework="net452" />
<package id="System.Resources.ResourceManager" version="4.3.0" targetFramework="net452" />
<package id="System.Runtime" version="4.3.0" targetFramework="net452" />
<package id="System.Runtime.CompilerServices.Unsafe" version="4.3.0" targetFramework="net452" />
<package id="System.Runtime.Extensions" version="4.3.0" targetFramework="net452" />
<package id="System.Runtime.InteropServices" version="4.3.0" targetFramework="net452" />
<package id="System.Runtime.InteropServices.RuntimeInformation" version="4.3.0" targetFramework="net452" />
<package id="System.Runtime.Numerics" version="4.3.0" targetFramework="net452" />
<package id="System.Spatial" version="5.8.1" targetFramework="net452" />
<package id="System.Text.Encoding" version="4.3.0" targetFramework="net452" />
<package id="System.Text.Encoding.Extensions" version="4.3.0" targetFramework="net452" />
<package id="System.Text.RegularExpressions" version="4.3.0" targetFramework="net452" />
<package id="System.Threading" version="4.3.0" targetFramework="net452" />
<package id="System.Threading.Tasks" version="4.3.0" targetFramework="net452" />
<package id="System.Threading.Timer" version="4.3.0" targetFramework="net452" />
<package id="System.Xml.ReaderWriter" version="4.3.0" targetFramework="net452" />
<package id="System.Xml.XDocument" version="4.3.0" targetFramework="net452" />
<package id="WindowsAzure.Storage" version="8.0.1" targetFramework="net452" />
</packages>
请在重新安装过程完成后接受“重新加载”或“全部重新加载”。
在重新安装的过程中,接受Reload或Reload All从磁盘加载更新项目后得到了相同的结果。因为您的项目在接受重新加载或全部重新加载后卸载,并且正在进行重新安装的过程。在项目卸载期间无法将包安装到项目,NuGet 将覆盖 package.config 以仅在项目卸载前添加包。
此问题的解决方案是在重新安装过程完成后接受重新加载或全部重新加载。
更新
重装时检测到冲突的文件修改有不同的提示。重新安装过程完成后,请接受重新加载或覆盖。
我想将项目的 packages.config
复制到新创建的项目中,并在 VS2015 SP3 中添加引用。
This post 介绍了 Update-Package -Reinstall -ProjectName Your.Project.Name
但它没有像我预期的那样工作。并非所有包都添加到项目中,即使它具有相同的构建环境(.NET 4.5.2 控制台应用程序)。此外,它会覆盖 packages.config
以仅在重新安装过程后添加包。
如何正确操作?
+追加下面是我的实际packages.config
内容
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Microsoft.Azure.KeyVault.Core" version="1.0.0" targetFramework="net452" />
<package id="Microsoft.Azure.WebJobs" version="1.1.2" targetFramework="net452" />
<package id="Microsoft.Azure.WebJobs.Core" version="1.1.2" targetFramework="net452" />
<package id="Microsoft.Azure.WebJobs.Extensions" version="1.0.1" targetFramework="net452" />
<package id="Microsoft.Data.Edm" version="5.8.1" targetFramework="net452" />
<package id="Microsoft.Data.OData" version="5.8.1" targetFramework="net452" />
<package id="Microsoft.Data.Services.Client" version="5.8.1" targetFramework="net452" />
<package id="Microsoft.EntityFrameworkCore" version="1.1.0" targetFramework="net452" />
<package id="Microsoft.EntityFrameworkCore.Relational" version="1.1.0" targetFramework="net452" />
<package id="Microsoft.EntityFrameworkCore.SqlServer" version="1.1.0" targetFramework="net452" />
<package id="Microsoft.Extensions.Caching.Abstractions" version="1.1.0" targetFramework="net452" />
<package id="Microsoft.Extensions.Caching.Memory" version="1.1.0" targetFramework="net452" />
<package id="Microsoft.Extensions.DependencyInjection" version="1.1.0" targetFramework="net452" />
<package id="Microsoft.Extensions.DependencyInjection.Abstractions" version="1.1.0" targetFramework="net452" />
<package id="Microsoft.Extensions.Logging" version="1.1.0" targetFramework="net452" />
<package id="Microsoft.Extensions.Logging.Abstractions" version="1.1.0" targetFramework="net452" />
<package id="Microsoft.Extensions.Options" version="1.1.0" targetFramework="net452" />
<package id="Microsoft.Extensions.Primitives" version="1.1.0" targetFramework="net452" />
<package id="Microsoft.NETCore.Platforms" version="1.1.0" targetFramework="net452" />
<package id="Microsoft.Tpl.Dataflow" version="4.5.24" targetFramework="net452" />
<package id="Microsoft.Web.WebJobs.Publish" version="1.0.12" targetFramework="net452" />
<package id="Microsoft.WindowsAzure.ConfigurationManager" version="3.2.3" targetFramework="net452" />
<package id="ncrontab" version="2.0.0" targetFramework="net452" />
<package id="NETStandard.Library" version="1.6.1" targetFramework="net452" />
<package id="Newtonsoft.Json" version="9.0.1" targetFramework="net452" />
<package id="Remotion.Linq" version="2.1.1" targetFramework="net452" />
<package id="SimpleInjector" version="3.3.2" targetFramework="net452" />
<package id="SimpleInjector.Extensions.ExecutionContextScoping" version="3.3.2" targetFramework="net452" />
<package id="SlowCheetah" version="2.5.15" targetFramework="net452" />
<package id="System.Collections" version="4.3.0" targetFramework="net452" />
<package id="System.Collections.Concurrent" version="4.3.0" targetFramework="net452" />
<package id="System.Collections.Immutable" version="1.3.1" targetFramework="net452" />
<package id="System.ComponentModel" version="4.3.0" targetFramework="net452" />
<package id="System.Diagnostics.Debug" version="4.3.0" targetFramework="net452" />
<package id="System.Diagnostics.DiagnosticSource" version="4.3.0" targetFramework="net452" />
<package id="System.Diagnostics.Tools" version="4.3.0" targetFramework="net452" />
<package id="System.Diagnostics.Tracing" version="4.3.0" targetFramework="net452" />
<package id="System.Globalization" version="4.3.0" targetFramework="net452" />
<package id="System.Interactive.Async" version="3.0.0" targetFramework="net452" />
<package id="System.IO" version="4.3.0" targetFramework="net452" />
<package id="System.IO.Compression" version="4.3.0" targetFramework="net452" />
<package id="System.Linq" version="4.3.0" targetFramework="net452" />
<package id="System.Linq.Expressions" version="4.3.0" targetFramework="net452" />
<package id="System.Linq.Queryable" version="4.3.0" targetFramework="net452" />
<package id="System.Net.Http" version="4.3.0" targetFramework="net452" />
<package id="System.Net.Primitives" version="4.3.0" targetFramework="net452" />
<package id="System.ObjectModel" version="4.3.0" targetFramework="net452" />
<package id="System.Reflection" version="4.3.0" targetFramework="net452" />
<package id="System.Reflection.Extensions" version="4.3.0" targetFramework="net452" />
<package id="System.Reflection.Primitives" version="4.3.0" targetFramework="net452" />
<package id="System.Resources.ResourceManager" version="4.3.0" targetFramework="net452" />
<package id="System.Runtime" version="4.3.0" targetFramework="net452" />
<package id="System.Runtime.CompilerServices.Unsafe" version="4.3.0" targetFramework="net452" />
<package id="System.Runtime.Extensions" version="4.3.0" targetFramework="net452" />
<package id="System.Runtime.InteropServices" version="4.3.0" targetFramework="net452" />
<package id="System.Runtime.InteropServices.RuntimeInformation" version="4.3.0" targetFramework="net452" />
<package id="System.Runtime.Numerics" version="4.3.0" targetFramework="net452" />
<package id="System.Spatial" version="5.8.1" targetFramework="net452" />
<package id="System.Text.Encoding" version="4.3.0" targetFramework="net452" />
<package id="System.Text.Encoding.Extensions" version="4.3.0" targetFramework="net452" />
<package id="System.Text.RegularExpressions" version="4.3.0" targetFramework="net452" />
<package id="System.Threading" version="4.3.0" targetFramework="net452" />
<package id="System.Threading.Tasks" version="4.3.0" targetFramework="net452" />
<package id="System.Threading.Timer" version="4.3.0" targetFramework="net452" />
<package id="System.Xml.ReaderWriter" version="4.3.0" targetFramework="net452" />
<package id="System.Xml.XDocument" version="4.3.0" targetFramework="net452" />
<package id="WindowsAzure.Storage" version="8.0.1" targetFramework="net452" />
</packages>
请在重新安装过程完成后接受“重新加载”或“全部重新加载”。
在重新安装的过程中,接受Reload或Reload All从磁盘加载更新项目后得到了相同的结果。因为您的项目在接受重新加载或全部重新加载后卸载,并且正在进行重新安装的过程。在项目卸载期间无法将包安装到项目,NuGet 将覆盖 package.config 以仅在项目卸载前添加包。
此问题的解决方案是在重新安装过程完成后接受重新加载或全部重新加载。
更新
重装时检测到冲突的文件修改有不同的提示。重新安装过程完成后,请接受重新加载或覆盖。