<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://forums.asp.net/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>WCF REST Starter Kit</title><link>http://forums.asp.net/1180.aspx</link><description>Discuss the WCF REST Starter Kit and other WCF REST topics.</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP1 (Build: 20510.895)</generator><item><title>Re: The different using "using" and not in service host</title><link>http://forums.asp.net/thread/3272384.aspx</link><pubDate>Thu, 02 Jul 2009 23:34:08 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3272384</guid><dc:creator>randallt</dc:creator><author>randallt</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3272384.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1180&amp;PostID=3272384</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;Yes Ronald, you are right.&amp;nbsp; The first code snippet opens the service host and then closes it right after as it exits the using block.&lt;/p&gt;</description></item><item><title>Re: The different using "using" and not in service host</title><link>http://forums.asp.net/thread/3262955.aspx</link><pubDate>Sun, 28 Jun 2009 23:01:56 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3262955</guid><dc:creator>ronald_yoh</dc:creator><author>ronald_yoh</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3262955.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1180&amp;PostID=3262955</wfw:commentRss><description>&lt;p&gt;I think i figured out what the problem was...&lt;/p&gt;&lt;p&gt;at a glance, the two codes are looking the same but they&amp;#39;re not... as you might have been aware in c# that the using keyword will call the disposal method (to execute the garbage collector) at the end of the statement which will return back the memory allocation (reference type) back to heap.&lt;/p&gt;&lt;p&gt;In this case, the using keyword will call sh.close() once it reaches the closing block.&lt;/p&gt;&lt;p&gt;let me know if you have any further comments.&lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: The different using "using" and not in service host</title><link>http://forums.asp.net/thread/3259311.aspx</link><pubDate>Fri, 26 Jun 2009 06:09:37 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3259311</guid><dc:creator>integrasol</dc:creator><author>integrasol</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3259311.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1180&amp;PostID=3259311</wfw:commentRss><description>&lt;p&gt;I don&amp;#39;t see any difference between the two pieces of code. However, I do need to check where you try to add the service reference, and how and where you dispose of the ServiceHost for the second piece of code.&lt;/p&gt;</description></item><item><title>The different using "using" and not in service host</title><link>http://forums.asp.net/thread/3259021.aspx</link><pubDate>Fri, 26 Jun 2009 01:59:54 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3259021</guid><dc:creator>ronald_yoh</dc:creator><author>ronald_yoh</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3259021.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1180&amp;PostID=3259021</wfw:commentRss><description>&lt;p&gt;does anyone know the diff between the two code:&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;pre name="code" class="c-sharp"&gt;using (ServiceHost sh = new ServiceHost(typeof(ServiceLib.WCFServiceMath.MathService)))
{
	sh.Open();
}
&lt;/pre&gt;&lt;br /&gt; &lt;pre name="code" class="c-sharp"&gt;ServiceHost sh;
sh = new ServiceHost(typeof(ServiceLib.WCFServiceMath.MathService));
sh.Open();

&lt;/pre&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt; The first one is not working correctly (meaning it does not hosting the endpoint - cannot find the service while trying to add the service reference)&lt;/p&gt;&lt;p&gt;the second one is working fine.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;any advice?&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;</description></item></channel></rss>