<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearchrss/1.0/" xmlns:georss="http://www.georss.org/georss" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0"><channel><atom:id>tag:blogger.com,1999:blog-19967453</atom:id><lastBuildDate>Fri, 06 Nov 2009 05:20:08 +0000</lastBuildDate><title>Musings of a Software Developer</title><description>Tests take time...development's quicker.</description><link>http://krishnabhargav.blogspot.com/</link><managingEditor>krishnabhargav@yahoo.com (Bhargav--------------------------------------------)</managingEditor><generator>Blogger</generator><openSearch:totalResults>168</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>5</openSearch:itemsPerPage><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" href="http://feeds.feedburner.com/truebuddi" type="application/rss+xml" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com" /><item><guid isPermaLink="false">tag:blogger.com,1999:blog-19967453.post-7610987258151510555</guid><pubDate>Fri, 06 Nov 2009 05:20:00 +0000</pubDate><atom:updated>2009-11-05T21:20:08.586-08:00</atom:updated><title>Problem running Scala</title><description>&lt;p&gt;I was just trying to run scala on my machine and failed to do so with an error message “…..\java.exe unexpected at this time.” Look at the screenshot shown below.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh5.ggpht.com/_Oy9HuksgrdU/SvOyB_1mOMI/AAAAAAAABHQ/KTkg54VOgJ0/s1600-h/image%5B6%5D.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://lh6.ggpht.com/_Oy9HuksgrdU/SvOyCOu-IwI/AAAAAAAABHU/HlacqeXVaUw/image_thumb%5B2%5D.png?imgmax=800" width="644" height="327" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Well, the problem was that environment variables for JAVA was set up using JAVA_HOME variable. The JAVA_HOME environment variable was pointing to the JDK directory and the Path was modified to include the “%JAVA_HOME%\bin” directory.&lt;/p&gt;  &lt;p&gt;I removed the JAVA_HOME and then modified the path to specify the complete path to the JDK bin folder and it works now. :)&lt;/p&gt;  &lt;p&gt;I might be talking more about Scala in the future, the concurrency scala supports appears to be interesting.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19967453-7610987258151510555?l=krishnabhargav.blogspot.com'/&gt;&lt;/div&gt;</description><link>http://feedproxy.google.com/~r/truebuddi/~3/rXDIrHfoyxo/problem-running-scala.html</link><author>krishnabhargav@yahoo.com (Bhargav--------------------------------------------)</author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://krishnabhargav.blogspot.com/2009/11/problem-running-scala.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-19967453.post-8422988679565280152</guid><pubDate>Tue, 01 Sep 2009 03:05:00 +0000</pubDate><atom:updated>2009-08-31T20:05:37.951-07:00</atom:updated><title>Visual Studio Test System : “Test Run Deployment Issue : The location of the file or directory … is not trusted”</title><description>&lt;p&gt;&lt;a href="http://lh4.ggpht.com/_Oy9HuksgrdU/SpyPfDQTk5I/AAAAAAAABGQ/zXSlTH_4zD4/s1600-h/image%5B6%5D.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://lh4.ggpht.com/_Oy9HuksgrdU/SpyPfgk1FdI/AAAAAAAABGU/vmsfbc2LUrw/image_thumb%5B4%5D.png?imgmax=800" width="1092" height="283" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;I just came across this issue when trying to run tests from Visual Studio test system. To resolve this, simple go to the source of the DLL (in my case, I placed them under LIB directory inside my solution directory), right click on each of the libraries that were taken from external sources (like Log4Net, Moq, etc.) and view the Properties. In the properties window, you should be seeing “Unblock” option as shown below.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh5.ggpht.com/_Oy9HuksgrdU/SpyPfx_p5hI/AAAAAAAABGY/ly2vtH8NtKk/s1600-h/image%5B12%5D.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://lh6.ggpht.com/_Oy9HuksgrdU/SpyPgaDwSWI/AAAAAAAABGc/JdQUnzrPf0g/image_thumb%5B8%5D.png?imgmax=800" width="381" height="519" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Simply click “Unblock” button and release the library’s security constraint. Now perform a clean on the solution and rebuild the solution. Your tests should run without any deployment issues. &lt;/p&gt;  &lt;p&gt;good luck!&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19967453-8422988679565280152?l=krishnabhargav.blogspot.com'/&gt;&lt;/div&gt;</description><link>http://feedproxy.google.com/~r/truebuddi/~3/nn3I0Y2Buz4/visual-studio-test-system-test-run.html</link><author>krishnabhargav@yahoo.com (Bhargav--------------------------------------------)</author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://krishnabhargav.blogspot.com/2009/08/visual-studio-test-system-test-run.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-19967453.post-4722009388632703755</guid><pubDate>Tue, 28 Jul 2009 04:37:00 +0000</pubDate><atom:updated>2009-07-27T21:59:29.571-07:00</atom:updated><title>ConfigStation for WCF – prototype for minimal configuration based WCF services</title><description>&lt;p&gt;To start off, I would like to stress that I am not a WCF expert and if you go around my blog, you can notice me writing about lot of different things – WPF, DLR, Web Development and what not. So what I present is just something that I made recently as a part of a bigger project that I plan to release. Apparently, this is pretty good start for what I envision for avoiding Configuration Hell in WCF services.&lt;/p&gt;  &lt;p&gt;The &lt;a href="http://msdn.microsoft.com/en-us/netframework/bb499684.aspx"&gt;StockTrader sample from Microsoft comes with a great library – Configuration Service 2.04&lt;/a&gt;. The library is pretty good and provides wonderful functionality but the major problem with that, for me, is its strong dependency on the SQL Server backend. In short, the configuration service maintains a service configuration repository which is used to provide centralized configuration repository, load balancing, fail-over in WCF based SOA applications. And I always wanted such a repository which would minimize my effort in developing distributed applications using WCF.&lt;/p&gt;  &lt;p&gt;I believe, WCF should allow very simple way to develop services and should provide an easier means to configure them. One way away from configuration through App.Config is to code the configuration, but there seems to be a big lack of proper documentation and decent-real-world samples explaining code-based WCF configuration. Anyway, I would envision hosting a service to be as simple as :&lt;/p&gt; &lt;span class="c#" name="code"&gt;   &lt;p&gt;var serviceHost = new AutoConfiguredServiceHost&amp;lt;ServiceImpl&amp;gt;();&lt;/p&gt; &lt;/span&gt;  &lt;p&gt;With no or minimal configuration, the service host should be clever enough to determine what the configuration defaults are. Similarly, consuming the service should be as simple as :&lt;/p&gt; &lt;span class="c#" name="code"&gt;   &lt;p&gt;var client = new RemoteServiceProxy&amp;lt;IService&amp;gt;();&lt;/p&gt; &lt;/span&gt;  &lt;p&gt;The proxy should be created by accessing the repository to figure out implementation for IService and then use the configuration obtained to create the proxy.&lt;/p&gt;  &lt;p&gt;With these goals in mind, the config station has been developed and here is what I have so far.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Sample : Test Service which hosts the ConfigRepository as well as a sample WCF Service implementation. The host method is shown below.&lt;/strong&gt;&lt;/p&gt;  &lt;pre class="c#" name="code"&gt; class Program&lt;br /&gt;    {&lt;br /&gt;        static void Main(string[] args)&lt;br /&gt;        {&lt;br /&gt;            using (var configHost = new ConfigStationHost())&lt;br /&gt;            {&lt;br /&gt;                var hostFacade = new ServiceHostFacade&amp;lt;TestImpl&amp;gt;();&lt;br /&gt;                var host = hostFacade.Host;&lt;br /&gt;                host.Open();&lt;br /&gt;                Console.WriteLine(&amp;quot;Test service launched.Enter to Stop&amp;quot;);&lt;br /&gt;                Console.ReadLine();&lt;br /&gt;                //host.Close();&lt;br /&gt;                host.Abort();&lt;br /&gt;            }&lt;br /&gt;        }&lt;br /&gt;    }&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;If you look at the using block, I am creating an instance of ConfigStationHost – which actually hosts the ConfigStation – a repository WCF service. At the moment, this service requires App.Config based configuration of the service – which can be easily removed and which would be my next enhancement to the project. In this example, I am actually hosting the ConfigStation within the same process as my actual WCF service, which is not required at all. You can host the ConfigStation in a totally separate program – all you have to do is create the instance of ConfigStationHost (see required configuration below) and dispose it when you are done.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;The configuration for the Test Service is shown below.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre class="xml" name="code"&gt; &lt;br /&gt;&amp;lt;configuration&amp;gt;&lt;br /&gt;  &lt;br /&gt;  &amp;lt;appsettings&amp;gt;&lt;br /&gt;    &amp;lt;add value=&amp;quot;net.tcp&amp;quot; key=&amp;quot;ServiceScheme&amp;quot; /&amp;gt; &amp;lt;!-- you can set this to http as well or even msmq ...--&amp;gt;&lt;br /&gt;    &amp;lt;add value=&amp;quot;9989&amp;quot; key=&amp;quot;ServicePort&amp;quot; /&amp;gt;&lt;br /&gt;  &amp;lt;/appsettings&amp;gt;&lt;br /&gt;  &lt;br /&gt;  &amp;lt;system.servicemodel&amp;gt;&lt;br /&gt;    &amp;lt;services&amp;gt;&lt;br /&gt;      &amp;lt;service name=&amp;quot;ConfigStation.Repository&amp;quot;&amp;gt;&lt;br /&gt;        &amp;lt;endpoint contract=&amp;quot;ConfigStation.ServiceContracts.IRepository&amp;quot; binding=&amp;quot;wsHttpBinding&amp;quot; address=&amp;quot;http://localhost:8731/ConfigStation/Repository&amp;quot; /&amp;gt;&lt;br /&gt;      &amp;lt;/service&amp;gt;&lt;br /&gt;    &amp;lt;/services&amp;gt;&lt;br /&gt;    &lt;br /&gt;    &amp;lt;!-- This demo acts as a client to ConfigStation, so it is all good--&amp;gt;&lt;br /&gt;    &amp;lt;client&amp;gt;&lt;br /&gt;      &amp;lt;endpoint name=&amp;quot;ConfigStation&amp;quot; contract=&amp;quot;ConfigStation.ServiceContracts.IRepository&amp;quot; binding=&amp;quot;wsHttpBinding&amp;quot; address=&amp;quot;http://localhost:8731/ConfigStation/Repository&amp;quot;&amp;gt;&lt;br /&gt;      &amp;lt;/endpoint&amp;gt;&lt;br /&gt;    &amp;lt;/client&amp;gt;&lt;br /&gt;    &lt;br /&gt;  &amp;lt;/system.servicemodel&amp;gt;&lt;br /&gt;&amp;lt;/configuration&amp;gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;In the shown configuration, the &amp;lt;service&amp;gt; element configuration is used to host the ConfigStation repository in the current process. The &amp;lt;client&amp;gt; configuration is&amp;#160; the WCF client configuration which is used to access the ConfigStation service hosted. The TestService makes interacts with the ConfigStation using WCF and the ConfigStation is treated as a WCF service hosted somewhere remote. So, if we were to host the configstation separately the only configuration required would be that of the &amp;lt;service&amp;gt; defined. The TestService would then have the AppSettings and the &amp;lt;client&amp;gt; configuration – which is pretty easy to set and even easier for me to remove.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;Now, the ServiceScheme dictates what communication protocol (BINDING, in terms of WCF) would be used when exposing the service and what binding would be used by the clients consuming this service. The ServicePort tells what port the service should be hosted on. Note that WCF allows hosting multiple services on the same port as long as their address is different (Except for MSMQ, i think).&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;strong&gt;The test client to consume the TestService is a different program, whose configuration is shown below. The program contains a WCF client to the TestImpl service whose details are obtained from the ConfigStation. Thus, the client process requires configuration which points to the ConfigStation.&lt;/strong&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre class="xml" name="code"&gt;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot; ?&amp;gt;&lt;br /&gt;&amp;lt;configuration&amp;gt;&lt;br /&gt;  &amp;lt;system.serviceModel&amp;gt;&lt;br /&gt;  &amp;lt;client&amp;gt;&lt;br /&gt;    &amp;lt;endpoint address=&amp;quot;http://localhost:8731/ConfigStation/Repository&amp;quot; name=&amp;quot;ConfigStation&amp;quot;&lt;br /&gt;              binding=&amp;quot;wsHttpBinding&amp;quot;&lt;br /&gt;              contract=&amp;quot;ConfigStation.ServiceContracts.IRepository&amp;quot;&amp;gt;&lt;br /&gt;    &amp;lt;/endpoint&amp;gt;&lt;br /&gt;  &amp;lt;/client&amp;gt;&lt;br /&gt;  &amp;lt;/system.serviceModel&amp;gt;&lt;br /&gt;&amp;lt;/configuration&amp;gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;As you can see, the above is the only configuration required – which would be eliminated once I enhance the ConfigStation. The actual code to access the client is shown below.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre class="xml" name="code"&gt;namespace Test.Client&lt;br /&gt;{&lt;br /&gt;    class Program&lt;br /&gt;    {&lt;br /&gt;        static void Main(string[] args)&lt;br /&gt;        {&lt;br /&gt;            var cf = new ClientProxyFacade&amp;lt;ITest&amp;gt;();&lt;br /&gt;            ITest test = cf.Interface;&lt;br /&gt;            var td = test.SayHello();&lt;br /&gt;            Console.WriteLine(&amp;quot;Remote Server returned : &amp;quot; + td.Message);&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;}&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;You just create the ClientProxyFacade Of ITest, the service contract used by TestImpl. Then the interface is obtained via the “Interface” property. Then you can execute any method exposed by the Service Contract.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;a href="http://configstation.codeplex.com/"&gt;The library is available on codeplex&lt;/a&gt; – making this my first public release of open source software, of any kind. In the process, I would like to stress that the library uses the amazing &lt;a href="http://www.idesign.net/idesign/DesktopDefault.aspx?tabindex=5&amp;amp;tabid=11"&gt;ServiceModelEx library from Juval Lowy, IDesign.&lt;/a&gt; I actually tried to contact Juval whether or not to use his library but guess he is too busy so I took the liberty to publish the project having seen a WCF project on google code doing the same. In case I breach any license, please go easy on me and let me know so that I can fix my mistake. &lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;I appreciate any positive feedback and any expert advice on the library. I am glad to learn and fix any changes requested. :) Hope this helps a few of us devs who like to play with some convention based WCF programming. I would be talking more details on the actual implementation, on how the library performs auto-generation of the service configuration and how bad the current repository implementation is, in my next post.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19967453-4722009388632703755?l=krishnabhargav.blogspot.com'/&gt;&lt;/div&gt;</description><link>http://feedproxy.google.com/~r/truebuddi/~3/leE0E1WeNBM/configstation-for-wcf-prototype-for.html</link><author>krishnabhargav@yahoo.com (Bhargav--------------------------------------------)</author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">1</thr:total><feedburner:origLink>http://krishnabhargav.blogspot.com/2009/07/configstation-for-wcf-prototype-for.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-19967453.post-466297902466510573</guid><pubDate>Thu, 23 Jul 2009 01:22:00 +0000</pubDate><atom:updated>2009-07-22T18:49:05.475-07:00</atom:updated><title>Powershell Script to delete bin/obj folders</title><description>Shown below is a simple powershell script that can be used to clean up a solution folder. The script excludes the "Libraries" directory and deletes any folder named bin or obj in the specified location.&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="C#"&gt;&lt;br /&gt;Get-childitem c:\Temp\MyProjectSolutionFolder -recurse -include *.exe,*.dll,*.pdb,*.exe.config, bin,obj | where {$_ -notmatch 'Libraries'} | Remove-Item -Recurse&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;This script saves my time a lot and also does not require me to install any tools that does the same but adds registry entries for explorer context menu.&lt;br /&gt;&lt;br /&gt;NOTE: Please verify thoroughly before blindly running the script. Use the -WhatIf flag to simulate the execution of the command instead of actually running it.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19967453-466297902466510573?l=krishnabhargav.blogspot.com'/&gt;&lt;/div&gt;</description><link>http://feedproxy.google.com/~r/truebuddi/~3/v49LzqNrOCE/powershell-script-to-delete-binobj.html</link><author>krishnabhargav@yahoo.com (Bhargav--------------------------------------------)</author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://krishnabhargav.blogspot.com/2009/07/powershell-script-to-delete-binobj.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-19967453.post-3151486619713774006</guid><pubDate>Sat, 20 Jun 2009 20:35:00 +0000</pubDate><atom:updated>2009-06-20T13:35:28.074-07:00</atom:updated><title>Bing : Not a search engine, but decision engine??</title><description>&lt;p&gt;I am an active contributor to the MSDN WPF Forums and most of the times I go to the forums through the search engine. And being an ardent supporter of Microsoft, I made Bing my default search engine on my home desktop. So I searched for “MSDN Social” and look what one of the sponsored result is!&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh3.ggpht.com/_Oy9HuksgrdU/Sj1ICzxCa8I/AAAAAAAAA60/e3WHDtqMUgs/s1600-h/image%5B4%5D.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://lh5.ggpht.com/_Oy9HuksgrdU/Sj1ID84wrHI/AAAAAAAAA64/SR4_UZ9BLQM/image_thumb%5B2%5D.png?imgmax=800" width="570" height="458" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;seriously we are in the 21st century. And BING “decided” for me that I want to visit BAD GIRLS IN MY AREA! when all I wanted to do was to visit MSDN Social Forums. Bing – get a life.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19967453-3151486619713774006?l=krishnabhargav.blogspot.com'/&gt;&lt;/div&gt;</description><link>http://feedproxy.google.com/~r/truebuddi/~3/R4TyPWeKXHo/bing-not-search-engine-but-decision.html</link><author>krishnabhargav@yahoo.com (Bhargav--------------------------------------------)</author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://krishnabhargav.blogspot.com/2009/06/bing-not-search-engine-but-decision.html</feedburner:origLink></item></channel></rss>
