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

推荐订阅源

P
Privacy & Cybersecurity Law Blog
V
V2EX
月光博客
月光博客
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
The Register - Security
The Register - Security
MongoDB | Blog
MongoDB | Blog
P
Privacy International News Feed
The Last Watchdog
The Last Watchdog
Security Archives - TechRepublic
Security Archives - TechRepublic
美团技术团队
Stack Overflow Blog
Stack Overflow Blog
博客园 - 司徒正美
博客园 - 三生石上(FineUI控件)
V
Visual Studio Blog
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
K
Kaspersky official blog
S
Secure Thoughts
T
Tenable Blog
Security Latest
Security Latest
The Cloudflare Blog
S
Security @ Cisco Blogs
H
Heimdal Security Blog
aimingoo的专栏
aimingoo的专栏
TaoSecurity Blog
TaoSecurity Blog
Blog — PlanetScale
Blog — PlanetScale
Microsoft Security Blog
Microsoft Security Blog
Schneier on Security
Schneier on Security
Webroot Blog
Webroot Blog
G
Google Developers Blog
www.infosecurity-magazine.com
www.infosecurity-magazine.com
Scott Helme
Scott Helme
IT之家
IT之家
Latest news
Latest news
The Hacker News
The Hacker News
C
Check Point Blog
T
The Exploit Database - CXSecurity.com
H
Hackread – Cybersecurity News, Data Breaches, AI and More
腾讯CDC
C
CERT Recently Published Vulnerability Notes
NISL@THU
NISL@THU
N
News | PayPal Newsroom
Forbes - Security
Forbes - Security
P
Palo Alto Networks Blog
S
Security Affairs
S
Securelist
Google Online Security Blog
Google Online Security Blog
WordPress大学
WordPress大学
Last Week in AI
Last Week in AI
C
Cybersecurity and Infrastructure Security Agency CISA
A
About on SuperTechFans

博客园 - 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