<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:pingback="http://madskills.com/public/xml/rss/module/pingback/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0">
  <channel>
    <title>Oren Ellenbogen's Blog - WebServices</title>
    <link>http://lnbogen.com/</link>
    <description>Striving for agile development</description>
    <language>en-us</language>
    <copyright>Oren Ellenbogen</copyright>
    <lastBuildDate>Wed, 20 Sep 2006 14:12:17 GMT</lastBuildDate>
    <generator>newtelligence dasBlog 2.2.8279.16125</generator>
    <managingEditor>oren.ellenbogen@gmail.com</managingEditor>
    <webMaster>oren.ellenbogen@gmail.com</webMaster>
    <item>
      <trackback:ping>http://lnbogen.com/Trackback.aspx?guid=f4a771a9-0cec-45fd-afc0-8a0b5a6fb8c4</trackback:ping>
      <pingback:server>http://lnbogen.com/pingback.aspx</pingback:server>
      <pingback:target>http://lnbogen.com/PermaLink,guid,f4a771a9-0cec-45fd-afc0-8a0b5a6fb8c4.aspx</pingback:target>
      <dc:creator>Oren Ellenbogen</dc:creator>
      <wfw:comment>http://lnbogen.com/CommentView,guid,f4a771a9-0cec-45fd-afc0-8a0b5a6fb8c4.aspx</wfw:comment>
      <wfw:commentRss>http://lnbogen.com/SyndicationService.asmx/GetEntryCommentsRss?guid=f4a771a9-0cec-45fd-afc0-8a0b5a6fb8c4</wfw:commentRss>
      <slash:comments>2</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
          <strong>&lt;rational thinking&gt;</strong>
        </p>
        <p>
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-&gt;Properties-&gt;Build
Tab-&gt;and changing the Output path to whatever we need.
</p>
        <p>
          <img height="301" alt="OutputPath.gif" src="http://www.lnbogen.com/content/binary/OutputPath.gif" width="400" border="0" />
        </p>
        <p>
