Changing the Output Path in your Web Applications is a bad idea
http://lnbogen.com/2006/09/20/changing-the-output-path-in-your-web-applications-is-a-bad-idea/
Let’s assume we have a WebSite(the same issue applied to WebService btw) named WebApplication1.
Now, we want to put its(the website’s) output files into some other directory (!= “bin” directory) for development reasons (working as part of a team with some sophisticated复杂的 Source Safe).
What’s the first thing you (and me) do? we use our “rational”合理的 programmer nature and Right-Click on the project->Properties->Build Tab->and changing the Output path to whatever we need.
(Instead of “bin\” we can write here “..\..\infrastructure” for example)
We then build the all thing and surprise surprise, the new output pathcontains all the dlls as expected. Awesome! 
Satisfied with the greatness of Visual Studio .Net 2005, we now want to Publish the WebSite so we(or the QA) can play with it.
“Think as a developer, think as a developer” I say to myself and Right-Click the WebSite project->Publish… A few really easy “decisions” and ~10 seconds later, VS.NET tells(it speaks to me, I swear) me that my site was published successfully.
Happy as a little girl with a new puppy小狗, I enter my site:http://localhost/webapp1/Default.aspx and Oops哎哟!
The page can’t find its “code behind”(The class that it inherits from)! What the hack is going on here!?
Well, it turns out that the Publish process is not as smart as you may think it should be.
Changing our Output path to another directory (!= “bin”) caused this all mess as the Publish process simply copy all the files from the bin directory into the new(Published) bin directory.
No questions asked. The Publish algorithm do not check if you actually compile your dlls into another directory via Output path and taking it into account.
Fortunately for us, the solution is pretty easy: define your Output path into the original location (“bin\”) and use the Build Events(post-build in this scenario) in order to copy the output files into your “infrastructure”(or whatever) directory like this:
(The command: xcopy /Y /S ${TargetDir}*.* ..\..\Infrastructure)
May it save you the 15 minutes it took me and my teammate Hagay to solve this one.
Changing the Output Path in your Web Applications is a bad idea的更多相关文章
- [Windows Azure] Developing Multi-Tenant Web Applications with Windows Azure AD
		
Developing Multi-Tenant Web Applications with Windows Azure AD 2 out of 3 rated this helpful - Rate ...
 - Changing the Output Voltage of a Switching Regulator on the Fly
		
http://www.powerguru.org/changing-the-output-voltage-of-a-switching-regulator-on-the-fly/ There are ...
 - Developing RIA Web Applications with Oracle ADF
		
Developing RIA Web Applications with Oracle ADF Purpose This tutorial shows you how to build a ric ...
 - Combining HTML5 Web Applications with OpenCV
		
The Web Dev Zone is brought to you by Stormpath—offering a pre-built Identity API for developers. Ea ...
 - Can't remove netstandard folder from output path (.net standard)
		
https://developercommunity.visualstudio.com/content/problem/30940/cant-remove-netstandard-folder-fro ...
 - Model-View-Controller(MVC) is an architectural pattern that frequently used in web applications. Which of the following statement(s) is(are) correct?
		
Model-View-Controller(MVC) is an architectural pattern that frequently used in web applications. Whi ...
 - FindBugs:Compiler output path for module can not be null. check your module/project settings问题原因
		
这可能是很多人在使用Android studio 该插件会发现此错误信息:Compiler output path for module can not be null. check your mod ...
 - Progressive Web Applications
		
Progressive Web Applications take advantage of new technologies to bring the best of mobile sites an ...
 - Setting up Scatter for Web Applications
		
[Setting up Scatter for Web Applications] If you are still using scatter-js please move over to scat ...
 
随机推荐
- eclipse 新建 maven 项目 + 消除错误
			
安装eclips以及maven自行去了解,这里不讲解 一.新建一个 maven 项目. 二.下一步选择项目架构 三.填写相关信息 group id: 一般都是 com点 项目名 aftriact.id ...
 - java基础学习之垃圾回收机制
			
回收过程: 1.发现无用的对象 2.回收无用对象占用的内存的空间. 垃圾回收相关算法: 1.引用计数法 堆中每个对象都有一个引用计数.被引用一次,计数加一.被引用变量值变为null,则计数减一. 到计 ...
 - RC: blkio throttle 测试
			
本文将测试一下使用cgroup的blkio组来控制IO吞吐量 : 测试环境CentOS 7.x x64 创建一个继承组 [root@150 rg1]# cd /sys/fs/cgroup/blkio/ ...
 - 个人总结的常用java,anroid网站
			
http://blog.csdn.net/wanghao200906/article/details/49334987
 - [Algorithm] 3. Digit Counts
			
Description Count the number of k's between 0 and n. k can be 0 - 9. Example if n = 12, k = 1 in [0, ...
 - SIMD学习  --  用SSE2指令作点乘和累加计算
			
这几天在做学校的一个学习小项目,需要用到SIMD指令计算提速.也是第一次碰这个,看了一些资料和代码,模仿着写了两个函数. void sse_mul_float(float *A, float *B, ...
 - UVA - 11214  Guarding the Chessboard(迭代加深搜索)
			
题目: 输入一个n*m的棋盘(n,m<10),某些格子有标记,用最少的皇后守卫(即占据或攻击)所有的标记的格子.输出皇后的个数. 思路: 一开始没有想到用迭代加深搜索,直接dfs结果还没写完就发 ...
 - Spring SpEL 各种写法示例
			
项目路径 先说一下三个bean都有哪些属性 Address.java private String city;//城市 private String street;//街道 Car.java priv ...
 - 【Codeforces 1034A】Enlarge GCD
			
[链接] 我是链接,点我呀:) [题意] 题意 [题解] 设原来n个数字的gcd为g 减少某些数字之后 新的gcd肯定是g的倍数 即gx 我们可以枚举这个x值(x>=2) 看看原来的数字里面有多 ...
 - HDU 5291 Candy Distribution
			
Candy Distribution Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Other ...