只需发布已修改的控制器,模型和ASP.NET MVC项目的某些部分

时间:2021-08-24 15:13:12

If I change my views (.cshtml) or styles (.css) or scripts (.js) in my MVC projects then I can publish it easily by right click on it and select Publish FILE_NAME

如果我在MVC项目中更改了我的视图(.cshtml)或样式(.css)或脚本(.js),那么我可以通过右键单击它并选择Publish FILE_NAME轻松发布它

只需发布已修改的控制器,模型和ASP.NET MVC项目的某些部分

If I changed some controllers files or BLL classes or infrastructure classes,

如果我更改了一些控制器文件或BLL类或基础结构类,

  • Which files should be published? which DLLs?

    应该发布哪些文件?哪个DLL?

  • Of course added references must be published but what are another?

    当然必须发布添加的参考文献,但另一个是什么?

  • Should I publish all the DLL files in the bin folder or just some?

    我应该在bin文件夹中发布所有DLL文件还是只发布一些?

  • Is there an easy way to VS detect modified files and publish theme by a command or...?

    是否有一种简单的方法来VS检测修改过的文件并通过命令或...发布主题?


Edit1

I use FTP method to direct publish and upload our site to the server.

我使用FTP方法直接发布并将我们的站点上传到服务器。

My Publish Preview Step Snapshot: 只需发布已修改的控制器,模型和ASP.NET MVC项目的某些部分

我的发布预览步骤快照:

  • What is the name of DLL files that contains the compiled information of controllers, BLL classes and...?
  • 包含控制器,BLL类和......的编译信息的DLL文件的名称是什么?

2 个解决方案

#1


6  

I just published the MVC5Bootstrap-3-1-1-Less.dll and it worked!

我刚刚发布了MVC5Bootstrap-3-1-1-Less.dll,它确实有效!

So if we uploaded a website and then want only publish the new modified controllers or classes of the MVC web application (here: MVC5) to the server, we should upload the following files:

因此,如果我们上传了一个网站,然后只想将新修改的控制器或MVC Web应用程序的类(此处:MVC5)发布到服务器,我们应该上传以下文件:

  • MVC5Bootstrap-3-1-1-Less.dll after build
  • 构建后MVC5Bootstrap-3-1-1-Less.dll

  • Added references to the bin folder after build
  • 在构建之后添加了对bin文件夹的引用

Here is a image of how publish DLLs of bin folder from Visual Studio:

这是一个如何从Visual Studio发布bin文件夹的DLL的图像:

只需发布已修改的控制器,模型和ASP.NET MVC项目的某些部分

#2


5  

The publish wizard on the project (right click on project > Publish...) should automatically determine which files have changed and need to be updated, and show you what files will be updated.

项目上的发布向导(右键单击项目>发布...)应自动确定哪些文件已更改并需要更新,并向您显示将更新的文件。

只需发布已修改的控制器,模型和ASP.NET MVC项目的某些部分

After clicking Start Preview:

单击开始预览后:

只需发布已修改的控制器,模型和ASP.NET MVC项目的某些部分

#1


6  

I just published the MVC5Bootstrap-3-1-1-Less.dll and it worked!

我刚刚发布了MVC5Bootstrap-3-1-1-Less.dll,它确实有效!

So if we uploaded a website and then want only publish the new modified controllers or classes of the MVC web application (here: MVC5) to the server, we should upload the following files:

因此,如果我们上传了一个网站,然后只想将新修改的控制器或MVC Web应用程序的类(此处:MVC5)发布到服务器,我们应该上传以下文件:

  • MVC5Bootstrap-3-1-1-Less.dll after build
  • 构建后MVC5Bootstrap-3-1-1-Less.dll

  • Added references to the bin folder after build
  • 在构建之后添加了对bin文件夹的引用

Here is a image of how publish DLLs of bin folder from Visual Studio:

这是一个如何从Visual Studio发布bin文件夹的DLL的图像:

只需发布已修改的控制器,模型和ASP.NET MVC项目的某些部分

#2


5  

The publish wizard on the project (right click on project > Publish...) should automatically determine which files have changed and need to be updated, and show you what files will be updated.

项目上的发布向导(右键单击项目>发布...)应自动确定哪些文件已更改并需要更新,并向您显示将更新的文件。

只需发布已修改的控制器,模型和ASP.NET MVC项目的某些部分

After clicking Start Preview:

单击开始预览后:

只需发布已修改的控制器,模型和ASP.NET MVC项目的某些部分