冲突阻止发布,但构建很好。 MVC5 ASP.NET
Conflicts preventing publish, but build is fine. MVC5 ASP.NET
我在 asp.NET MVC5 中遇到问题。在我的解决方案中添加一个新项目后(数据库项目,连接到远程 SQL 服务器并使用 Entity Framework 6),我无法发布。一切都很好,并且在本地主机上运行得很好,但是当我尝试发布时我收到了这个警告:
Found conflicts between different versions of the same dependent assembly that could not be resolved. These reference conflicts are listen in the build log when log verbosity is set to detailed.
据说这个警告来自我的 .Data
(数据库项目),但我的 .Web
项目中有我所有的引用、包等。
到目前为止,我已经尝试清理我的解决方案中的每个项目,重建,清理完整的解决方案,重建,但没有任何效果。
在研究了更多如何解决这个问题之后,我将构建日志更改为 Diagnostic
,并且至少发现了冲突是什么。我的 Diagnostic
构建日志中的冲突如下:
There was a conflict between "Glimpse.Core, Version=1.8.6.0, Culture=neutral, PublicKeyToken=null" and "Glimpse.Core, Version=1.8.2.0, Culture=neutral, PublicKeyToken=null". (TaskId:62)
2> "Glimpse.Core, Version=1.8.6.0, Culture=neutral, PublicKeyToken=null" was chosen because it was primary and "Glimpse.Core, Version=1.8.2.0, Culture=neutral, PublicKeyToken=null" was not. (TaskId:62)
2> References which depend on "Glimpse.Core, Version=1.8.6.0, Culture=neutral, PublicKeyToken=null" [C:{path}\Website\packages\Glimpse.1.8.6\lib\net45\Glimpse.Core.dll]. (TaskId:62)
2> C:{path}\Website\packages\Glimpse.1.8.6\lib\net45\Glimpse.Core.dll (TaskId:62)
2> Project file item includes which caused reference "C:{path}\Website\packages\Glimpse.1.8.6\lib\net45\Glimpse.Core.dll". (TaskId:62)
2> Glimpse.Core, Version=1.8.6.0, Culture=neutral, processorArchitecture=MSIL (TaskId:62)
2> References which depend on "Glimpse.Core, Version=1.8.2.0, Culture=neutral, PublicKeyToken=null" []. (TaskId:62)
2> C:{path}\Website\packages\Glimpse.AspNet.1.8.0\lib\net45\Glimpse.AspNet.dll (TaskId:62)
2> Project file item includes which caused reference "C:{path}\Website\packages\Glimpse.AspNet.1.8.0\lib\net45\Glimpse.AspNet.dll". (TaskId:62)
2> Glimpse.AspNet, Version=1.8.0.0, Culture=neutral, processorArchitecture=MSIL (TaskId:62)
2> Glimpse.Mvc5, Version=1.5.3.0, Culture=neutral, processorArchitecture=MSIL (TaskId:62)
2> C:{path}\Website\packages\Glimpse.Mvc5.1.5.3\lib\net45\Glimpse.Mvc5.dll (TaskId:62)
2> Project file item includes which caused reference "C:{path}\Website\packages\Glimpse.Mvc5.1.5.3\lib\net45\Glimpse.Mvc5.dll". (TaskId:62)
2> Glimpse.Mvc5, Version=1.5.3.0, Culture=neutral, processorArchitecture=MSIL (TaskId:62)
再次提及 Vstudio 中的警告据说来自我的 .Data
项目,但 Glimpse
仅安装在我的 .Web
项目中。
我继续尝试修复此问题,但没有成功。到目前为止,我已经尝试删除 Glimpse 依赖项、重新安装 Glimpse(核心、mvc、aspnet)、Update-Package -reinstall Glimpse,以及从 nugget 管理器。我试过清除 Nugget 缓存。我遍历了每个 .csproj 文件,只找到了 Glimpse Version=1.8.6.0
(我以前有过冲突,但修复很容易,因为两个版本都存在于 .csproj 中,现在我只有 1 个版本的 Glimpse)。
我也尝试过从 VStudio 2017 和 VStudio 2013(我使用的主要 Vstudio 是 2017)重建、重新清理、重新安装和更新包、项目、解决方案。
如果需要更多 information/parts 代码,需要错误请告诉我,以便我更新我的问题!
如果有人知道如何修复,请告诉我。如果你postcomments/answers请尽量详细!谢谢!
经过无数小时的调查、调试、删除、更新、尝试各种解决方案,我终于找到了解决问题的方法。不知何故,在 File Publish Options
下的 FTP 发布设置中, Precompile during publishing
选项未被选中,在检查并尝试发布后,我没有任何错误或警告,解决方案开始发布。我希望这对面临类似问题的人有所帮助!也感谢在评论中提出建议的各位!
如果安装 nuget 包 Glimpse.MVC5 和 Glimpse.EF6,包 Glimpse.EF6 依赖于 Glimpse.Core 1.8.6,包 Glimpse.MVC5 依赖于 Glimpse.Core 1.8.2。
第一步.安装包Glimpse.MVC5
PM> Install-Package Glimpse.MVC5
Attempting to resolve dependency 'Glimpse.AspNet (≥ 1.8.0)'.
Attempting to resolve dependency 'Glimpse (≥ 1.8.2)'.
'Glimpse.Mvc5 1.5.3' already installed.
Adding 'Glimpse 1.8.2' to GPG.MVC5.Web.
Installing 'Glimpse 1.8.2'.
Successfully installed 'Glimpse 1.8.2'.
Successfully added 'Glimpse 1.8.2' to GPG.MVC5.Web.
Adding 'Glimpse.AspNet 1.8.0' to GPG.MVC5.Web.
Successfully added 'Glimpse.AspNet 1.8.0' to GPG.MVC5.Web.
Adding 'Glimpse.Mvc5 1.5.3' to GPG.MVC5.Web.
Successfully added 'Glimpse.Mvc5 1.5.3' to GPG.MVC5.Web.
In package.config
<package id="Glimpse" version="1.8.2" targetFramework="net451" />
<package id="Glimpse.AspNet" version="1.8.0" targetFramework="net451" />
<package id="Glimpse.Mvc5" version="1.5.3" targetFramework="net451" />
第二步.安装包Glimpse.EF6
PM> Install-Package Glimpse.EF6
Attempting to resolve dependency 'Glimpse.Ado (≥ 1.7.3)'.
Attempting to resolve dependency 'Glimpse (≥ 1.8.6)'.
Installing 'Glimpse.Ado 1.7.3'.
Successfully installed 'Glimpse.Ado 1.7.3'.
Installing 'Glimpse.EF6 1.6.5'.
Successfully installed 'Glimpse.EF6 1.6.5'.
Removing 'Glimpse 1.8.2' from GPG.MVC5.Web.
Successfully removed 'Glimpse 1.8.2' from GPG.MVC5.Web.
Adding 'Glimpse 1.8.6' to GPG.MVC5.Web.
Successfully added 'Glimpse 1.8.6' to GPG.MVC5.Web.
Adding 'Glimpse.Ado 1.7.3' to GPG.MVC5.Web.
Successfully added 'Glimpse.Ado 1.7.3' to GPG.MVC5.Web.
Adding 'Glimpse.EF6 1.6.5' to GPG.MVC5.Web.
Successfully added 'Glimpse.EF6 1.6.5' to GPG.MVC5.Web.
Uninstalling 'Glimpse 1.8.2'.
Successfully uninstalled 'Glimpse 1.8.2'.
In package.config:
<package id="Glimpse" version="1.8.6" targetFramework="net451" />
<package id="Glimpse.Ado" version="1.7.3" targetFramework="net451" />
<package id="Glimpse.AspNet" version="1.8.0" targetFramework="net451" />
<package id="Glimpse.EF6" version="1.6.5" targetFramework="net451" />
<package id="Glimpse.Mvc5" version="1.5.3" targetFramework="net451" />
我在 asp.NET MVC5 中遇到问题。在我的解决方案中添加一个新项目后(数据库项目,连接到远程 SQL 服务器并使用 Entity Framework 6),我无法发布。一切都很好,并且在本地主机上运行得很好,但是当我尝试发布时我收到了这个警告:
Found conflicts between different versions of the same dependent assembly that could not be resolved. These reference conflicts are listen in the build log when log verbosity is set to detailed.
据说这个警告来自我的 .Data
(数据库项目),但我的 .Web
项目中有我所有的引用、包等。
到目前为止,我已经尝试清理我的解决方案中的每个项目,重建,清理完整的解决方案,重建,但没有任何效果。
在研究了更多如何解决这个问题之后,我将构建日志更改为 Diagnostic
,并且至少发现了冲突是什么。我的 Diagnostic
构建日志中的冲突如下:
There was a conflict between "Glimpse.Core, Version=1.8.6.0, Culture=neutral, PublicKeyToken=null" and "Glimpse.Core, Version=1.8.2.0, Culture=neutral, PublicKeyToken=null". (TaskId:62) 2> "Glimpse.Core, Version=1.8.6.0, Culture=neutral, PublicKeyToken=null" was chosen because it was primary and "Glimpse.Core, Version=1.8.2.0, Culture=neutral, PublicKeyToken=null" was not. (TaskId:62) 2> References which depend on "Glimpse.Core, Version=1.8.6.0, Culture=neutral, PublicKeyToken=null" [C:{path}\Website\packages\Glimpse.1.8.6\lib\net45\Glimpse.Core.dll]. (TaskId:62) 2> C:{path}\Website\packages\Glimpse.1.8.6\lib\net45\Glimpse.Core.dll (TaskId:62) 2> Project file item includes which caused reference "C:{path}\Website\packages\Glimpse.1.8.6\lib\net45\Glimpse.Core.dll". (TaskId:62) 2> Glimpse.Core, Version=1.8.6.0, Culture=neutral, processorArchitecture=MSIL (TaskId:62) 2> References which depend on "Glimpse.Core, Version=1.8.2.0, Culture=neutral, PublicKeyToken=null" []. (TaskId:62) 2> C:{path}\Website\packages\Glimpse.AspNet.1.8.0\lib\net45\Glimpse.AspNet.dll (TaskId:62) 2> Project file item includes which caused reference "C:{path}\Website\packages\Glimpse.AspNet.1.8.0\lib\net45\Glimpse.AspNet.dll". (TaskId:62) 2> Glimpse.AspNet, Version=1.8.0.0, Culture=neutral, processorArchitecture=MSIL (TaskId:62) 2> Glimpse.Mvc5, Version=1.5.3.0, Culture=neutral, processorArchitecture=MSIL (TaskId:62) 2> C:{path}\Website\packages\Glimpse.Mvc5.1.5.3\lib\net45\Glimpse.Mvc5.dll (TaskId:62) 2> Project file item includes which caused reference "C:{path}\Website\packages\Glimpse.Mvc5.1.5.3\lib\net45\Glimpse.Mvc5.dll". (TaskId:62) 2> Glimpse.Mvc5, Version=1.5.3.0, Culture=neutral, processorArchitecture=MSIL (TaskId:62)
再次提及 Vstudio 中的警告据说来自我的 .Data
项目,但 Glimpse
仅安装在我的 .Web
项目中。
我继续尝试修复此问题,但没有成功。到目前为止,我已经尝试删除 Glimpse 依赖项、重新安装 Glimpse(核心、mvc、aspnet)、Update-Package -reinstall Glimpse,以及从 nugget 管理器。我试过清除 Nugget 缓存。我遍历了每个 .csproj 文件,只找到了 Glimpse Version=1.8.6.0
(我以前有过冲突,但修复很容易,因为两个版本都存在于 .csproj 中,现在我只有 1 个版本的 Glimpse)。
我也尝试过从 VStudio 2017 和 VStudio 2013(我使用的主要 Vstudio 是 2017)重建、重新清理、重新安装和更新包、项目、解决方案。
如果需要更多 information/parts 代码,需要错误请告诉我,以便我更新我的问题!
如果有人知道如何修复,请告诉我。如果你postcomments/answers请尽量详细!谢谢!
经过无数小时的调查、调试、删除、更新、尝试各种解决方案,我终于找到了解决问题的方法。不知何故,在 File Publish Options
下的 FTP 发布设置中, Precompile during publishing
选项未被选中,在检查并尝试发布后,我没有任何错误或警告,解决方案开始发布。我希望这对面临类似问题的人有所帮助!也感谢在评论中提出建议的各位!
如果安装 nuget 包 Glimpse.MVC5 和 Glimpse.EF6,包 Glimpse.EF6 依赖于 Glimpse.Core 1.8.6,包 Glimpse.MVC5 依赖于 Glimpse.Core 1.8.2。
第一步.安装包Glimpse.MVC5
PM> Install-Package Glimpse.MVC5
Attempting to resolve dependency 'Glimpse.AspNet (≥ 1.8.0)'.
Attempting to resolve dependency 'Glimpse (≥ 1.8.2)'.
'Glimpse.Mvc5 1.5.3' already installed.
Adding 'Glimpse 1.8.2' to GPG.MVC5.Web.
Installing 'Glimpse 1.8.2'.
Successfully installed 'Glimpse 1.8.2'.
Successfully added 'Glimpse 1.8.2' to GPG.MVC5.Web.
Adding 'Glimpse.AspNet 1.8.0' to GPG.MVC5.Web.
Successfully added 'Glimpse.AspNet 1.8.0' to GPG.MVC5.Web.
Adding 'Glimpse.Mvc5 1.5.3' to GPG.MVC5.Web.
Successfully added 'Glimpse.Mvc5 1.5.3' to GPG.MVC5.Web.
In package.config
<package id="Glimpse" version="1.8.2" targetFramework="net451" />
<package id="Glimpse.AspNet" version="1.8.0" targetFramework="net451" />
<package id="Glimpse.Mvc5" version="1.5.3" targetFramework="net451" />
第二步.安装包Glimpse.EF6
PM> Install-Package Glimpse.EF6
Attempting to resolve dependency 'Glimpse.Ado (≥ 1.7.3)'.
Attempting to resolve dependency 'Glimpse (≥ 1.8.6)'.
Installing 'Glimpse.Ado 1.7.3'.
Successfully installed 'Glimpse.Ado 1.7.3'.
Installing 'Glimpse.EF6 1.6.5'.
Successfully installed 'Glimpse.EF6 1.6.5'.
Removing 'Glimpse 1.8.2' from GPG.MVC5.Web.
Successfully removed 'Glimpse 1.8.2' from GPG.MVC5.Web.
Adding 'Glimpse 1.8.6' to GPG.MVC5.Web.
Successfully added 'Glimpse 1.8.6' to GPG.MVC5.Web.
Adding 'Glimpse.Ado 1.7.3' to GPG.MVC5.Web.
Successfully added 'Glimpse.Ado 1.7.3' to GPG.MVC5.Web.
Adding 'Glimpse.EF6 1.6.5' to GPG.MVC5.Web.
Successfully added 'Glimpse.EF6 1.6.5' to GPG.MVC5.Web.
Uninstalling 'Glimpse 1.8.2'.
Successfully uninstalled 'Glimpse 1.8.2'.
In package.config:
<package id="Glimpse" version="1.8.6" targetFramework="net451" />
<package id="Glimpse.Ado" version="1.7.3" targetFramework="net451" />
<package id="Glimpse.AspNet" version="1.8.0" targetFramework="net451" />
<package id="Glimpse.EF6" version="1.6.5" targetFramework="net451" />
<package id="Glimpse.Mvc5" version="1.5.3" targetFramework="net451" />