[英]Custom nuget feed, VS doesn't see package as installed
Hi all I have a local Nuget source with a package containing some default items I want in my projects (default corporate models and styles and some default pages). 大家好,我有一个本地Nuget源,其包装中包含一些我想要在项目中使用的默认项(默认公司模型和样式以及一些默认页面)。 It is only copying items in to the project and adding a connection string to the web.config, nothing fancy. 它只是将项目复制到项目中,并将连接字符串添加到web.config中,一点也不花哨。
I can install the package via the Package Manager Console and the GUI. 我可以通过程序包管理器控制台和GUI安装程序包。 However, it never shows as installed. 但是,它永远不会显示为已安装。 This means that I cannot update it nor can I uninstall it. 这意味着我无法更新它,也无法卸载它。 If I go to the GUI, it shows the package as not installed, even though it has added all items to the project and has a folder for the package in the packages directory. 如果我转到GUI,即使已将所有项目添加到项目中,并且在packages目录中有该文件夹的文件夹,它也会显示未安装的软件包。
Also, I want to use this NuGet package to overwrite some files that already exist in the default MVC project (such as AccountController and LogonUserControl.ascx). 另外,我想使用此NuGet包覆盖默认MVC项目中已经存在的某些文件(例如AccountController和LogonUserControl.ascx)。 Can this be done or will I need to start off with the blank MVC template instead of the default? 可以做到这一点,还是需要从空白的MVC模板而不是默认模板开始?
Packages.config: Packages.config:
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="MyCompanyMVC" version="1.1" />
</packages>
NuGet不会覆盖文件-我不相信有一种强制方法,但是您可以通过使用PowerShell脚本(tools / install.ps1)删除旧文件并重命名注入的文件来“解决”此问题具有所需的名称。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.