<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://msmvps.com/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>Living .NET...  - All Comments</title><link>http://msmvps.com/blogs/manoj/default.aspx</link><description>Musings on .NET, and the like - Manoj G [MVP, Connected Systems Developer]</description><dc:language>en</dc:language><generator>CommunityServer 2008.5 SP2 (Build: 40407.4157)</generator><item><title>re: Process.Start() Quips</title><link>http://msmvps.com/blogs/manoj/archive/2004/10/23/16505.aspx#1720541</link><pubDate>Thu, 03 Sep 2009 19:08:14 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1720541</guid><dc:creator>Akansha</dc:creator><description>&lt;p&gt;very helpful post - used this info to get powershell commands to run from a C# app!!&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1720541" width="1" height="1"&gt;</description></item><item><title>re: Process.Start() _ Windows service</title><link>http://msmvps.com/blogs/manoj/archive/2004/10/23/16505.aspx#1696685</link><pubDate>Thu, 25 Jun 2009 08:20:46 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1696685</guid><dc:creator>Seb</dc:creator><description>&lt;p&gt;Same probleme... It&amp;#39;s impossible to start a program when i user windows service. ( Even if i check interract with destok)&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1696685" width="1" height="1"&gt;</description></item><item><title>re: Me, MyBase and MyClass...</title><link>http://msmvps.com/blogs/manoj/archive/2004/01/29/2175.aspx#1657712</link><pubDate>Thu, 25 Dec 2008 08:00:05 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1657712</guid><dc:creator>mani</dc:creator><description>&lt;p&gt;nice work.......&lt;/p&gt;
&lt;p&gt;nice explanation with good examples..&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1657712" width="1" height="1"&gt;</description></item><item><title>re: Me, MyBase and MyClass...</title><link>http://msmvps.com/blogs/manoj/archive/2004/01/29/2175.aspx#1651945</link><pubDate>Sat, 25 Oct 2008 05:16:19 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1651945</guid><dc:creator>Satpal</dc:creator><description>&lt;p&gt;Thanks for support&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1651945" width="1" height="1"&gt;</description></item><item><title>re: Predicates in Action</title><link>http://msmvps.com/blogs/manoj/archive/2006/08/29/Predicates-in-Action.aspx#1649391</link><pubDate>Wed, 01 Oct 2008 14:33:06 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1649391</guid><dc:creator>Nicolas Repiquet</dc:creator><description>&lt;p&gt;FindAll allocate, populate and return a new List, plus the syntax is quite unclear.&lt;/p&gt;
&lt;p&gt;foreach( Account account in GetAllAccounts() ) {&lt;/p&gt;
&lt;p&gt; &amp;nbsp;if( account.Balance == 0 ) {&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;SendMail( account, &amp;quot;Be aware, you now have a zero balance&amp;quot; );&lt;/p&gt;
&lt;p&gt; &amp;nbsp;}&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;Done.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1649391" width="1" height="1"&gt;</description></item><item><title>re: String.Format: A Simple Tip</title><link>http://msmvps.com/blogs/manoj/archive/2004/09/29/String.Format_3A00_-A-Simple-Tip.aspx#1602051</link><pubDate>Thu, 24 Apr 2008 02:50:36 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1602051</guid><dc:creator>visitor</dc:creator><description>&lt;p&gt;2 points.&lt;/p&gt;
&lt;p&gt;1. watch out for {0) which looks a lot like {0} which if you&amp;#39;re typing fast can happen quite frequently...will result in a very strange message you could end up surfing around for hours trying to find what&amp;#39;s wrong...not that that&amp;#39;s happened to me or anything.&lt;/p&gt;
&lt;p&gt;2. as far as sql injection we do something like this:&lt;/p&gt;
&lt;p&gt;String.Format(&amp;quot;sql goes here where id = {0}&amp;quot;, SqlTool.StringToSQL(m_String));&lt;/p&gt;
&lt;p&gt;and have a separate class that handles the &amp;#39;&amp;#39; stuff... this allows you to escape things neatly behind the scenes, still use string.format, and keep code consistent, and still use intellisense to make things speedy...&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1602051" width="1" height="1"&gt;</description></item><item><title>re: Throw Trap</title><link>http://msmvps.com/blogs/manoj/archive/2004/10/24/16550.aspx#1541079</link><pubDate>Wed, 12 Mar 2008 16:07:45 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1541079</guid><dc:creator>Ulf</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I have a question or need to get some thing confirmed because I&amp;#39;m a bit unsure about this.&lt;/p&gt;
&lt;p&gt;Looking at Lance Hunts guideline paragraph 4.4 the example says&lt;/p&gt;
&lt;p&gt;// Bad!&lt;/p&gt;
&lt;p&gt;catch(Exception ex)&lt;/p&gt;
&lt;p&gt;{&lt;/p&gt;
&lt;p&gt;Log(ex);&lt;/p&gt;
&lt;p&gt;throw ex;&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;// Good!&lt;/p&gt;
&lt;p&gt;catch(Exception)&lt;/p&gt;
&lt;p&gt;{&lt;/p&gt;
&lt;p&gt;Log(ex);&lt;/p&gt;
&lt;p&gt;throw;&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;As I understand it is not possible to do as in the good example, since ex is not declared. Or am I wrong?&lt;/p&gt;
&lt;p&gt;If I do the good example as you do it, it seems that I get the same result. I&amp;#39;m I right about that?&lt;/p&gt;
&lt;p&gt;// Good! (Modified)&lt;/p&gt;
&lt;p&gt;catch(Exception ex)&lt;/p&gt;
&lt;p&gt;{&lt;/p&gt;
&lt;p&gt;Log(ex);&lt;/p&gt;
&lt;p&gt;throw;&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1541079" width="1" height="1"&gt;</description></item><item><title>re: BackgroundWorker and SynchronizationContext</title><link>http://msmvps.com/blogs/manoj/archive/2005/11/03/74120.aspx#1514256</link><pubDate>Thu, 14 Feb 2008 14:12:54 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1514256</guid><dc:creator>Martin Golding</dc:creator><description>&lt;p&gt;&amp;gt;&amp;gt;But from a thread with just has a standard&lt;/p&gt;
&lt;p&gt;&amp;gt;&amp;gt;SynchronizationContext, the send and post method of&lt;/p&gt;
&lt;p&gt;&amp;gt;&amp;gt;this context do not marshall the call to a specific&lt;/p&gt;
&lt;p&gt;&amp;gt;&amp;gt;thread!&lt;/p&gt;
&lt;p&gt;Does a standard SynchronizationContext enable the ability to marshall to the original thread?&lt;/p&gt;
&lt;p&gt;All of my test code says no, If I output Thread.GetHashCode() and write test code I can see when using ctx.Post, it always uses the running thread ID and not the one I want to marshal to. &lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1514256" width="1" height="1"&gt;</description></item><item><title>re: StackTrace and StackFrame</title><link>http://msmvps.com/blogs/manoj/archive/2004/03/25/StackTrace-and-StackFrame.aspx#1467314</link><pubDate>Thu, 17 Jan 2008 10:22:36 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1467314</guid><dc:creator>Jeremy</dc:creator><description>&lt;p&gt;Hello, &lt;/p&gt;
&lt;p&gt;i&amp;#39;m trying to do something like this, and i want to acces to the argument&amp;#39;s instance of the invoked method.&lt;/p&gt;
&lt;p&gt;I can access to the metadata (Type, Name) but i can&amp;#39;t access to the value when the method is invoked.&lt;/p&gt;
&lt;p&gt;How to do this ?&lt;/p&gt;
&lt;p&gt;(Sorry for langage i&amp;#39;m not english :P)&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1467314" width="1" height="1"&gt;</description></item><item><title>Threading in .Net 2.0</title><link>http://msmvps.com/blogs/manoj/archive/2005/11/03/74120.aspx#1464245</link><pubDate>Tue, 15 Jan 2008 13:04:35 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1464245</guid><dc:creator>Threading in .Net 2.0</dc:creator><description>&lt;p&gt;Pingback from &amp;nbsp;Threading in .Net 2.0&lt;/p&gt;
&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1464245" width="1" height="1"&gt;</description></item><item><title>re: Process.Start() Quips</title><link>http://msmvps.com/blogs/manoj/archive/2004/10/23/16505.aspx#1450550</link><pubDate>Wed, 09 Jan 2008 18:23:02 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1450550</guid><dc:creator>Rohit</dc:creator><description>&lt;p&gt;Does any one know a way in which the new process just created can be debugged (in Visual studio) ?&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1450550" width="1" height="1"&gt;</description></item><item><title>re: InternalsVisibleToAttribute - Friend Assemblies</title><link>http://msmvps.com/blogs/manoj/archive/2005/09/26/67999.aspx#1441931</link><pubDate>Sun, 06 Jan 2008 18:51:23 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1441931</guid><dc:creator>Keith</dc:creator><description>&lt;p&gt;[assembly:InternalsVisibleToAttribute(&amp;quot;MyFriendAssembly, PublicKeyToken=45cb56a45e0a69a1&amp;quot;)]&lt;/p&gt;
&lt;p&gt;You cannot use PublicKeyToken with a signed assembly&lt;/p&gt;
&lt;p&gt;you need to use public key. &lt;/p&gt;
&lt;p&gt;Keith&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1441931" width="1" height="1"&gt;</description></item><item><title>re: Something IsMissing - A Short Story</title><link>http://msmvps.com/blogs/manoj/archive/2004/01/27/2114.aspx#1410148</link><pubDate>Fri, 21 Dec 2007 18:08:26 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1410148</guid><dc:creator>Darrin</dc:creator><description>&lt;p&gt;This article&amp;#39;s attitude is indicative of the overall contempt that C/C++/C# developers had for VB6, even though it filled a need for quick business application development. (where requirements change constantly... hello, real world)&lt;/p&gt;
&lt;p&gt;Thus, we ended up with lack of path from VB6 to VB.NET, all because a bunch of eggheads at Microsoft thought they new better than the marketplace!&lt;/p&gt;
&lt;p&gt;E.g. Optional parameters&lt;/p&gt;
&lt;p&gt;Ok, its somehow better that I write a dozen overloaded methods when a single method with Optional parameters would&amp;#39;ve done... VB.NET creates the overloads behind the scenes for you.&lt;/p&gt;
&lt;p&gt;Why do you C# guys like writing so much code? &amp;nbsp;I can&amp;#39;t figure it out?&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1410148" width="1" height="1"&gt;</description></item><item><title>re: String.Format: A Simple Tip</title><link>http://msmvps.com/blogs/manoj/archive/2004/09/29/String.Format_3A00_-A-Simple-Tip.aspx#1405169</link><pubDate>Wed, 19 Dec 2007 11:05:41 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1405169</guid><dc:creator>Laoujin</dc:creator><description>&lt;p&gt;You could just use string concatenation you just have to be careful to escape any possible attacks.&lt;/p&gt;
&lt;p&gt;string.Format(&amp;quot;SELECT * FROM table WHERE field=&amp;#39;{0}&amp;#39;&amp;quot;, userInput.Replace(&amp;quot;&amp;#39;&amp;quot;, &amp;quot;&amp;#39;&amp;#39;&amp;quot;))&lt;/p&gt;
&lt;p&gt;I&amp;#39;m sure there are better methods then the Replace in .NET but that would be perfectly save.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1405169" width="1" height="1"&gt;</description></item><item><title>re: Process.Start() Quips</title><link>http://msmvps.com/blogs/manoj/archive/2004/10/23/16505.aspx#1278523</link><pubDate>Fri, 02 Nov 2007 15:52:40 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1278523</guid><dc:creator>Zeina</dc:creator><description>&lt;p&gt;Dear,&lt;/p&gt;
&lt;p&gt;I have a batch file that runs Adobe.exe application. Executing this batch file from a Windows Application worked fine and the output of the Batch successfully achieved whereas the same code called from an ASP.NET application doesn’t work. The exe is displayed in the Task Manager but doesn’t execute the code it should and the user runing this service is the Administrator.&lt;/p&gt;
&lt;p&gt;Apparently it is a security issue sine the problem occurs when hosting the application in IIS but I have tried working with all the permissions and it didn’t work. The Identity of the pool of the web site is Configurable with the System Administrator Credentials.&lt;/p&gt;
&lt;p&gt;Many have the same problem but none has listed the solution. This is very urgent, so pleaseeeeeeeeeeeee help :(&lt;/p&gt;
&lt;p&gt;Thank you,&lt;/p&gt;
&lt;p&gt;Zeina&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1278523" width="1" height="1"&gt;</description></item><item><title>re: Me, MyBase and MyClass...</title><link>http://msmvps.com/blogs/manoj/archive/2004/01/29/2175.aspx#1275573</link><pubDate>Wed, 31 Oct 2007 14:56:10 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1275573</guid><dc:creator>Wei</dc:creator><description>&lt;p&gt;Nice to read that.. &amp;nbsp;I was confused about mybase and myclass. &lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1275573" width="1" height="1"&gt;</description></item><item><title>re: Process.Start() Quips</title><link>http://msmvps.com/blogs/manoj/archive/2004/10/23/16505.aspx#1248548</link><pubDate>Wed, 17 Oct 2007 06:30:11 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1248548</guid><dc:creator>Neeraj</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I have the ollowing code running for runing a console application:&lt;/p&gt;
&lt;p&gt;Process myProcess = new Process();&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;ProcessStartInfo info = new ProcessStartInfo(appName);&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;myProcess.StartInfo = info;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;myProcess.StartInfo.UseShellExecute = false;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;myProcess.StartInfo.RedirectStandardOutput = true;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;myProcess.StartInfo.RedirectStandardInput = true;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;myProcess.Start();&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;myProcess.WaitForExit();&lt;/p&gt;
&lt;p&gt;Here I am passing the names of different console applications in the ProcessStartInfo.&lt;/p&gt;
&lt;p&gt;My Problem is that the console application starts, but within a second closes, though when I run this application as a standalone, it runs properly.&lt;/p&gt;
&lt;p&gt;Please Help somebody&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1248548" width="1" height="1"&gt;</description></item><item><title>re: A simple MSMQ Listener helper class</title><link>http://msmvps.com/blogs/manoj/archive/2005/10/16/70979.aspx#1228588</link><pubDate>Wed, 03 Oct 2007 14:16:39 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1228588</guid><dc:creator>Sloan</dc:creator><description>&lt;p&gt;//Quote//&lt;/p&gt;
&lt;p&gt;I am using the same code and created windows services in my local system but if i run my windows service to receive the message. Access denaid the &amp;nbsp;error message i got.&lt;/p&gt;
&lt;p&gt;Can u specify the the format name for the Queue Path. Or any security setting has to be enabled.&lt;/p&gt;
&lt;p&gt;//End Quote&lt;/p&gt;
&lt;p&gt;You have to go thru &amp;quot;Manage Computer&amp;quot; and find the Queue. &amp;nbsp;And give permissions ON THE QUEUE...to the &amp;quot;SYSTEM&amp;quot; account (the SYSTEM account local to that computer).&lt;/p&gt;
&lt;p&gt;You don&amp;#39;t have to do &amp;quot;Full Control&amp;quot;, but Send/Receive are necessary. &amp;nbsp;I usually give Get/Set Permissions as well.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1228588" width="1" height="1"&gt;</description></item><item><title>re: Tip: StrongNameIdentityPermission </title><link>http://msmvps.com/blogs/manoj/archive/2004/10/20/16208.aspx#1222491</link><pubDate>Sun, 30 Sep 2007 07:14:49 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1222491</guid><dc:creator>Roiy zysman</dc:creator><description>&lt;p&gt;SNIP is not always the best way to protect your code.&lt;/p&gt;
&lt;p&gt;Check out this article&lt;/p&gt;
&lt;p&gt;&lt;a rel="nofollow" target="_new" href="http://blogs.msdn.com/ptorr/archive/2004/07/26/196590.aspx"&gt;blogs.msdn.com/.../196590.aspx&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;
&lt;p&gt;Roiy&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1222491" width="1" height="1"&gt;</description></item><item><title>re: Process.Start() Quips</title><link>http://msmvps.com/blogs/manoj/archive/2004/10/23/16505.aspx#1216644</link><pubDate>Wed, 26 Sep 2007 11:37:11 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1216644</guid><dc:creator>roberto</dc:creator><description>&lt;p&gt;I have a problem with windows service. When i run Process.Start(&amp;quot;iexplore.exe&amp;quot;), i cant open a iexplore window but the i see the process running in task manager. This services running under windows server 2003, and have checked Interact with Desktop, but doesnt work. My email is roberto@t2o.es . If someone can help me, send me a email please. Thank you for you colaboration.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1216644" width="1" height="1"&gt;</description></item></channel></rss>