(Instead of "bin\" we can write here "..\..\infrastructure" for example)
</p>
        <p>
          <br />
We then build the all thing and surprise surprise, the <strong>new output path</strong> contains
all the dlls as expected. Awesome! 
<br />
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-&gt;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.
</p>
        <p>
Happy as a little girl with a new puppy, I enter my site: <a href="http://localhost/webapp1/Default.aspx">http://localhost/webapp1/Default.aspx</a> and
Oops!
</p>
        <p>
          <img height="209" alt="OutputPathUnableToFindClass.gif" src="http://www.lnbogen.com/content/binary/OutputPathUnableToFindClass.gif" width="400" border="0" />
        </p>
        <p>
The page can't find its "code behind"(The class that it inherits from)! What the hack
is going on here!? 
</p>
        <p>
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 <strong>the Publish process simply copy all the files from the bin directory into
the new(Published) bin directory</strong>. No questions asked. The Publish algorithm <strong>do
not</strong> check if you actually compile your dlls into another directory via Output
path and taking it into account.
</p>
        <p>
          <strong>&lt;/rational thinking&gt;</strong>
        </p>
        <p>
          <strong>&lt;effective thinking&gt;</strong>
        </p>
        <p>
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:
</p>
        <p>
          <img height="304" alt="OutputPathUsePostBuild.gif" src="http://www.lnbogen.com/content/binary/OutputPathUsePostBuild.gif" width="400" border="0" />
        </p>
        <p>
(The command: xcopy /Y /S ${TargetDir}*.* ..\..\Infrastructure)
</p>
        <p>
          <strong>&lt;/effective thinking&gt;</strong>
        </p>
        <p>
          <br />
May it save you the 15 minutes it took me and my teammate Hagay to solve this one.
</p>
        <img width="0" height="0" src="http://lnbogen.com/aggbug.ashx?id=f4a771a9-0cec-45fd-afc0-8a0b5a6fb8c4" />
      </body>
      <title>Changing the Output Path in your Web Applications is a bad idea</title>
      <guid isPermaLink="false">http://lnbogen.com/PermaLink,guid,f4a771a9-0cec-45fd-afc0-8a0b5a6fb8c4.aspx</guid>
      <link>http://lnbogen.com/2006/09/20/ChangingTheOutputPathInYourWebApplicationsIsABadIdea.aspx</link>
      <pubDate>Wed, 20 Sep 2006 14:12:17 GMT</pubDate>
      <description>&lt;p&gt;
&lt;strong&gt;&amp;lt;rational thinking&amp;gt;&lt;/strong&gt;
&lt;/p&gt;
&lt;p&gt;
Let's assume we have&amp;nbsp;a WebSite(the same issue applied to WebService btw) named
WebApplication1. Now, we want to put&amp;nbsp;its(the website's)&amp;nbsp;output files into
some other directory&amp;nbsp;(!= "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&amp;nbsp;"rational" programmer nature&amp;nbsp;and Right-Click on the project-&amp;gt;Properties-&amp;gt;Build
Tab-&amp;gt;and changing the Output path to whatever we need.
&lt;/p&gt;
&lt;p&gt;
&lt;img height=301 alt=OutputPath.gif src="http://www.lnbogen.com/content/binary/OutputPath.gif" width=400 border=0&gt;
&lt;/p&gt;
&lt;p&gt;
(Instead of "bin\" we can write here "..\..\infrastructure" for example)
&lt;/p&gt;
&lt;p&gt;
&lt;br&gt;
We then build the all thing and surprise surprise, the &lt;strong&gt;new output path&lt;/strong&gt; contains
all the dlls as expected. Awesome! 
&lt;br&gt;
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-&amp;gt;Publish... A few really easy
"decisions" and ~10 seconds later, VS.NET tells(it speaks to me, I swear)&amp;nbsp;me
that my site was published successfully.
&lt;/p&gt;
&lt;p&gt;
Happy as a little girl with a new puppy, I enter my site: &lt;a href="http://localhost/webapp1/Default.aspx"&gt;http://localhost/webapp1/Default.aspx&lt;/a&gt; and
Oops!
&lt;/p&gt;
&lt;p&gt;
&lt;img height=209 alt=OutputPathUnableToFindClass.gif src="http://www.lnbogen.com/content/binary/OutputPathUnableToFindClass.gif" width=400 border=0&gt;
&lt;/p&gt;
&lt;p&gt;
The page can't find its "code behind"(The class that it inherits from)! What the hack
is going on here!? 
&lt;/p&gt;
&lt;p&gt;
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 &lt;strong&gt;the Publish process simply copy all the files from the bin directory into
the new(Published) bin directory&lt;/strong&gt;. No questions asked. The Publish algorithm &lt;strong&gt;do
not&lt;/strong&gt; check if you actually compile your dlls into another directory via Output
path and taking it into account.
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;&amp;lt;/rational thinking&amp;gt;&lt;/strong&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;&amp;lt;effective thinking&amp;gt;&lt;/strong&gt;
&lt;/p&gt;
&lt;p&gt;
Fortunately for us, the solution is pretty easy:&amp;nbsp;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:
&lt;/p&gt;
&lt;p&gt;
&lt;img height=304 alt=OutputPathUsePostBuild.gif src="http://www.lnbogen.com/content/binary/OutputPathUsePostBuild.gif" width=400 border=0&gt;
&lt;/p&gt;
&lt;p&gt;
(The command: xcopy /Y /S ${TargetDir}*.* ..\..\Infrastructure)
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;&amp;lt;/effective thinking&amp;gt;&lt;/strong&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;br&gt;
May it save you the 15 minutes it took me and my teammate Hagay to solve this one.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://lnbogen.com/aggbug.ashx?id=f4a771a9-0cec-45fd-afc0-8a0b5a6fb8c4" /&gt;</description>
      <comments>http://lnbogen.com/CommentView,guid,f4a771a9-0cec-45fd-afc0-8a0b5a6fb8c4.aspx</comments>
      <category>.NET</category>
      <category>.NET/ASP.NET</category>
      <category>WebServices</category>
    </item>
    <item>
      <trackback:ping>http://lnbogen.com/Trackback.aspx?guid=bd7e858a-e5ee-4e24-a84f-c686808288d2</trackback:ping>
      <pingback:server>http://lnbogen.com/pingback.aspx</pingback:server>
      <pingback:target>http://lnbogen.com/PermaLink,guid,bd7e858a-e5ee-4e24-a84f-c686808288d2.aspx</pingback:target>
      <dc:creator>Oren Ellenbogen</dc:creator>
      <wfw:comment>http://lnbogen.com/CommentView,guid,bd7e858a-e5ee-4e24-a84f-c686808288d2.aspx</wfw:comment>
      <wfw:commentRss>http://lnbogen.com/SyndicationService.asmx/GetEntryCommentsRss?guid=bd7e858a-e5ee-4e24-a84f-c686808288d2</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
The solution is pretty simple, just add the support(<strong>in bold</strong>) for
the httpPost protocol in your web.config file:
</p>
        <p>
&lt;?xml version="1.0" encoding="utf-8"?&gt;<br />
&lt;configuration xmlns="<a href="http://schemas.microsoft.com/.NetConfiguration/v2.0">http://schemas.microsoft.com/.NetConfiguration/v2.0</a>"&gt;<br />
    &lt;system.web&gt;<br />
       <strong>&lt;webServices&gt;  <br />
        &lt;protocols&gt;   <br />
            &lt;add name="HttpPost"/&gt;  <br />
        &lt;/protocols&gt; <br />
       &lt;/webServices&gt;<br /></strong>    &lt;/system.web&gt;<br />
&lt;/configuration&gt;
</p>
        <p>
Publishing the WebService do not automatically add these lines so you'll have
to do it manually.
</p>
        <img width="0" height="0" src="http://lnbogen.com/aggbug.ashx?id=bd7e858a-e5ee-4e24-a84f-c686808288d2" />
      </body>
      <title>Missing Invoke button while trying to activate WebMethod from the explorer</title>
      <guid isPermaLink="false">http://lnbogen.com/PermaLink,guid,bd7e858a-e5ee-4e24-a84f-c686808288d2.aspx</guid>
      <link>http://lnbogen.com/2006/09/17/MissingInvokeButtonWhileTryingToActivateWebMethodFromTheExplorer.aspx</link>
      <pubDate>Sun, 17 Sep 2006 09:43:36 GMT</pubDate>
      <description>&lt;p&gt;
The&amp;nbsp;solution is pretty simple, just add the support(&lt;strong&gt;in bold&lt;/strong&gt;)&amp;nbsp;for
the httpPost protocol&amp;nbsp;in your web.config file:
&lt;/p&gt;
&lt;p&gt;
&amp;lt;?xml version="1.0" encoding="utf-8"?&amp;gt;&lt;br&gt;
&amp;lt;configuration xmlns="&lt;a href="http://schemas.microsoft.com/.NetConfiguration/v2.0"&gt;http://schemas.microsoft.com/.NetConfiguration/v2.0&lt;/a&gt;"&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;system.web&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;strong&gt;&amp;lt;webServices&amp;gt;&amp;nbsp;&amp;nbsp;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;protocols&amp;gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;add name="HttpPost"/&amp;gt;&amp;nbsp;&amp;nbsp;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;/protocols&amp;gt;&amp;nbsp;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;/webServices&amp;gt;&lt;br&gt;
&lt;/strong&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/system.web&amp;gt;&lt;br&gt;
&amp;lt;/configuration&amp;gt;
&lt;/p&gt;
&lt;p&gt;
Publishing the WebService do not&amp;nbsp;automatically add these lines so you'll have
to do it manually.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://lnbogen.com/aggbug.ashx?id=bd7e858a-e5ee-4e24-a84f-c686808288d2" /&gt;</description>
      <comments>http://lnbogen.com/CommentView,guid,bd7e858a-e5ee-4e24-a84f-c686808288d2.aspx</comments>
      <category>.NET</category>
      <category>WebServices</category>
    </item>
  </channel>
</rss>