在ASP.NET Web安装项目中,我可以在IIS中禁用匿名访问吗?(In an ASP.NET Web Setup Project, can I disable anonymous access in IIS?)
我有一个非常简单的ASP.NET Web应用程序和一个Web安装项目,它将项目输出和内容文件部署到IIS中的虚拟目录。
我想要的是MSI自动禁用IIS中该虚拟文件夹的匿名访问。
我怀疑它可以通过在自定义动作DLL中编写一些代码来完成,这是可以接受的,但有没有办法在Web安装项目的设置中执行它?
I have a really simple ASP.NET web application and a web setup project that deploys the project output and content files to a virtual directory in IIS.
What I want is for the MSI to automatically disable Anonymouse Access for that virtual folder in IIS.
I suspect it can probably be done by writing some code in a custom action DLL, that would be acceptable, but is there any way to do it within the the settings of the web setup project?
原文:https://stackoverflow.com/questions/298432
最满意答案
要实现
sh
的&
,避免货物编程和直接使用subprocess
模块:import subprocess etcd = subprocess.Popen('etcd') # continue immediately next_cmd_returncode = subprocess.call('next_cmd') # wait for it # ... run more python here ... etcd.terminate() etcd.wait()
这忽略了异常处理和你关于“守护进程模式”的讨论(如果你想在Python中实现一个守护进程;使用python-daemon 。要将进程作为系统服务运行,请使用你提供的操作系统或监督程序,如
supervisord
) 。To implement
sh
's&
, avoid cargo cult programming and usesubprocess
module directly:import subprocess etcd = subprocess.Popen('etcd') # continue immediately next_cmd_returncode = subprocess.call('next_cmd') # wait for it # ... run more python here ... etcd.terminate() etcd.wait()
This ignores exception handling and your talk about "daemon mode" (if you want to implement a daemon in Python; use python-daemon. To run a process as a system service, use whatever your OS provides or a supervisor program such as
supervisord
).
相关问答
更多-
如何停止调试(或分离进程)而不停止进程?(How to stop debugging (or detach process) without stopping the process?)[2021-10-24]
如果您在混合模式下进行调试,则无法从进程中分离调试器。 确保您在托管或纯模式下进行调试,同时附加到进程:确保在项目选项中未选中“启用本机代码调试”或“本机代码”,或者在未经调试的情况下启动程序,选择“附加到进程“,并且只选择托管或仅选择本地。 You cannot detach a debugger from a process if you are debugging in mixed mode. Make sure you are debugging either in managed or nativ ... -
我怀疑是时间安排了 - 所不同的是,不同之处在于主程序和分叉程序的指令是如何相对运行的。 当你执行Process.detach时,会创建一个等待给定进程的退出结果的新线程。 您可以使用替换Process.detach Thread.new { Process.wait(pid) } 并获得相同的效果。 我怀疑调用detach(并产生一个新线程)会给你的分叉进程,作为一个副作用,一个机会来安排。 如果你没有分离,那么我猜你的分叉过程在你告诉它死的时候没有机会运行。 你可以通过在你的代码中插入一些睡眠调用来查 ...
-
要在调用ExitProcess之后判断您是否在DLL_PROCESS_DETACH期间被调用,您可以为库编写初始化代码,以便在从主程序调用FreeLibrary时执行代码。 如果已经调用了ExitProcess则'lpReserved'参数将为'1',否则为'0': .. var SaveDllProcEx: TDllProcEx; procedure DllMainEx(Reason: Integer; Reserved: Integer); begin if (Reason = DLL_PRO ...
-
在进程窗口(Debug - > Windows - >进程)中,右键单击要分离的进程的名称,然后在快捷菜单上单击“分离进程”。 In the Processes window (Debug -> Windows -> Processes), right-click on the name of the process you want to detach, and on the shortcut menu, click Detach Process.
-
要在不退出shell的情况下分离tty,请使用转义序列Ctrl + p + Ctrl + q 。 详情请见: https : //docs.docker.com/engine/reference/commandline/attach/ To detach the tty without exiting the shell, use the escape sequence Ctrl-p Ctrl-q. more details here: https://docs.docker.com/engine/refe ...
-
事实证明,当debugee 运行时 ,Mdbg不允许你做任何事情。 MgProcess.CorProcess.Stop(0); MgProcess.Detach(); 似乎是前进的方向。 It transpires that Mdbg will not allow you to do anything while the debugee is running. MgProcess.CorProcess.Stop(0); MgProcess.Detach(); Appears to be ...
-
要实现sh的& ,避免货物编程和直接使用subprocess模块: import subprocess etcd = subprocess.Popen('etcd') # continue immediately next_cmd_returncode = subprocess.call('next_cmd') # wait for it # ... run more python here ... etcd.terminate() etcd.wait() 这忽略了异常处理和你关于“守护进程模式”的讨 ...
-
首先,除了第一个进程之外,没有任何进程完全“脱离”任何进程,甚至是操作系统内核。 您可以发现所有其他进程始终有一个根进程。 因此,即使是孩子,也无法开始一个完整的独立过程。 您可以做的是使用multiprocessing模块来避免GIL限制,它是一个独立的进程,通过管道与主进程通信,因此它们不共享相同的内存空间。 关于其他问题: 只要它是有效的描述符,您就可以将stdout和stderr更改为您喜欢的任何内容。 你可以关闭shell = True ...只是为了确保你知道什么是shell = True su ...
-
如何撤消.detach()?(How to I undo .detach()?)[2022-02-22]
问题是:你想在页面上的哪个位置放回元素? 例如,如果所有li元素都返回 -
如何从进程中分离exe(How to detach exe from process)[2022-06-05]
你通常不会。 可执行文件中的Windows页面按需。 当你调用一个不在RAM中的函数时,Windows会加载它(以及它所在的整个页面)。 因此,如果您将分离EXE并且进程将调用仍在磁盘上的函数,则该进程将崩溃。 对于可移动媒体上的应用程序,有一个特殊的/SWAPRUN:CD链接器标志。 它通过制作整个可执行文件的副本来防止崩溃。 You don't, normally. Windows pages in your executable on-demand. When you call a function ...