首页 \ 问答 \ 在ASP.NET Web安装项目中,我可以在IIS中禁用匿名访问吗?(In an ASP.NET Web Setup Project, can I disable anonymous access in IIS?)

在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
更新时间:2021-11-02 22:11

最满意答案

要实现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 use subprocess 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).

相关问答

更多
  • 如果您在混合模式下进行调试,则无法从进程中分离调试器。 确保您在托管或纯模式下进行调试,同时附加到进程:确保在项目选项中未选中“启用本机代码调试”或“本机代码”,或者在未经调试的情况下启动程序,选择“附加到进程“,并且只选择托管或仅选择本地。 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 ...
  • 问题是:你想在页面上的哪个位置放回元素? 例如,如果所有li元素都返回
      您可能会使用以下内容: var items = []; $('li.type').fadeOut(300, function() { items.push( $(this).detach() ); }); $('#replace').click(function() { for(var i = 0; i < items.length; i++) { $("ul#foo ...
    • 你通常不会。 可执行文件中的Windows页面按需。 当你调用一个不在RAM中的函数时,Windows会加载它(以及它所在的整个页面)。 因此,如果您将分离EXE并且进程将调用仍在磁盘上的函数,则该进程将崩溃。 对于可移动媒体上的应用程序,有一个特殊的/SWAPRUN:CD链接器标志。 它通过制作整个可执行文件的副本来防止崩溃。 You don't, normally. Windows pages in your executable on-demand. When you call a function ...

    相关文章

    更多

    最新问答

    更多
  • 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
  • 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
  • OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
  • 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
  • codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
  • 在计算机拍照在哪里进入
  • 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
  • No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
  • 单页应用程序:页面重新加载(Single Page Application: page reload)
  • 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
  • System.StackOverflow错误(System.StackOverflow error)
  • KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
  • 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
  • android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
  • TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
  • 企业安全培训的各项内容
  • 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
  • C#类名中允许哪些字符?(What characters are allowed in C# class name?)
  • NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
  • 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
  • 将多个行和可变行移动到列(moving multiple and variable rows to columns)
  • 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
  • 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
  • Angular $资源不会改变方法(Angular $resource doesn't change method)
  • 在Angular 5中不是一个函数(is not a function in Angular 5)
  • 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
  • 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
  • 常见的python rpc和cli接口(Common python rpc and cli interface)
  • Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
  • 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)