简体   繁体   English

如何在VS 2010 IIS网站中进行Web.config转换而不创建Web应用程序项目?

[英]HowTo Web.config transformation in VS 2010 IIS Website without creating a Web Application Project?

I would like to use web.config transformation but do not see the "Add Config Transforms" in the context menu when i right-click on my original web.config file. 我想使用web.config转换,但是右键单击原始的web.config文件时,在上下文菜单中看不到“添加配置转换”。

I do not have a Web Application Project and cannot have one. 我没有Web应用程序项目,也不能拥有一个。 My solution has a few projects for BLL, DAL etc, then i have a local IIS website for the main Website. 我的解决方案有一些BLL,DAL等项目,然后我有一个本地IIS网站作为主要网站。

在此处输入图片说明

Under my local IIS website i have a web.config and have tried to add a web.Debug.config like such: 在我的本地IIS网站下,我有一个web.config并试图添加一个web.Debug.config,例如: 在此处输入图片说明

How can i do web.config transformation using the localhost IIS website and not having to creating a Web Application Project? 如何使用localhost IIS网站进行web.config转换,而不必创建Web应用程序项目? Is it even possible? 可能吗? Is creating a Web Application Project a requirement? 是否需要创建Web应用程序项目?

在此处输入图片说明

I was recently reading up on this subject and to my knowledge you can not do web.config transformation in a Web Site project for one simple reason – Web Sites don't have project files, which is where the msbuild configurations are stored. 我最近正在阅读有关此主题的文章,据我所知,由于一个简单的原因,您无法在Web站点项目中进行web.config转换– Web站点没有项目文件,该文件是msbuild配置的存储位置。 So if you need that functionality you will have to create a project file. 因此,如果您需要该功能,则必须创建一个项目文件。 But have a look at this blog which I think gives a better explanation for this. 但是,请看一下这个博客,我认为它可以对此提供更好的解释。

http://andrewtwest.com/2010/02/25/using-web-config-transformations-in-web-site-projects/ http://andrewtwest.com/2010/02/25/using-web-config-transformations-in-web-site-projects/

Having said that if you do find out that im wrong, which i might be please keep me updated with what was your solution 话虽如此,如果您确实发现我的意思是错误的,那么我可能会告诉我您的解决方案是什么

Thanks 谢谢

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM