MapPath 或在安装应用程序中使用的等效项
我需要检查安装应用程序中的 .config 文件(WIX 项目中的 iis 自定义操作)。用户选择一个网站并输入虚拟目录名称。我无法执行 http 读取来检索配置文件,因为 ASP.NET 不提供配置文件。
如何找到所选网站和虚拟目录的本地磁盘路径?
I need to check a .config file in an installation application (iis custom action in a WIX project). The user picks a website and enters a virtual directory name. I can't do a http read to retrieve the config file as ASP.NET does not serve config files.
How can I find the local disk path of the selected website and virtual directory?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
经过进一步搜索,我最终使用了 DirectoryServices。我在这里为其他人发布我的解决方案。
如果还有更好的方法,欢迎留言。
After further searching, I ended up using DirectoryServices. I'm posting my solution here for others.
If there is a better way, please still post it.
您是否尝试过使用标准 WiX IIsExtension 来实现此目的?只需捕获属性中的用户输入,然后使用标准元素,例如 iis:WebSite 和 iis:WebVirtualDir 在适当的网站中创建虚拟目录。
Have you tried using the standard WiX IIsExtension for this? Just capture the user input in a property, and then use standard elements like iis:WebSite and iis:WebVirtualDir to create a virtual directory in appropriate web site.