惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

博客园 - 三生石上(FineUI控件)
Blog — PlanetScale
Blog — PlanetScale
B
Blog
GbyAI
GbyAI
爱范儿
爱范儿
月光博客
月光博客
N
Netflix TechBlog - Medium
T
Tailwind CSS Blog
G
Google Developers Blog
大猫的无限游戏
大猫的无限游戏
Vercel News
Vercel News
H
Hackread – Cybersecurity News, Data Breaches, AI and More
WordPress大学
WordPress大学
The GitHub Blog
The GitHub Blog
Recent Announcements
Recent Announcements
腾讯CDC
MyScale Blog
MyScale Blog
V
Visual Studio Blog
The Cloudflare Blog
Microsoft Security Blog
Microsoft Security Blog
A
About on SuperTechFans
Google DeepMind News
Google DeepMind News
Last Week in AI
Last Week in AI
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻

博客园 - Dot-Boy

突然发现我的时间停留在2010年5月14日 vc中遇到错误提示:nafxcwd.lib(thrdcore.obj) : error LNK2001: unresolved external symbol __endthreadex VSS配置外部对比工具Beyond Compare C#程序集使用强名字(Strong Name)签名/强名称签名 应用程序试图执行安全策略不允许的操作。要授予此应用程序所需的权限,请与系统管理员联系,或在配置文件中更改该应用程序的信任级别 C#程序脱离.net框架的多种方法与应用 理解 Thread.Sleep 函数 SQL2005安装问题 性能监视器计数器要求 (错误) 及超强解决办法 sqlserver 大小写敏感 Lambda 表达式 SQL Server 中取得字段说明(转载) SQL Server 2005 中的分区表和索引 Analysis Services 2005中数据完整性处理(转载) 在 Microsoft Windows Server 2003 上配置对 SQL Server 2005 Analysis Services 的 HTTP 访问 jquery 弹出浮层(div) + 遮蔽层 - Dot-Boy 防止重复提交的方式 - Dot-Boy - 博客园 解决mysqlclient无法转换无效的时间类型 - Dot-Boy - 博客园 实现在表单内按回车键,执行指定按钮的事件 - Dot-Boy - 博客园 计算程序段运行时间
Programatically recycle an IIS application pool
Dot-Boy · 2009-07-29 · via 博客园 - Dot-Boy

One of the many banes in my life is waiting for IIS to reset.  When developing certain components, like a webpart or webcontrol, I often use a post-build event to gac the assembly and issue an iisreset.  This is necessary for IIS to pick up the latest assembly from the GAC.  Recycling the app pool also forces IIS to reload the assembly, but I never could find a command I could issue from my post-build batch file to automate this.  Well, now I don't need to look because I just wrote my own utility to recycle the application pool:

using System;
using System.Collections.Generic;
using System.Text;
using System.DirectoryServices;

namespace AppPoolRecycler
{
    class Program
    {
        static void Main(string[] args)
        {
            if (args.Length != 2)
            {
                Console.WriteLine("Usage:\tapppoolrecycler.exe machine apppool\n\tapppoolrecycler.exe localhost mypool");
                return;
            }
            try
            {
                string sMachine = args[0];
                string sAppPool = args[1];

                string sPath = "IIS://" + sMachine + "/W3SVC/AppPools/" + sAppPool;
                Console.WriteLine(sPath);
                DirectoryEntry w3svc = new DirectoryEntry(sPath);
                w3svc.Invoke("Recycle", null);
                Console.WriteLine("Application pool recycled");
            }
            catch (Exception ex)
            {
                Console.WriteLine("Error: " + ex.Message);
            }
        }
    }
}

Now in my post build event I can gac my assembly and recycle the app pool which is much faster than a reset.

AppPoolRecycler.exe sanpaula mssharepointportalapppool

Take a look at this blog entry for more information: http://blogs.aspitalia.com/daniele/post555/Riciclare-Application-Pool-IIS-Codice-CSharp.aspx

 -----------------------

Update!  I've recently come across a way to do this using a script which should be installed on W2003: 

c:\windows\system32\iisapp.vbs /a mssharepointportalapppool /r