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的更多相关文章

  1. [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 ...

  2. 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 ...

  3. Developing RIA Web Applications with Oracle ADF

      Developing RIA Web Applications with Oracle ADF Purpose This tutorial shows you how to build a ric ...

  4. 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 ...

  5. Can't remove netstandard folder from output path (.net standard)

    https://developercommunity.visualstudio.com/content/problem/30940/cant-remove-netstandard-folder-fro ...

  6. 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 ...

  7. 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 ...

  8. Progressive Web Applications

    Progressive Web Applications take advantage of new technologies to bring the best of mobile sites an ...

  9. Setting up Scatter for Web Applications

    [Setting up Scatter for Web Applications] If you are still using scatter-js please move over to scat ...

随机推荐

  1. 梦想CAD控件COM接口文字样式

    增加文字样式 用户可以增加文字样式到数据库,并设置其字体等属性,具体实现c#代码如下: private void CreateText() { MxDrawApplication app = new ...

  2. elk 6.3.2 搭建

    CentOS7和java1.8.0)   然后登陆elastic的官网地址下载ELK组件:https://www.elastic.co/cn/products 我是下载了6.3.0版本的: elast ...

  3. css--小白入门篇3

    一.上篇知识复习 css属性,面试的时候会有笔试,笔试没有智能感应的: ● 加粗,倾斜,下划线: 1 font-weight:bold; 2 font-style:italic; 3 text-dec ...

  4. 洛谷——P1850 换教室

    P1850 换教室 有 2n 节课程安排在 nn 个时间段上.在第 i个时间段上,两节内容相同的课程同时在不同的地点进行,其中,牛牛预先被安排在教室 $c_i$​ 上课,而另一节课程在教室 $d_i$ ...

  5. 39页第7题 计算2的i次方之和

    /*计算2的i次方之和*/ #include<stdio.h> #include<math.h>/*调用math.h文件中的函数*/ int main(void) { int ...

  6. CCF201703-2 学生排队 java(100分)

    试题编号: 201703-2 试题名称: 学生排队 时间限制: 1.0s 内存限制: 256.0MB 问题描述: 问题描述 体育老师小明要将自己班上的学生按顺序排队.他首先让学生按学号从小到大的顺序排 ...

  7. 教你如何使用Python写游戏辅助脚本

    主要实现方式是通过图片的对比,在游戏中就行点击.运行程序需要以下东西. PIL: 图片处理模块     (python3 换成了 pillow)  下载地址: https://www.lfd.uci. ...

  8. LINUX-SWAP文件系统

    mkswap /dev/hda3 创建一个swap文件系统 swapon /dev/hda3 启用一个新的swap文件系统 swapon /dev/hda2 /dev/hdb3 启用两个swap分区

  9. Java基础学习总结(83)——Java泛型总结

    1. 什么是泛型? 泛型(Generic type 或者 generics)是对 Java 语言的类型系统的一种扩展,以支持创建可以按类型进行参数化的类.可以把类型参数看作是使用参数化类型时指定的类型 ...

  10. [luoguP3052] [USACO12MAR]摩天大楼里的奶牛Cows in a Skyscraper(DP)

    传送门 输出被阉割了. 只输出最少分的组数即可. f 数组为结构体 f[S].cnt 表示集合 S 最少的分组数 f[S].v 表示集合 S 最少分组数下当前组所用的最少容量 f[S] = min(f ...