<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="https://www.w3.org/2005/Atom" xmlns:sy="https://purl.org/rss/1.0/modules/syndication/" xmlns:dc="https://purl.org/dc/elements/1.1/" xmlns:content="https://purl.org/rss/1.0/modules/content/" xmlns:wfw="https://wellformedweb.org/CommentAPI/" xmlns:slash="https://purl.org/rss/1.0/modules/slash/"
  version="2.0">
  <channel>
    <title>Ionutz's tech blog</title>
    <atom:link
      href="https://docs.microsoft.com/archive/blogs/ionutg/feed.xml"
      rel="self"
      type="application/rss+xml" />
    <link>https://docs.microsoft.com/archive/blogs/ionutg/feed.xml</link>
    <description />
    <lastBuildDate>Wed, 17 Apr 2019 04:08:18 GMT</lastBuildDate>
    <language>en-US</language>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <item>
      <title>How to resolve error "The current identity (IIS APPPOOL...) does not have write access to " error</title>
      <link>https://docs.microsoft.com/archive/blogs/ionutg/how-to-resolve-error-the-current-identity-iis-apppool-does-not-have-write-access-to-error</link>
      <pubDate>Fri, 22 Jun 2012 16:24:00 GMT</pubDate>
      <dc:creator><![CDATA[Ionootz]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/ionutg/2012/06/22/how-to-resolve-error-the-current-identity-iis-apppool-does-not-have-write-access-to-error/</guid>
      <description><![CDATA[Hi,
Yesterday I was just playing with some small site that I've created and published from Visual...]]></description>
      <content:encoded><![CDATA[<p>Hi,</p>
<p>Yesterday I was just playing with some small site that I've created and published from Visual Studio when I bumped into this error:</p>
<p><i>The current identity (IIS APPPOOL\cc) does not have write access to <br />'C:\Windows\Microsoft.NET\Framework64\v2.0.50727\Temporary ASP.NET Files'.</i></p>
<p>I started looking around and I've seen some people complaining about the same issues, but none that is specifically about the problem that I was encountering. I was sure it has something to do with the access to the folder, but looking through all the settings for the website in&nbsp;in IIS Manager I dind't find any that could be the culprit. But luckly I started looking a bit&nbsp;at the settings for the application pool that's corresponding to my site and I noticed that it's running under the "ApplicationPoolIdentity" Identity. I thought it might be worth it to give it a try by running it under NetworkService. And guess what?!? That completely solved my problem.</p>
<p>Here's a step by step explanation of how I got the error and what I did to fix it:</p>
<p>I've developed my website in&nbsp;VS2010, I went to the site in the solution view, right click select "Publish Web Site"</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/67/96/8284.Publish_web_site.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-67-96/8284.Publish_5F00_web_5F00_site.png"><img border="0" alt="" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/67/96/8284.Publish_web_site.png" original-url="https://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-67-96/8284.Publish_5F00_web_5F00_site.png" /></a></p>
<p>After getting the binaries on the drive I've went in IIS and created the actual website:</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/67/96/4452.Add%20web%20site.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-67-96/4452.Add-web-site.png"></a><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/67/96/4645.Add%20web%20site.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-67-96/4645.Add-web-site.png"></a><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/67/96/0550.Add%20web%20site.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-67-96/0550.Add-web-site.png"></a><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/67/96/3264.Add%20web%20site.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-67-96/3264.Add-web-site.png"><img border="0" alt="" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/67/96/3264.Add%20web%20site.png" original-url="https://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-67-96/3264.Add-web-site.png" /></a></p>
<p>After doing this I happily browsed to my site, which blew up on me...</p>
<hr style="width: 100%;" width="100%" />
<p></p>
<h1>Server Error in '/' Application.</h1>
<hr color="silver" size="1" width="100%" />
<p><i>The current identity (IIS APPPOOL\mywebsite) does not have write access <br />to 'C:\Windows\Microsoft.NET\Framework64\v2.0.50727\Temporary ASP.NET <br />Files'.</i></p>
<p><span style="font-size: medium;"><i><span style="font-family: Arial, Helvetica, Geneva, SunSans-Regular, sans-serif;" face="Arial, Helvetica, Geneva, SunSans-Regular, sans-serif "><b>Description: <br /></b>An unhandled exception occurred during the execution of the current web <br />request. Please review the stack trace for more information about the error and <br />where it originated in the code. <br /><br /><b>Exception Details: <br /></b>System.Web.HttpException: The current identity (IIS APPPOOL\mywebsite) does <br />not have write access to <br />'C:\Windows\Microsoft.NET\Framework64\v2.0.50727\Temporary ASP.NET Files'.</span></i></span></p>
<hr style="width: 100%;" width="100%" />
<p>And here's how&nbsp;to get rid of this&nbsp;error:&nbsp;</p>
<ul>
<li>Go to IIS Manager</li>
<li>Open the Application Pools</li>
<li>Select the pool corresponding to your website (most of the time&nbsp;it will have the same name as the website)</li>
<li>Select "Advanced Settings"</li>
<li>You will see that the app is running under the "<strong>ApplicationPoolIdentity</strong>" Indetity</li>
<li>Change that to "<strong>NetworkService</strong>" identity</li>
</ul>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/67/96/1777.Apppool%20change%20identity.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-67-96/1777.Apppool-change-identity.png"><img border="0" alt="" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/67/96/1777.Apppool%20change%20identity.png" original-url="https://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-67-96/1777.Apppool-change-identity.png" /></a></p>
<p>Well folks, there you have it, hopefully this will save a poor soul a couple of hours of digging :)</p>
<p>Let me know if this solution worked for you or not,<br />Ionutz</p>]]></content:encoded>
    </item>
    <item>
      <title>How to reference a different assembly when building from Visual Studio?</title>
      <link>https://docs.microsoft.com/archive/blogs/ionutg/how-to-reference-a-different-assembly-when-building-from-visual-studio</link>
      <pubDate>Wed, 18 Apr 2012 17:41:00 GMT</pubDate>
      <dc:creator><![CDATA[Ionootz]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/ionutg/2012/04/18/how-to-reference-a-different-assembly-when-building-from-visual-studio/</guid>
      <description><![CDATA[Hi,
After I updated one of my&nbsp;machines to Visual Studio 2010 SP1 I started&nbsp;getting build...]]></description>
      <content:encoded><![CDATA[<p>Hi,</p>
<p>After I updated one of my&nbsp;machines to Visual Studio 2010 SP1 I started&nbsp;getting build error when executing builds from the VS UI. When I was doing the build using msbuild from the command line everything worked fine.</p>
<p>We struggle a bit to understand what was going on and realized that the issue was that Visual Studio 2010 SP1 comes with a different assembly (new dll for Microsoft.VisualStudio.QualityTools.UnitTestFramework.dll). But the dll that we were using for command line builds was the one from the VS 2010 vanilla. And this is what was causing&nbsp;the build to fail.</p>
<p>We could have solved this by just pointing the reference to the assembly from VS but that would cause the command line build to fail on different environments.</p>
<p>But I found out that there's a way to have conditional references. So in the end the solution looked like this:</p>
<pre class="scroll"><code class="cplusplus"> &lt;Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework" Condition=" '$(BuildingInsideVisualStudio)' == 'true'"&gt;<br /> &lt;HintPath&gt;$(VS100COMNTOOLS)\..\IDE\ReferenceAssemblies\v2.0\Microsoft.VisualStudio.QualityTools.UnitTestFramework.dll&lt;/HintPath&gt;<br /> &lt;/Reference&gt;<br /> &lt;Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework" Condition=" '$(BuildingInsideVisualStudio)' != 'true'"&gt;<br /> &lt;HintPath&gt;&lt;command line reference location&gt;\Microsoft.VisualStudio.QualityTools.UnitTestFramework.dll&lt;/HintPath&gt;<br /> &lt;/Reference&gt;</code></pre>
<p>This way we have the best of both worlds. Our code builds from VS using the VS 2010 SP1 binary and from command line using the assembly that we have access to&nbsp;at build time.<br /><br />Please let me know if you have any questions about this,<br />Ionutz</p>]]></content:encoded>
    </item>
    <item>
      <title>How to be a "good friend" to a signed assemly</title>
      <link>https://docs.microsoft.com/archive/blogs/ionutg/how-to-be-a-good-friend-to-a-signed-assemly</link>
      <pubDate>Thu, 26 May 2011 19:11:50 GMT</pubDate>
      <dc:creator><![CDATA[Ionootz]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/ionutg/2011/05/26/how-to-be-a-good-friend-to-a-signed-assemly/</guid>
      <description><![CDATA[Hi, here I am again fighting some signed\unsigned assembly issues. This time everything is related...]]></description>
      <content:encoded><![CDATA[<p>Hi, here I am again fighting some signed\unsigned assembly issues. This time everything is related to the fact that we&nbsp;are writing a class that needs to be accessed by partners through the&nbsp;public methods but it needs to give some special privileges to a certain assembly.&nbsp;This would mean that an assembly&nbsp;needs to have internal access to properties+methods from another assembly (what you would have called friends classes back in the C++ days).</p>
<p>C# is very&nbsp;kind to us and it allows&nbsp;it by using the InternalsVisibleTo in the class that we want to be accessible from the friend "assembly":</p>
<pre class="scroll" style="padding-left: 30px;"><code class="csharp">[assembly: InternalsVisibleTo("&lt;Assembly_That_Is_A_Friend&gt;")]</code></pre>
<p>The only problem is that this will not work if the Assembly_That_Is_A_Friend is a signed assembly... so we need to get the public key&nbsp;that we used for signing it and add to the assembly name that to&nbsp;build the fully qualified name of the assembly.</p>
<p>So here are the 3 steps that you need to do to be able to befriend a signed assembly</p>
<p>1. From the snk file get the public key version of the signing key</p>
<pre class="scroll" style="padding-left: 30px;"><code class="csharp">sn -p The_Signing_snk.snk OutKey.snk</code></pre>
<pre class="scroll" style="padding-left: 30px;"><code class="cplusplus">Microsoft (R) .NET Framework Strong Name Utility Version 2.0.50727.42<br />Copyright (c) Microsoft Corporation. All rights reserved.<br /><br />Public key written to OutKey.snk</code></pre>
<p>2. From the public key file get the public key as a string of hex numbers:</p>
<pre class="scroll"><code class="cplusplus"><pre class="scroll"><code class="csharp">sn -tp OutKey.snk</code></pre>
<pre class="scroll"><code class="csharp"><br /><br />Microsoft (R) .NET Framework Strong Name Utility Version 2.0.50727.42<br />Copyright (c) Microsoft Corporation. All rights reserved.<br /><br />Public key is<br />0024...<br />eff9...<br />451a...<br />369f...<br />59451f84<br /><br />Public key token is 841...</code></pre>
</code></pre>
<p>3. Now take the full public key ans&nbsp;use it&nbsp;to refer to the assembly with the fully qualified name </p>
<p style="padding-left: 30px;"><code class="csharp">[assembly: InternalsVisibleTo("&lt;Assembly_That_Is_A_Friend&gt;, PublicKey=&lt;Public_Key_Of_The_Signing_snk&gt;")]</code>&nbsp;</p>
<p>You should now be ready to&nbsp;access the&nbsp;internal methods\properties from the signed assembly to the assembly that you were working on while all the other partners referencing it will have access just to the rest of the properties. </p>
<p>This is just what "friends" are for!!!</p>
<p>Thanks,<br />Ionut</p>]]></content:encoded>
    </item>
    <item>
      <title>How to sign a binary that you don't have the sources for?</title>
      <link>https://docs.microsoft.com/archive/blogs/ionutg/how-to-sign-a-binary-that-you-dont-have-the-sources-for</link>
      <pubDate>Fri, 29 Apr 2011 16:47:39 GMT</pubDate>
      <dc:creator><![CDATA[Ionootz]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/ionutg/2011/04/29/how-to-sign-a-binary-that-you-dont-have-the-sources-for/</guid>
      <description><![CDATA[Hi, it has been a long time since my last post here and that's not because I didn't bump into...]]></description>
      <content:encoded><![CDATA[<P>Hi, it has been a long time since my <SPAN class=mceItemHidden class="mceItemHidden">last post here and that's not because I didn't bump into difficult problems that I wasn't able to solve, but rather due to me being too lazy to write.</SPAN></P>
<P>So I decided to fix this. Also, the issue that I've found took me a long time to solve and it's a bit obscure so I think it's worth the trouble of a post.</P>
<P><SPAN class=mceItemHidden class="mceItemHidden">Here's the problem: you are creating a <SPAN class=mceItemHiddenSpellWord>dll</SPAN> that you share with other teams and they expect it to be signed (have a strong name). That's easy enough if you have control over all the dependencies... But what if you are using some dependencies that are not signed?</SPAN></P>
<P>Here are the steps to sign the dependencies:<BR><SPAN class=mceItemHidden>1. Get a cert.&nbsp;</SPAN>Here's a simple way generate a random key:<BR><SPAN style="BACKGROUND-COLOR: #ffffff" _mce_style="background-color: #ffffff;"><CODE class=cplusplus><SPAN class=mceItemHidden>&nbsp;&nbsp;&nbsp;&nbsp;<SPAN class=mceItemHiddenSpellWord>sn</SPAN> -k <SPAN class=mceItemHiddenSpellWord>myKey</SPAN>.<SPAN class=mceItemHiddenSpellWord>snk<BR></SPAN></SPAN></CODE></SPAN><SPAN class=mceItemHidden>2. Install this tool (<SPAN class=mceItemHiddenSpellWord>ilmerge</SPAN>):&nbsp;</SPAN><A href="https://www.microsoft.com/downloads/en/details.aspx?FamilyID=22914587-b4ad-4eae-87cf-b14ae6a939b0&amp;displayLang=en" _mce_href="https://www.microsoft.com/downloads/en/details.aspx?FamilyID=22914587-b4ad-4eae-87cf-b14ae6a939b0&amp;displayLang=en"><SPAN class=mceItemHidden>https://www.microsoft.com/downloads/en/details.<SPAN class=mceItemHiddenSpellWord>aspx</SPAN>?<SPAN class=mceItemHiddenSpellWord>FamilyID</SPAN>=22914587-b4ad-4<SPAN class=mceItemHiddenSpellWord>eae</SPAN>-87cf-b14ae6a939b0&amp;<SPAN class=mceItemHiddenSpellWord>displayLang</SPAN>=en</SPAN></A><BR>3. Run&nbsp;ilmerge like this:<BR><CODE class=cplusplus><SPAN class=mceItemHidden>&nbsp;&nbsp;&nbsp; <SPAN class=mceItemHiddenSpellWord>ilmerge</SPAN> <SPAN class=mceItemHiddenSpellWord>oldDll</SPAN>.dll&nbsp; /<SPAN class=mceItemHiddenSpellWord>keyfile</SPAN>:<SPAN class=mceItemHiddenSpellWord>mykey</SPAN>.<SPAN class=mceItemHiddenSpellWord>snk</SPAN> /out:<SPAN class=mceItemHiddenSpellWord>newDll</SPAN>.<SPAN class=mceItemHiddenSpellWord>dll</SPAN></SPAN><BR></CODE>4. Verify if this operation worked:<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<CODE class=cplusplus><SPAN class=mceItemHidden><SPAN class=mceItemHiddenSpellWord>sn</SPAN> -T <SPAN class=mceItemHiddenSpellWord>newDll</SPAN>.<SPAN class=mceItemHiddenSpellWord>dll</SPAN></SPAN><BR></CODE><CODE class=cplusplus>&nbsp;&nbsp;&nbsp;......<BR>&nbsp;&nbsp;&nbsp;&nbsp;Public key token is ea744189c88093ee</CODE></P>
<P><SPAN class=mceItemHidden class="mceItemHidden">I hope this helps. In the next blog I'll write about how to reference&nbsp;assemblies which are signed and friends (<SPAN class=mceItemHiddenSpellWord>InternalsVisibleTo</SPAN>).</SPAN></P>
<P>Thanks,<BR><SPAN class=mceItemHidden class="mceItemHidden"><SPAN class=mceItemHiddenSpellWord>Ionutz</SPAN></SPAN></P>]]></content:encoded>
    </item>
    <item>
      <title>Certificates in Wix</title>
      <link>https://docs.microsoft.com/archive/blogs/ionutg/certificates-in-wix</link>
      <pubDate>Wed, 30 Dec 2009 17:01:00 GMT</pubDate>
      <dc:creator><![CDATA[Ionootz]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/ionutg/2009/12/30/certificates-in-wix/</guid>
      <description><![CDATA[Here's another of the nice stories when I try to make somthing work and it's just really hard to...]]></description>
      <content:encoded><![CDATA[<P>Here's another of the nice stories when I try to make somthing work and it's just really hard to find any documentation about it.</P>
<P>So I have this installer (a .wxs file) which had some hacky way to install certificates (executing custom actions and calling an external application that would register them). The external app would exist as a binary key in the .wxs and be called during the installsequence. It was quite messy and I though a long time on how to clean this up.</P>
<P>One of these days I had a couple of hours to spare (which is not so usual) and I started to look over on how I could cleanup this code. So I found out about the Certificate node in Wix. Here's the link to the documentation: <A href="https://wix.sourceforge.net/manual-wix2/wix_xsd_certificate.htm" mce_href="https://wix.sourceforge.net/manual-wix2/wix_xsd_certificate.htm">https://wix.sourceforge.net/manual-wix2/wix_xsd_certificate.htm</A></P>
<P>This way&nbsp;all the ugly code that I had was changed in just 3 lines:</P><FONT color=#008000>
<P>&lt;Component Id='CPNT_CERTS' Guid='$(var.GUID_CPNT_CERTIFICATES)' DiskId='1'&gt;<BR>&nbsp;&nbsp;&nbsp; &lt;Certificate Id='CERT' StoreLocation='localMachine' Name='<STRONG><FONT color=#0000ff>certname</FONT></STRONG>' StoreName='personal' CertificatePath='<STRONG><FONT color=#0000ff>certpath'</FONT></STRONG> PFXPassword='password'/&gt;<BR>&nbsp;&nbsp;&nbsp; &lt;Certificate Id='ROOTCA' StoreLocation='localMachine' Name='<STRONG><FONT color=#0000ff>Cert Root CA</FONT></STRONG>' StoreName='root' CertificatePath='<STRONG><FONT color=#0000ff>rootca path</FONT></STRONG>'/&gt;<BR>&nbsp;&nbsp;&nbsp; &lt;Certificate Id='SUBCA' StoreLocation='localMachine' Name='<STRONG><FONT color=#0000ff>Cert Sub CA</FONT></STRONG>' StoreName='ca' CertificatePath='<STRONG><FONT color=#0000ff>subca path</FONT></STRONG>'/&gt;<BR>&lt;/Component&gt;&nbsp;&nbsp; </P></FONT>
<P>And here's the part that will executes the certificate during the install</P><FONT color=#008000>
<P mce_keep="true">&lt;InstallExecuteSequence&gt;<BR>.....<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;InstallCertificates&gt;NOT Installed&lt;/InstallCertificates&gt;<BR>.....<BR>&lt;/InstallExecuteSequence&gt;</P></FONT>
<P mce_keep="true">Hopefully this helps, it was really hard for me to find any documeentation or help on how to use the certificate node.</P>
<P mce_keep="true">As always, please let me know if this helps or if I missed somthing.</P>
<P mce_keep="true">Thanks,<BR>Ionutz</P>]]></content:encoded>
    </item>
    <item>
      <title>If you get errors trying to run the Task Scheduler on Win2K8 and Event Viewer is not there to help</title>
      <link>https://docs.microsoft.com/archive/blogs/ionutg/if-you-get-errors-trying-to-run-the-task-scheduler-on-win2k8-and-event-viewer-is-not-there-to-help</link>
      <pubDate>Wed, 27 May 2009 21:19:00 GMT</pubDate>
      <dc:creator><![CDATA[Ionootz]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/ionutg/2009/05/27/if-you-get-errors-trying-to-run-the-task-scheduler-on-win2k8-and-event-viewer-is-not-there-to-help/</guid>
      <description><![CDATA[Hi,
Once again I got angry on my poor computer because it didn't want to play nice.
I was trying...]]></description>
      <content:encoded><![CDATA[<P>Hi,</P>
<P>Once again I got angry on my poor computer because it didn't want to play nice.</P>
<P>I was trying to create a scheduled task to robocopy some files every day to a certain shared folder. But when I started the Task Scheduler (<STRONG>taskschd.msc /s</STRONG>)&nbsp;I got an error saying that the Task Scheduler service is not working.</P>
<P>I take a look at the services (<STRONG>services.msc</STRONG>) and it was right, it wasn't running... Hmmm... perhaps it would be a good idea to start it. I try to do that and I get an error saying that a dependent service cannot start. This must be one of those days. I take a look to see what dependencies does the Task Scheduler have and I find the Event Log. I look at this one and guess what I see?!? The Event Logger is not running either. OK. I try to start it and now I get "Error 5: Access is denied". This is definitely one of those days. </P>
<P>I start looking for solutions online and after a couple of tries I found this one: <A href="https://social.msdn.microsoft.com/Forums/de-DE/winserver2008appcompatabilityandcertification/thread/c231b5d0-2a36-4ddf-a457-e5f471667302" mce_href="https://social.msdn.microsoft.com/Forums/de-DE/winserver2008appcompatabilityandcertification/thread/c231b5d0-2a36-4ddf-a457-e5f471667302">https://social.msdn.microsoft.com/Forums/de-DE/winserver2008appcompatabilityandcertification/thread/c231b5d0-2a36-4ddf-a457-e5f471667302</A>. For me step 1, 2 and 4&nbsp;did the trick.</P>
<P><BR><STRONG>1. Checked the permissions on HKLM\System\CurrentControlSet\Services\eventlog make sure "Authenticated Users" has permission. </STRONG><FONT color=#008000>I found Authenticated Users under the Machine Object group with Find All operation</FONT><BR><STRONG>2. Make sure Administrators/Administrator has Full Control permissions on folder C:\Windows\System32\winevt\logs. </STRONG><FONT color=#008000>I didn't even have the folder so I needed to create it manually</FONT><BR>4. <STRONG>Run the below command:<BR>ICACLS C:\Windows\System32\winevt\logs /grant *S-1-5-80-880578595-1860270145-482643319-2788375705-1540778122:(F)<BR>F --&gt; for Full Control<BR>S-1-5-80-880578595-1860270145-482643319-2788375705-1540778122 --&gt; SID of the group EventLog on any 2008 server and is same on all servers.</STRONG><FONT color=#008000> If you don't belive that this is&nbsp;your machine SID you could check it by doing &nbsp;<STRONG>sc showsid eventlog</STRONG></FONT></P>
<P>After doing all this I was able to start the Event viewer which allowed me to start the Task Scheduler which allowed me to run my robocopy... And&nbsp;it took only 1-2 hours...</P>
<P>Thanks,<BR>Ionutz</P>]]></content:encoded>
    </item>
    <item>
      <title>How to debug C# WebHttpRequest HTTPS through Fiddler</title>
      <link>https://docs.microsoft.com/archive/blogs/ionutg/how-to-debug-c-webhttprequest-https-through-fiddler</link>
      <pubDate>Tue, 12 May 2009 20:53:00 GMT</pubDate>
      <dc:creator><![CDATA[Ionootz]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/ionutg/2009/05/12/how-to-debug-c-webhttprequest-https-through-fiddler/</guid>
      <description><![CDATA[Hi,
I was working on this project where I needed to get some HTTP requests intercepted by Fiddler....]]></description>
      <content:encoded><![CDATA[<p>Hi,</p>
<p>I was working on this project where I needed to get some HTTP requests intercepted by Fiddler. Everything worked nice and dandy until some of the requests needed to be done over HTTPS. Fiddler knows to decrypt those by having a fake SSL cert.</p>
<p>Unfortunately my code didn't like that too much so it started etting me this nice error:</p>
<p><strong>Error: The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel.</strong></p>
<p>Solution... you just need to&nbsp;disable the ServerCertificateValidationCallback</p>
<p mce_keep="true"><span style="color: #008080;" color="#008080">ServicePointManager</span>.ServerCertificateValidationCallback = <span style="color: #0000ff;" color="#0000ff">new</span> <span style="color: #008080;" color="#008080">RemoteCertificateValidationCallback</span>(<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: #0000ff;" color="#0000ff">delegate</span><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000ff;" color="#0000ff">return true</span>;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; } );</p>
<p>That's all. Now you're requests can go through &nbsp;Fiddler and you can debug them.</p>
<p>[Update]<br />As Eric said in the comments, another approach is to just trust the Fiddler cert. <a href="https://www.fiddler2.com/fiddler/help/httpsdecryption.asp">https://www.fiddler2.com/fiddler/help/httpsdecryption.asp</a> That is in fact a cleaner approach, I think if you have the possiblity to trust the cert you should do that and keep the ServerCertificateValidationCallback for the cases when you cannot import the cert as a trusted cert.</p>
<p>Thanks,<br />Ionutz</p>]]></content:encoded>
    </item>
    <item>
      <title>How to select in Visual Studio an area between 2 known find expression</title>
      <link>https://docs.microsoft.com/archive/blogs/ionutg/how-to-select-in-visual-studio-an-area-between-2-known-find-expression</link>
      <pubDate>Wed, 25 Mar 2009 21:33:00 GMT</pubDate>
      <dc:creator><![CDATA[Ionootz]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/ionutg/2009/03/25/how-to-select-in-visual-studio-an-area-between-2-known-find-expression/</guid>
      <description><![CDATA[Some days ago I had to format this&nbsp;huge file to remove&nbsp;everything between a&nbsp;"start"...]]></description>
      <content:encoded><![CDATA[<P>Some days ago I had to format this&nbsp;huge file to remove&nbsp;everything between a&nbsp;"start" marking and an "end" marking and&nbsp;to do some other nifty things while doing the&nbsp;removing (reformat, copy some of the text, move it somewhere Else and such).</P>
<P>So a simple regexp replace would not work. The only solution was to get a macro to do the work for me so I don't go crazy (or at least not 100%) :)</P>
<P>Since I'm kind of a noob in VB macros I started looking for some samples of how others did this before but after spending like half an hour browsing through tons of VB macros that did everything except what I wanted them to do I decided that it's time for me to write one of my own.</P>
<P>So here is some of it:</P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; DTE.ExecuteCommand("Edit.Find")<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; DTE.Find.FindWhat = <STRONG>"&lt;the start pattern&gt;"</STRONG><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; DTE.Find.Target = vsFindTarget.vsFindTargetCurrentDocument<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; DTE.Find.MatchCase = False<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; DTE.Find.MatchWholeWord = False<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; DTE.Find.Backwards = False<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; DTE.Find.MatchInHiddenText = True<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; DTE.Find.PatternSyntax = vsFindPatternSyntax.vsFindPatternSyntaxRegExpr<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; DTE.Find.Action = vsFindAction.vsFindActionFind<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; If (DTE.Find.Execute() = vsFindResult.vsFindResultNotFound) Then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Throw New System.Exception("vsFindResultNotFound")<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; End If</P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; DTE.Windows.Item("{CF2DDC32-8CAD-11D2-9302-005345000000}").Close()</P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Dim startLine As Integer = DTE.ActiveDocument.Selection.CurrentLine<BR></P>
<P mce_keep="true">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<STRONG> --- do processing with the start line</STRONG></P>
<P mce_keep="true">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;DTE.ExecuteCommand("Edit.Find")<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; DTE.Find.FindWhat = <STRONG>"&lt;the end pattern&gt;"</STRONG><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; DTE.Find.Target = vsFindTarget.vsFindTargetCurrentDocument<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; DTE.Find.MatchCase = False<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; DTE.Find.MatchWholeWord = False<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; DTE.Find.Backwards = False<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; DTE.Find.MatchInHiddenText = True<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; DTE.Find.PatternSyntax = vsFindPatternSyntax.vsFindPatternSyntaxRegExpr<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; DTE.Find.Action = vsFindAction.vsFindActionFind<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; If (DTE.Find.Execute() = vsFindResult.vsFindResultNotFound) Then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Throw New System.Exception("vsFindResultNotFound")<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; End If</P>
<P mce_keep="true">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Dim endLine As Integer = DTE.ActiveDocument.Selection.CurrentLine</P>
<P mce_keep="true"><STRONG>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --- now you have both the start line and the end line<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --- and here's your selection to play with</STRONG></P>
<P mce_keep="true">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <STRONG>Dim sel As TextSelection = DTE.ActiveDocument.Selection</STRONG></P>
<P mce_keep="true">Please let me know if you have any trouble using this.</P>
<P mce_keep="true">Thanks,<BR>Ionutz</P>]]></content:encoded>
    </item>
    <item>
      <title>Running 32 bit ASP.Net applications on a 64bit OS</title>
      <link>https://docs.microsoft.com/archive/blogs/ionutg/running-32-bit-asp-net-applications-on-a-64bit-os</link>
      <pubDate>Mon, 07 Apr 2008 16:37:00 GMT</pubDate>
      <dc:creator><![CDATA[Ionootz]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/ionutg/2008/04/07/running-32-bit-asp-net-applications-on-a-64bit-os/</guid>
      <description><![CDATA[Here's a thing that haunted me the last few days:
I have this 64bit Windows Server 2K8 machine...]]></description>
      <content:encoded><![CDATA[<P>Here's a thing that haunted me the last few days:</P>
<P>I have this 64bit Windows Server 2K8 machine which I'm trying to convince to run 32bit code under IIS7. In the same time I have a 64bit Windows Server 2K3 on which I'm trying to do the same.</P>
<P>After bumping my head into walls for some time I found out this nice description of how to solve the problem for IIS 6:<BR><A href="https://support.microsoft.com/kb/894435" mce_href="https://support.microsoft.com/kb/894435">https://support.microsoft.com/kb/894435</A><BR>Mainly the trick is to be able to register the 32bit framework (running aspnet_regiis fails)... so the solution goes like this:<BR><SPAN class=userInput><STRONG>cscript %SYSTEMDRIVE%\inetpub\adminscripts\adsutil.vbs SET W3SVC/AppPools/Enable32bitAppOnWin64 1<BR></STRONG><SPAN class=userInput><STRONG>%SYSTEMROOT%\Microsoft.NET\Framework\&lt;version&gt;\aspnet_regiis.exe -i</STRONG></SPAN></SPAN></P>
<P><SPAN class=userInput><SPAN class=userInput></SPAN></SPAN><SPAN class=userInput><SPAN class=userInput>Now the bad thing is that you would need to turn it off if you want to run 64 bit applications under ASP.Net.</SPAN></SPAN></P>
<P><SPAN class=userInput><SPAN class=userInput>On IIS7 this problem is solved (you can run them both) but the solution to have it working is different than what was for II6:<BR><A href="https://blogs.msdn.com/rakkimk/archive/2007/11/03/iis7-running-32-bit-and-64-bit-asp-net-versions-at-the-same-time-on-different-worker-processes.aspx" mce_href="https://blogs.msdn.com/rakkimk/archive/2007/11/03/iis7-running-32-bit-and-64-bit-asp-net-versions-at-the-same-time-on-different-worker-processes.aspx">https://blogs.msdn.com/rakkimk/archive/2007/11/03/iis7-running-32-bit-and-64-bit-asp-net-versions-at-the-same-time-on-different-worker-processes.aspx</A>&nbsp;<BR>This blog will show in details how to do it so on IIS7 you could run both 32 and 64 bit ASP.Net applications.<BR></SPAN></SPAN><SPAN class=userInput><SPAN class=userInput>If you need the short fast version, for 32bit you need to go to the application advanced properties page and just flip a flag&nbsp; "Enable 32Bit applications" from False to True. </SPAN></SPAN></P>
<P><SPAN class=userInput><SPAN class=userInput>Wasn't that easy? (Once you found it...)</SPAN></SPAN></P>
<P><SPAN class=userInput><SPAN class=userInput></SPAN></SPAN>Thanks,<BR>Ionutz</P>]]></content:encoded>
    </item>
    <item>
      <title>ASP.Net server side application wide data caching</title>
      <link>https://docs.microsoft.com/archive/blogs/ionutg/asp-net-server-side-application-wide-data-caching</link>
      <pubDate>Mon, 11 Sep 2006 19:02:00 GMT</pubDate>
      <dc:creator><![CDATA[Ionootz]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/ionutg/2006/09/11/asp-net-server-side-application-wide-data-caching/</guid>
      <description><![CDATA[Thanks to the comment, PeterI've added additional code that will make it avoid possible race...]]></description>
      <content:encoded><![CDATA[<P><FONT style="BACKGROUND-COLOR: #7fffd4">Thanks to the comment, Peter<BR>I've added additional code that will make it avoid possible race conditions<BR>Mainly I test for null, lock the code and test for null again to make sure that no change in the state was done during the locking process<BR></FONT><FONT style="BACKGROUND-COLOR: #7fffd4"><BR></P></FONT>
<P>Here's a problem that I tried to solve for a couple of days:<BR>You have a lot of data on the server and you try to show it to lots of clients. How do you do this trying to have a good performance?</P>
<P>The solution that I found is the subject of this post: You cache the data server side and give it to the clients from the cache. The cache should be application wide so all the clients would use the same one.</P>
<P>Because my data is pretty static I also set the expiry time of the cache to 1 hour.</P>
<P>Here is the code example:</P>
<P>You should create a static or singleton class that would&nbsp;your code would be able to access from anywhere and you pass the HTTPContext to that class when you requets the cached object:</P>
<P><FONT style="BACKGROUND-COLOR: #7fffd4">private static object theLock = new object();</FONT><BR>&lt;cached_type&gt; GetCached( Cache cache&nbsp;)<BR>{<BR>&nbsp;&nbsp;&nbsp;&lt;cached_type&gt; cachedObject = cache[&lt;cacheID&gt;] <FONT color=#0000ff>as</FONT> &lt;cached_type&gt;;<BR><FONT color=#0000ff>&nbsp;&nbsp;&nbsp;if</FONT>( <FONT color=#0000ff>null</FONT> == cachedObject )<BR>&nbsp;&nbsp;&nbsp;{<BR><FONT style="BACKGROUND-COLOR: #7fffd4">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<FONT color=#0000ff>lock</FONT>( theLock&nbsp;)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if(&nbsp;<FONT color=#0000ff>null</FONT>&nbsp;== cachedObject )<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<BR></FONT>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;cachedObject = <FONT color=#0000ff>new</FONT> &lt;cached_type&gt;();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;cache.Add( &lt;cacheID&gt; , cachedObject , <FONT color=#0000ff>null</FONT> , <FONT color=#008080>DateTime</FONT>.Now.AddHours( 1 ) , <FONT color=#008080>Cache</FONT>.NoSlidingExpiration , <FONT color=#008080>CacheItemPriority</FONT>.Normal , <FONT color=#0000ff>null</FONT> );<BR><FONT style="BACKGROUND-COLOR: #7fffd4">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</FONT><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<BR>&nbsp;&nbsp;&nbsp;}<BR><FONT color=#0000ff>&nbsp;&nbsp;&nbsp;return</FONT> cachedObject;<BR></P>
<P>Every time you call this method it will look up to see if the object is in the cache. If it;s not it will create it and pout it in the cache with a expiration of 1 hour. After one hour the cached object will be expired and the next call will recreate it.</P>
<P>This is useful when you have to deal with showing large data and you don't want to overkill the DB. </P>
<P>Please leave comments if you think this approach is good or bad :)</P>
<P>Thanks,<BR>Ionutz</P>]]></content:encoded>
    </item>
  </channel>
</rss>