你如何部署网站上编译CS文件修改?可能吗? [英] How do you compiling cs file modification on a deployed website? Is it possible?

查看:245
本文介绍了你如何部署网站上编译CS文件修改?可能吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果这已被问过,我很抱歉。

If this has been asked before, I apologize.

如果我有一个当前部署的ASP.Net C#的网站,有需要在一个CS文件略有错误或修改,将有可能修改CS文件,并具有IIS重新编译ASP.Net网站,而不是使用Visual Studio或SharpDevelop的重建网站?

If I had a currently deployed ASP.Net C# website which had a slight bug or modification needed in a cs file, would it be possible to modify the cs file and have IIS recompile the ASP.Net website rather than using Visual Studio or SharpDevelop to rebuild the site?

我熟悉那里的变化被自动编译PHP的网站。有没有办法让ASP.Net或IIS做类似于一个ASP.Net网站code-隐藏文件?

I'm familiar with PHP websites where a change is compiled automatically. Is there a way to get ASP.Net or IIS to do something similar to the code-behind files of an ASP.Net website?

据我了解,修改web.config文件可能会强制进行重新编译,并修改文件ASPX自动显示变化,但我没有找到文件后面的code同样的成功。

I understand that modifying the web.config file may force a recompile, and modifying the ASPx files automatically displays the changes, but I haven't found the same success in the code behind files.

感谢您。

修改(回答以下):

使用现有的资源(包括解决方案文件),以重新编译现有的ASP.Net网站上的命令是这样的:

The command to recompile an existing ASP.Net website using existing sources (including the solution file) is this:

%windir%\microsoft.net\framework\v4.0.30319\msbuild /m Solution.sln /p:Configuration=Debug
@IF %ERRORLEVEL% NEQ 0 GOTO err
@exit /B 0
:err
@PAUSE
@exit /B 1

以上code粘贴到您的解决方案目录中的批处理文件。更改Solution.sln到您的解决方案文件中,修改的框架,以配合您安装的版本。您可以更改配置选项以释放为好。

Paste the above code into a batch file within your solution directory. Change the Solution.sln to your solution file, modify the framework to match your installed version. You can change the Configuration option to "Release" as well.

*批处理文件code。在此基础上论坛后的想法: http://community.sharpdevelop.net/forums/t/ 8281.aspx

* Batch file code used from SharpDevelop source code. Idea based on this forum post: http://community.sharpdevelop.net/forums/t/8281.aspx

推荐答案

要重新编译使用现有的资源(包括解决方案文件)的现有ASP.Net网站上的命令是这样的:

The command to recompile an existing ASP.Net website using existing sources (including the solution file) is this:

%windir%\microsoft.net\framework\v4.0.30319\msbuild /m Solution.sln /p:Configuration=Debug
@IF %ERRORLEVEL% NEQ 0 GOTO err
@exit /B 0
:err
@PAUSE
@exit /B 1

以上code粘贴到您的解决方案目录中的批处理文件。更改Solution.sln到您的解决方案文件中,修改的框架,以配合您安装的版本。您可以更改配置选项以释放为好。

Paste the above code into a batch file within your solution directory. Change the Solution.sln to your solution file, modify the framework to match your installed version. You can change the Configuration option to "Release" as well.

*批处理文件code。在此基础上论坛后的想法: http://community.sharpdevelop.net/forums/t/ 8281.aspx

* Batch file code used from SharpDevelop source code. Idea based on this forum post: http://community.sharpdevelop.net/forums/t/8281.aspx

这篇关于你如何部署网站上编译CS文件修改?可能吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