<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
  version="2.0">
  <channel>
    <title>Sateesh Arveti's blog</title>
    <atom:link
      href="https://docs.microsoft.com/archive/blogs/sateesh-arveti/feed.xml"
      rel="self"
      type="application/rss+xml" />
    <link>https://docs.microsoft.com/archive/blogs/sateesh-arveti/feed.xml</link>
    <description />
    <lastBuildDate>Wed, 17 Apr 2019 03:47:44 GMT</lastBuildDate>
    <language>en-US</language>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <item>
      <title>Look at Peek Definition Window in Visual Studio 2013</title>
      <link>https://docs.microsoft.com/archive/blogs/sateesh-arveti/look-at-peek-definition-window-in-visual-studio-2013</link>
      <pubDate>Tue, 22 Oct 2013 01:49:00 GMT</pubDate>
      <dc:creator><![CDATA[sateesharveti]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/sateesh-arveti/2013/10/22/look-at-peek-definition-window-in-visual-studio-2013/</guid>
      <description><![CDATA[In this article, we will look into a new feature of Visual Studio 2013 that helps to edit and view...]]></description>
      <content:encoded><![CDATA[<p><span style="font-family: Segoe UI; font-size: small;">In this article, we will look into a new feature of Visual Studio 2013 that helps to edit and view code present in various files without switching among the windows. This will help us to write code faster without jumping from the code that you're writing. Let's create a sample Console Application in Visual Studio 2013 and explore it further with the following piece of code:<br /><br /><img src="http://www.c-sharpcorner.com/UploadFile/satisharveti/look-at-peek-definition-window-in-visual-studio-2013/Images/Console%20Application%20in%20VS%202013.jpg" alt="Console Application in VS 2013" width="650" height="174" border="0" /><br /><br />We are calling two methods from the Main method. "MethodA()" is present in the "Program.cs" file and "MethodB()" is in the "TestPeek.cs" file. Prior to Visual Studio 2013, we use "Go to Definition" for editing "MethodB()" that will take us away from the code that you're writing to a new window. In Visual Studio 2013, we can edit the code in the same place without switching to a new window by pressing the "Alt + F12" shortcut or clicking on "Peek Definition" as shown below:<br /><br /><img src="http://www.c-sharpcorner.com/UploadFile/satisharveti/look-at-peek-definition-window-in-visual-studio-2013/Images/Peek%20Definition.jpg" alt="Peek Definition" width="650" height="235" border="0" /><br /><br />This will show the definition of MethodB() in the same window for editing as shown below:<br /><br /><img src="http://www.c-sharpcorner.com/UploadFile/satisharveti/look-at-peek-definition-window-in-visual-studio-2013/Images/MethodB%20in%20same%20window.jpg" alt="MethodB in same window" width="650" height="214" border="0" /><br /><br />Once we are done with editing, we can save and press the "Esc" button to close the Peek Definition window. We can press on<img src="http://www.c-sharpcorner.com/UploadFile/satisharveti/look-at-peek-definition-window-in-visual-studio-2013/Images/PressOn.jpg" alt="PressOn" width="30" height="28" border="0" /> to open the file having the definition of "MethodB()" in a new document window. <br /><br />We can even nest Peek Definition windows as shown below:<br /><br /><img src="http://www.c-sharpcorner.com/UploadFile/satisharveti/look-at-peek-definition-window-in-visual-studio-2013/Images/nest%20Peek.jpg" alt="nest Peek.jpg" width="650" height="112" border="0" /><br /><br />Here, we opened "MethodA()" in a Peek Definition window, that opened "MethodB()" in another window and can navigate backward and forward using breadcrumb dots within the window.<br /><br /><img src="http://www.c-sharpcorner.com/UploadFile/satisharveti/look-at-peek-definition-window-in-visual-studio-2013/Images/breadcrumb%20dots.jpg" alt="breadcrumb dots" width="650" height="176" border="0" /><br /><br />This feature can also be used on classes as well to edit within the current window as shown below: <br /><br /><img src="http://www.c-sharpcorner.com/UploadFile/satisharveti/look-at-peek-definition-window-in-visual-studio-2013/Images/Output.jpg" alt="Output" width="650" height="190" border="0" /><br /><br />The keyboard shortcuts for this feature:</span></p>
<ul>
<li><span style="font-family: Segoe UI; font-size: small;">Open Definition window: Alt+F12</span></li>
<li><span style="font-family: Segoe UI; font-size: small;">Close the window: Esc</span></li>
<li><span style="font-family: Segoe UI; font-size: small;">Navigate among definition windows: Ctrl+Alt+- and Ctrl+Alt+=</span></li>
<li><span style="font-family: Segoe UI; font-size: small;">Toggle between the code editor window and the definition window: Shift+Esc</span></li>
</ul>
<p><span style="font-family: Segoe UI; font-size: small;"><br />We can use this feature to edit a class or method in the current editor without switching from the code that you're writing.<br /></span></p>]]></content:encoded>
    </item>
    <item>
      <title>Look at Logging in IIS 7/7.5</title>
      <link>https://docs.microsoft.com/archive/blogs/sateesh-arveti/look-at-logging-in-iis-77-5</link>
      <pubDate>Thu, 12 Sep 2013 23:58:00 GMT</pubDate>
      <dc:creator><![CDATA[sateesharveti]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/sateesh-arveti/2013/09/12/look-at-logging-in-iis-77-5/</guid>
      <description><![CDATA[In this article, we will look into built-in logging feature&nbsp;of IIS 7/7.5 to log request's...]]></description>
      <content:encoded><![CDATA[<p><span style="font-size: small;"><span style="font-family: Calibri;">In this article, we will look into built-in logging feature&nbsp;of IIS 7/7.5 to log request's details. IIS log is a useful resource to troubleshoot requests. In IIS 7/7.5, we can log the details of a request like client ip, time taken, response size, cookie etc into a file.&nbsp; This information helps to find the load on the server in terms of number of requests, size and time taken to serve the request. &nbsp;Let&rsquo;s open IIS, configure logging for a website and analyse it. We can configure Logging at Server level or website level. &nbsp;Let&rsquo;s do it at website level, go to Default Web Site,&nbsp;go to Logging feature and click Enable:</span></span></p>
<p>&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/86/08/2335.Untitled.png" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-86-08/2335.Untitled.png"><img src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/86/08/2335.Untitled.png" original-url="http://blogs.technet.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-86-08/2335.Untitled.png" alt="" border="0" /></a></p>
<p><span style="font-size: small;"><span style="font-family: Calibri;">In below Logging dialog, we can configure format of the log file, it can be:</span></span></p>
<p><span style="font-family: Calibri; font-size: small;">1)</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="font-size: small;"><span style="font-family: Calibri;">IIS - IIS log file format is a fixed ASCII text-based format, so you cannot customize it [Can&rsquo;t select fields] and fields are separated by comma. </span></span></p>
<p><span style="font-family: Calibri; font-size: small;">2)</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="font-size: small;"><span style="font-family: Calibri;">W3C [default format]: It is a customizable ASCII text-based format. You can use IIS Manager to select which fields to include in the log file and fields are separated by spaces.</span></span></p>
<p><span style="font-family: Calibri; font-size: small;">3)</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="font-size: small;"><span style="font-family: Calibri;">NCSA &ndash; its log file format is a fixed ASCII text-based format, so you cannot customize it and contains less information than IIS log format.</span></span></p>
<p><span style="font-family: Calibri; font-size: small;">4)</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="font-size: small;"><span style="font-family: Calibri;">Custom - ODBC logging is implemented as a custom logging module and helps to log information into ODBC-compliant database like SQL Server or MS-ACCESS.</span></span></p>
<p>&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/86/08/1524.Untitled1.png" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-86-08/1524.Untitled1.png"><img src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/86/08/1524.Untitled1.png" original-url="http://blogs.technet.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-86-08/1524.Untitled1.png" alt="" width="423" height="435" border="0" /></a></p>
<p><span style="font-size: small;"><span style="font-family: Calibri;">Select W3C as log format, click on Select Fields and choose fields that need to be logged in the log file.</span></span></p>
<p>&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/86/08/6562.Untitled1.png" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-86-08/6562.Untitled1.png"><img src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/86/08/6562.Untitled1.png" original-url="http://blogs.technet.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-86-08/6562.Untitled1.png" alt="" width="370" height="364" border="0" /></a></p>
<p><span style="font-size: small;"><span style="font-family: Calibri;">We can set location\directory for the log files, set options to create a new log file based on file size, daily or weekly etc.&nbsp; When we check &ldquo;<strong>Use local time for file naming and rollover</strong>&rdquo;, will use local server time instead of UTC for log file naming and time for log file rollover. This setting will not affect the time field format of the request logged in the file and uses UTC time format. </span></span></p>
<p><span style="font-size: small;"><span style="font-family: Calibri;">Let&rsquo;s may a request to <strong>welcome.png</strong> present in Default Web Site and analyze the log file. This log file will be under path set in Logging Feature + W3SVC&lt;website identifier&gt;. In my case, it is &ldquo;C:\inetpub\logs\LogFiles\W3SVC1&rdquo; and contains below information:</span></span></p>
<p>&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/86/08/5824.Untitled1.png" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-86-08/5824.Untitled1.png"><img src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/86/08/5824.Untitled1.png" original-url="http://blogs.technet.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-86-08/5824.Untitled1.png" alt="" border="0" /></a></p>
<p><span style="font-size: small;"><span style="font-family: Calibri;">Most of the fields are self-explanatory and field prefixes have the following meanings: </span></span></p>
<p><span style="font-size: small;"><span style="font-family: Calibri;">s- Server actions</span></span></p>
<p><span style="font-size: small;"><span style="font-family: Calibri;">c- Client actions</span></span></p>
<p><span style="font-size: small;"><span style="font-family: Calibri;">cs- Client-to-server actions</span></span></p>
<p><span style="font-size: small;"><span style="font-family: Calibri;">sc- Server-to-client actions</span></span></p>
<p><span style="font-size: small;"><span style="font-family: Calibri;"><strong>time-taken</strong> field will show total time taken to generate the response as well as time took &nbsp;to send the complete response to the client till the last byte.&nbsp; This is done by taking into account the last ACK from the answer to the response. Let&rsquo;s say, a request took 5000 milliseconds to generate the response and 3000 milliseconds to send complete response to the client, so it will show time-taken as 8000 milliseconds.</span></span></p>
<p><span style="font-family: Calibri; font-size: small;">Most of the above logging features are also available on a FTP site as well.</span></p>
<p><span style="font-family: Calibri; font-size: small;">In most of the cases, your log file will be very big in size and can&rsquo;t be analyzed in a notepad. In that scenario, we can use Log parser (Available </span><a href="http://blogs.technet.com/b/exchange/archive/2013/06/17/log-parser-studio-2-2-is-now-available.aspx"><span style="color: #0000ff; font-family: Calibri; font-size: small;">here</span></a><span style="font-size: small;"><span style="font-family: Calibri;">). Let&rsquo;s install it and open our log file as shown below:</span></span></p>
<p>&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/86/08/1212.Untitled1.png" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-86-08/1212.Untitled1.png"><img src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/86/08/1212.Untitled1.png" original-url="http://blogs.technet.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-86-08/1212.Untitled1.png" alt="" border="0" /></a></p>
<p><span style="font-size: small;"><span style="font-family: Calibri;">Click on New Query from File Menu and select Log type as IISW3CLOG and hit F5. Result will be as shown below:</span></span></p>
<p>&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/86/08/1134.Untitled1.png" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-86-08/1134.Untitled1.png"><img src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/86/08/1134.Untitled1.png" original-url="http://blogs.technet.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-86-08/1134.Untitled1.png" alt="" border="0" /></a></p>
<p><span style="font-size: small;"><span style="font-family: Calibri;">We can even write our own queries in SQL syntax to filter the data:</span></span></p>
<p>SELECT TOP 10 * FROM '[LOGFILEPATH]' where time-taken &gt;100</p>
<p><span style="font-size: small;"><span style="font-family: Calibri;">As well, there are few set of built-in queries for IIS in Library tab as shown below:</span></span></p>
<p><span style="font-size: small;"><span style="font-family: Calibri;"><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/86/08/2626.Untitled1.png" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-86-08/2626.Untitled1.png"><img src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/86/08/2626.Untitled1.png" original-url="http://blogs.technet.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-86-08/2626.Untitled1.png" alt="" border="0" /></a></span></span>&nbsp;</p>
<p><span style="font-size: small;"><span style="font-family: Calibri;">By using Log Parser studio, we can analyse large log files to find out load, performance issues to page or user level. We can use IIS logs as a first step to troubleshoot performance issues. This log helps us to find out any performance issues exist or not, if exist which page taking time to respond back etc. I will end this article, by&nbsp;mentioning tools helpful in troubleshooting IIS issues in scenarios like crash, hang, high CPU or memory etc [We will discuss on below tools in depth in coming articles]:</span></span></p>
<p><span style="font-family: Calibri; font-size: small;">1)</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="font-size: small;"><span style="font-family: Calibri;">IIS Logging</span></span></p>
<p><span style="font-family: Calibri; font-size: small;">2)</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="font-size: small;"><span style="font-family: Calibri;">IIS Advanced Logging</span></span></p>
<p><span style="font-family: Calibri; font-size: small;">3)</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="font-size: small;"><span style="font-family: Calibri;">FREB Tracing [Failed Request Tracing]</span></span></p>
<p><span style="font-family: Calibri; font-size: small;">4)</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="font-size: small;"><span style="font-family: Calibri;">Fiddler or IE Developer Tools</span></span></p>
<p><span style="font-family: Calibri; font-size: small;">5)</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="font-size: small;"><span style="font-family: Calibri;">Memory dumps collection ofw3wp.exe using Debug Diag or AD Plus.</span></span></p>
<p><span style="font-family: Calibri; font-size: small;">6)</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="font-size: small;"><span style="font-family: Calibri;">Memory dumps analysis using WinDbg tool.</span></span></p>
<p><span style="font-size: small;"><span style="font-family: Calibri;">I hope this article will be helpful for all.</span></span></p>
<p><span style="font-family: Calibri; font-size: small;">&nbsp;</span></p>]]></content:encoded>
    </item>
    <item>
      <title>Look at Raven DB Integration [NoSQL] with ASP.NET MVC 4 Application</title>
      <link>https://docs.microsoft.com/archive/blogs/sateesh-arveti/look-at-raven-db-integration-nosql-with-asp-net-mvc-4-application</link>
      <pubDate>Wed, 11 Sep 2013 23:12:00 GMT</pubDate>
      <dc:creator><![CDATA[sateesharveti]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/sateesh-arveti/2013/09/11/look-at-raven-db-integration-nosql-with-asp-net-mvc-4-application/</guid>
      <description><![CDATA[In this article, we will look into NoSQL databases, How Raven DB implements it and how to integrate...]]></description>
      <content:encoded><![CDATA[<p><span style="font-size: small;"><span style="font-family: Calibri;">In this article, we will look into NoSQL databases, How Raven DB implements it and how to integrate Raven DB with MVC 4 application. NoSQL [Not Only SQL] database is an alternative to traditional RDBMS systems like SQL Server, Oracle and it is having simple, lightweight mechanism for storage and retrieval of data that provides higher scalability and availability than traditional relational databases. &nbsp;NoSQL databases are highly used in Big Data systems, where the data's nature does not require a relational model and most of the data is semi-structured or unstructured. Raven DB, Mongo DB are few of them providing NoSQL Databases. </span></span></p>
<p><span style="font-size: small;"><span style="font-family: Calibri;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; RavenDB is a transactional, open-source Document Database [NoSQL]&nbsp;written in .NET offering a flexible data model designed to address requirements coming from real-world systems. RavenDB allows you to build high-performance, low-latency applications quickly and efficiently.&nbsp;RavenDB&nbsp;stores data&nbsp;schema-less as JSON documents within the database, and can be queried using LINQ queries or using RESTful API.</span></span></p>
<p><span style="font-size: small;"><span style="font-family: Calibri;">Let&rsquo;s take an example of storing an employee record in RDBMS vs NoSQL. In RDBMS, our database design looks like as shown below:</span></span></p>
<p><span style="font-size: small;"><span style="font-family: Calibri;"><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/86/08/4810.Untitled.png" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-86-08/4810.Untitled.png"><img src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/86/08/4810.Untitled.png" original-url="http://blogs.technet.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-86-08/4810.Untitled.png" alt="" border="0" /></a></span></span></p>
<p><span style="font-size: small;"><span style="font-family: Calibri;">When it comes to NoSQL specifically Raven DB, structure looks like as shown below:</span></span></p>
<p><code class="csharp">public class Employee<br /> {<br /> public int EmployeeId { get; set; }<br /> public string FirstName { get; set; }<br /> public string LastName { get; set; }<br /> public DateTime DateJoined { get; set; }<br /> public Position Position { get; set; }<br /> public Department Department { get; set; }<br /> }<br /> public class Position<br /> {<br /> public string Name { get; set; }<br /> public string Description { get; set; }<br /> }<br /> public class Department<br /> {<br /> public string Name { get; set; }<br /> public string Description { get; set; }<br /> }<br /> <br /> // Create an instance of Employee for stroing in Raven DB<br />&nbsp;</code></p>
<pre class="scroll"><code class="csharp">Employee objEmp = new Employee<br /> {<br /> FirstName = "AAA",<br /> LastName = "BBB",<br /> EmployeeId = 30,<br /> DateJoined = DateTime.Now.AddYears(-1),<br /> Department = new Department{ Description = "Software services", Name = "IT" },<br /> Position = new Position{ Name = "Project Lead", Description = "Project Mgmt Role" }<br /> };</code></pre>
<p><span style="font-size: small;"><span style="font-family: Calibri;">Above structure doesn&rsquo;t have any relationships as in RDBMS. This structure is simple, flexible and no need of Joins to get the Employee&rsquo;s data.</span></span></p>
<p><span style="font-size: small;"><span style="font-family: Calibri;">Let's create a sample MVC 4 application to understand it in a better way. Create a new MVC 4 Internet application and name it as RavenDBSample. Go to References under Solution Explorer, click on "Manage NuGet Packages" and install Raven DB Client [API] &amp; Server [to host Database] as shown below:</span></span></p>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/86/08/4530.Untitled.png" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-86-08/4530.Untitled.png"><img src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/86/08/4530.Untitled.png" original-url="http://blogs.technet.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-86-08/4530.Untitled.png" alt="" border="0" /></a></p>
<p>We can host database on Raven DB in below ways:</p>
<p>1)&nbsp;As a stand-alone process&nbsp;</p>
<p>2) As a&nbsp;Windows Service</p>
<p>3) Embedded within the.NET &nbsp;application</p>
<p>4) On IIS</p>
<p>In this example, we host the database as stand-alone process. Now, run Raven.Server.exe under ~\RavenDBSample\packages\RavenDB.Server.2.5.2700\tools as shown below:</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/86/08/5241.Untitled.png" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-86-08/5241.Untitled.png"><img src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/86/08/5241.Untitled.png" original-url="http://blogs.technet.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-86-08/5241.Untitled.png" alt="" border="0" /></a></p>
<p>From above console, we know that our database is listening on <a href="http://machinename:8080/">http://machinename:8080/</a>. Let's insert&nbsp;and retrieve our Employee object&nbsp;from Raven DB database. Modify Global.asax.cs to create our DocumentStore:</p>
<pre class="scroll"><code class="csharp">public class MvcApplication : System.Web.HttpApplication<br /> {<br /><strong> public static DocumentStore MyStore;</strong><br /> protected void Application_Start()<br /> {<br /> AreaRegistration.RegisterAllAreas();<br /> <br /> WebApiConfig.Register(GlobalConfiguration.Configuration);<br /> FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);<br /> RouteConfig.RegisterRoutes(RouteTable.Routes);<br /> BundleConfig.RegisterBundles(BundleTable.Bundles);<br /> AuthConfig.RegisterAuth();<br /><strong> MyStore = new DocumentStore { Url="http://localhost:8080"};</strong><br /><strong> MyStore.Initialize();</strong><br /> }<br /> }</code></pre>
<p><span style="font-size: small;"><span style="font-family: Calibri;">Creating DocumentStore object is time consuming process, so it needs to be created only once per application.Add above class definitions of Employee, Position, Department&nbsp;to AccountsModel.cs and add below code to Index view under Home folder:</span></span></p>
<pre class="scroll"><code class="html">@model RavenDBSample.Models.Employee<br /> @{<br /> ViewBag.Title = "Employee Details";<br /> }<br /> &lt;fieldset&gt;<br /> &lt;legend&gt;Employee&lt;/legend&gt;<br /> &lt;table&gt;<br /> &lt;tbody&gt;<br /> &lt;tr&gt;<br /> &lt;td&gt;<br /> First Name: @Model.FirstName<br /> &lt;/td&gt;<br /> &lt;/tr&gt;<br /> &lt;tr&gt;<br /> &lt;td&gt;<br /> Last Name: @Model.LastName<br /> &lt;/td&gt;<br /> &lt;/tr&gt;<br /> &lt;tr&gt;<br /> &lt;td&gt;<br /> Date of Join: @Model.DateJoined<br /> &lt;/td&gt;<br /> &lt;/tr&gt;<br /> &lt;tr&gt;<br /> &lt;td&gt;<br /> Position: @Model.Position.Name<br /> &lt;/td&gt;<br /> &lt;/tr&gt;<br /> &lt;tr&gt;<br /> &lt;td&gt;<br /> Department: @Model.Department.Name<br /> &lt;/td&gt;<br /> &lt;/tr&gt;<br /> &lt;/tbody&gt;<br /> &lt;/table&gt;<br /> &lt;/fieldset&gt;<br /> </code></pre>
<p>Now, add below code to Index action in HomeController to save and retrieve Employee data from Database:</p>
<p>&nbsp;<code class="csharp">public ActionResult Index()<br /> {<br /> using (var session = MvcApplication.MyStore.OpenSession())<br /> {<br /> Employee objEmp = new Employee<br /> {<br /> FirstName = "AAA",<br /> LastName = "BBB",<br /> EmployeeId = 30,<br /> DateJoined = DateTime.Now.AddYears(-1),<br /> Department = new Department{ Description = "Software services", Name = "IT" },<br /> Position = new Position{ Name = "Project Lead", Description = "Project Mgmt Role" }<br /> };<br /> session.Store(objEmp);<br /> session.SaveChanges();//To Commit our changes to DB.<br /> //Get Employee back from DB<br /> Employee myEmp = session.Query&lt;Employee&gt;().Where(a =&gt; a.FirstName == "AAA").First();<br /> return View(myEmp);<br /> }<br /> }</code></p>
<p>Run the application, it will show the Employee details.&nbsp;We haven't created any tables in Raven DB and those are created on the fly&nbsp;to store&nbsp;Employee object. I attached source code of this application. We will look into more details of Raven DB with MVC 4 and Web API&nbsp;in coming articles. I hope this article will be helpful for all.</p>
<p><br />&nbsp;</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/telligent.evolution.components.attachments/01/8608/00/00/03/59/61/57/RavenDBSample.rar" original-url="http://blogs.technet.com/cfs-filesystemfile.ashx/__key/telligent-evolution-components-attachments/01-8608-00-00-03-59-61-57/RavenDBSample.rar">RavenDBSample.rar</a></p>]]></content:encoded>
    </item>
    <item>
      <title>Custom HTML Helper methods in ASP.NET MVC 4</title>
      <link>https://docs.microsoft.com/archive/blogs/sateesh-arveti/custom-html-helper-methods-in-asp-net-mvc-4</link>
      <pubDate>Fri, 06 Sep 2013 04:48:00 GMT</pubDate>
      <dc:creator><![CDATA[sateesharveti]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/sateesh-arveti/2013/09/06/custom-html-helper-methods-in-asp-net-mvc-4/</guid>
      <description><![CDATA[In this article, we will look into different approaches available for creating custom Helper methods...]]></description>
      <content:encoded><![CDATA[<p><span style="font-size: small;"><span style="font-family: Calibri;">In this article, we will look into different approaches available for creating custom Helper methods within ASP.NET MVC 4 application. An HTML Helper is just a method that returns a string having HTML or plain text and can be used in our Views. We have built-in Helpers like Html.ActionLink(),Html.CheckBox() etc. Let&rsquo;s create our own Helper method. Create a new Internet MVC 4 application and name it as MyCustomHelper.</span></span></p>
<p><span style="font-size: small;"><span style="font-family: Calibri;">We will create a Helper method to strip\remove the HTML tags from a string. Modify the Index view with code as shown below:</span></span></p>
<p><code class="html">@{<br /> ViewBag.Title = "Home Page";<br /> }<br /> @helper StripHTML(string input)<br /> {<br /> &lt;b&gt;<br /> @System.Text.RegularExpressions.Regex.Replace(input, "&lt;.*?&gt;", string.Empty)<br /> &lt;/b&gt;<br /> }<br /> &lt;div&gt;<br /> HTML Content: @HttpUtility.HtmlDecode("&lt;div&gt;&lt;p&gt;Test&lt;/p&gt;&lt;br/&gt;&lt;/div&gt;")<br /> &lt;br /&gt;<br /> Plain Content:@StripHTML("&lt;div&gt;&lt;p&gt;Test&lt;/p&gt;&lt;/div&gt;")<br /> &lt;/div&gt;</code></p>
<p><span style="font-size: small;"><span style="font-family: Calibri;">Above Helper will strip the HTML from any parameter passed to it and renders on the View.&nbsp;Syntax is for defining a helper is similar to defining a Method&nbsp;without return type.&nbsp;This way, we can create Helper method with our logic &amp; markup needed. One problem here is, we can't reuse it in other Views. To solve this, we can&nbsp;m</span></span><span style="font-size: small;"><span style="font-family: Calibri;">ove the Index.cshtml having custom Helper to App_code folder [Create it, if not exist] and access the helper in any View by mentioning ViewName.HelperName as shown in below code:</span></span></p>
<p><code class="csharp">@Index.StripHTML("&lt;div&gt;&lt;p&gt;Test&lt;/p&gt;&lt;/div&gt;")</code></p>
<p><span style="font-size: small;"><span style="font-family: Calibri;">Another approach to create custom HTML helper is using Extension methods. Add a new class named MyHelper.cs with below code:</span></span></p>
<p><code class="csharp">using System;<br /> using System.Collections.Generic;<br /> using System.Linq;<br /> using System.Web;<br /> using System.Web.Mvc;<br /> <br /> namespace MyCustomHelper.Helpers<br /> {<br /> public static class MyHelper<br /> {<br /> public static MvcHtmlString StripHTML(this HtmlHelper html, string input)<br /> {<br /> return new MvcHtmlString(System.Text.RegularExpressions.Regex.Replace(input, "&lt;.*?&gt;", string.Empty));<br /> }<br /> }<br /> }</code></p>
<p><span style="font-size: small;"><span style="font-family: Calibri;">Build the project and include below code in the view, where you need to access the Helper Method as shown below:</span></span></p>
<p><code class="csharp">@using MyCustomHelper.Helpers<br /> <br /> @Html.StripHTML("&lt;div&gt;&lt;p&gt;Test&lt;/p&gt;&lt;/div&gt;")</code></p>
<p><span style="font-size: small;"><span style="font-family: Calibri;">I am attaching source code for reference. By following above two approaches, we can create our own HTML helpers for using in the Views. I hope this article will be helpful for all.</span></span></p>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/telligent.evolution.components.attachments/01/8608/00/00/03/59/50/36/MyCustomHelper.zip" original-url="http://blogs.technet.com/cfs-filesystemfile.ashx/__key/telligent-evolution-components-attachments/01-8608-00-00-03-59-50-36/MyCustomHelper.zip">MyCustomHelper.zip</a></p>]]></content:encoded>
    </item>
    <item>
      <title>Look at ASP.NET MVC 4 Project Structure</title>
      <link>https://docs.microsoft.com/archive/blogs/sateesh-arveti/look-at-asp-net-mvc-4-project-structure</link>
      <pubDate>Thu, 05 Sep 2013 03:47:00 GMT</pubDate>
      <dc:creator><![CDATA[sateesharveti]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/sateesh-arveti/2013/09/05/look-at-asp-net-mvc-4-project-structure/</guid>
      <description><![CDATA[In this article, we will look into the Visual Studio project structure for MVC 4 application. We can...]]></description>
      <content:encoded><![CDATA[<p><span style="font-family: Calibri; font-size: small;">In this article, we will look into the Visual Studio project structure for MVC 4 application. We can install MVC 4 on top of VS 2010 SP1\2012 from </span><a href="http://www.microsoft.com/en-in/download/details.aspx?id=30683"><span style="color: #0000ff; font-family: Calibri; font-size: small;">here</span></a><span style="font-size: small;"><span style="font-family: Calibri;">. After installing MVC 4 on VS 2010, create a new ASP.NET MVC 4 Web Application and name it as MVC4PrjStructure. &nbsp;It opens below window to select the type of project:</span></span></p>
<p>&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/86/08/4382.Untitled.png" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-86-08/4382.Untitled.png"><img src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/86/08/4382.Untitled.png" original-url="http://blogs.technet.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-86-08/4382.Untitled.png" alt="" border="0" /></a></p>
<p><span style="font-size: small;"><span style="font-family: Calibri;">New templates in MVC 4 are</span></span></p>
<p><span style="font-family: Calibri; font-size: small;">1)</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="font-size: small;"><span style="font-family: Calibri;">Mobile Application &nbsp;- It is used to create web application targeting mobile devices with Forms Authentication</span></span></p>
<p><span style="font-family: Calibri; font-size: small;">2)</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="font-size: small;"><span style="font-family: Calibri;">Web API &ndash; It is used to develop HTTP services that targets broad range of clients like browsers, mobile devices, any applications that can understand HTTP protocol and it&rsquo;s a platform for building RESTful applications.</span></span></p>
<p><span style="font-size: small;"><span style="font-family: Calibri;">Select Internet Application as Project type and click Ok. Open Solution Explorer and it is as shown below:</span></span></p>
<p>&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/86/08/1680.Untitled.png" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-86-08/1680.Untitled.png"><img src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/86/08/1680.Untitled.png" original-url="http://blogs.technet.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-86-08/1680.Untitled.png" alt="" width="250" height="818" border="0" /></a></p>
<p><span style="font-size: small;"><span style="font-family: Calibri;">First noticeable change in project structure is in App_Start folder. Let&rsquo;s look into it one by one:</span></span></p>
<p><span style="font-family: Calibri; font-size: small;">1)</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="font-size: small;"><span style="font-family: Calibri;">AuthConfig.cs &ndash; This file contains code to register clients for external authentication providers like Facebook, Twitter etc. By default, this code is commented out, so none of the external providers are enabled.</span></span></p>
<p><span style="font-family: Calibri; font-size: small;">2)</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="font-family: Calibri; font-size: small;">BundleConfig.cs &ndash; This file contains code for configuring Bundling and minification features. Refer </span><a href="http://blogs.technet.com/b/sateesh-arveti/archive/2011/10/20/bundling-and-minification-in-asp-net-4-5.aspx"><span style="color: #0000ff; font-family: Calibri; font-size: small;">here</span></a><span style="font-size: small;"><span style="font-family: Calibri;"> for getting an idea on this feature.</span></span></p>
<p><span style="font-family: Calibri; font-size: small;">3)</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="font-size: small;"><span style="font-family: Calibri;">FilterConfig.cs &ndash; This file contains code for registering filters. A filter is a method that contains logic need to be executed before or after an action method call.</span></span></p>
<p><span style="font-family: Calibri; font-size: small;">4)</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="font-size: small;"><span style="font-family: Calibri;">RoutConfig.cs &ndash; This file contains code for registering the routes. A route defines mapping of incoming browser requests to particular MVC controller actions.</span></span></p>
<p><span style="font-family: Calibri; font-size: small;">5)</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="font-size: small;"><span style="font-family: Calibri;">WebApiConfig.cs &ndash; This file contains code for configuring Web API like routes.</span></span></p>
<p><span style="font-size: small;"><span style="font-family: Calibri;">Prior to MVC 4, all the above settings can be defined in Global.asax file. For maintainability, It got split into different files.</span></span></p>
<p><span style="font-size: small;"><span style="font-family: Calibri;">In Filters folder, we can define filters for the application and separate folder for Images, which is not part of Content folder in this release.</span></span></p>
<p><span style="font-size: small;"><span style="font-family: Calibri;">Next major addition is packages.config. This file is managed by NuGet infrastructure for tracking\updating packages like jQuery, jQuery UI, EntityFramework, Modernizr etc and their version used in the application. It looks like as shown below:</span></span></p>
<p>&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/86/08/6283.Untitled.png" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-86-08/6283.Untitled.png"><img src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/86/08/6283.Untitled.png" original-url="http://blogs.technet.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-86-08/6283.Untitled.png" alt="" border="0" /></a></p>
<p><span style="font-size: small;"><span style="font-family: Calibri;">For example, your application is using jQuery package 1.7 and you want to point it to 1.8. Prior to this release, we need to manually download the 1.8 version separately and include it in the project. In MVC 4, we can do it easily by just clicking on Manage NuGet Packages as shown below:</span></span></p>
<p>&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/86/08/8004.Untitled1.png" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-86-08/8004.Untitled1.png"><img src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/86/08/8004.Untitled1.png" original-url="http://blogs.technet.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-86-08/8004.Untitled1.png" alt="" border="0" /></a></p>
<p><span style="font-size: small;"><span style="font-family: Calibri;">It will show up below window, where we can install\update the packages with its latest version:</span></span></p>
<p>&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/86/08/5466.Untitled1.png" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-86-08/5466.Untitled1.png"><img src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/86/08/5466.Untitled1.png" original-url="http://blogs.technet.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-86-08/5466.Untitled1.png" alt="" border="0" /></a></p>
<p><span style="font-size: small;"><span style="font-family: Calibri;">The above project structure will also apply to Web API project. In Web API project, a controller is inherited from ApiController and won&rsquo;t return a view in the action method as shown below:</span></span></p>
<p>&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/86/08/1768.Untitled1.png" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-86-08/1768.Untitled1.png"><img src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/86/08/1768.Untitled1.png" original-url="http://blogs.technet.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-86-08/1768.Untitled1.png" alt="" border="0" /></a></p>
<p><span style="font-size: small;"><span style="font-family: Calibri;">This article covers changes included in MVC 4 project template. &nbsp;In coming articles, we will discuss more about MVC 4 features. I hope this article will be helpful for all.</span></span></p>]]></content:encoded>
    </item>
    <item>
      <title>Export jqPlot Chart to PowerPoint using Open XML in MVC application</title>
      <link>https://docs.microsoft.com/archive/blogs/sateesh-arveti/export-jqplot-chart-to-powerpoint-using-open-xml-in-mvc-application</link>
      <pubDate>Tue, 03 Sep 2013 05:15:00 GMT</pubDate>
      <dc:creator><![CDATA[sateesharveti]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/sateesh-arveti/2013/09/03/export-jqplot-chart-to-powerpoint-using-open-xml-in-mvc-application/</guid>
      <description><![CDATA[In this article, we will design an MVC application that will export jqPlot chart into a PowerPoint...]]></description>
      <content:encoded><![CDATA[<p><span style="font-family: Calibri;">In this article, we will design an MVC application that will export jqPlot chart into a PowerPoint file. jqPlot is a plotting and charting plugin for the jQuery Javascript framework. Open XML is a library &amp; document format to manipulate Office documents like Word, Excel and PowerPoint. &nbsp;Create an internet MVC 3 application in VS 2010 and name it as ExportjqPlotChart. Now, add reference to DocumentFormat.OpenXml.dll, WindowsBase.dll [Download from </span><a href="http://www.microsoft.com/en-in/download/details.aspx?id=5124"><span style="color: #0000ff; font-family: Calibri;">here</span></a><span style="font-family: Calibri;">]. Include jqPlot files [jquery.jqplot.min.js, jqplot.pieRenderer.min.js] and below Open XML namespaces</span></p>
<pre class="scroll"><code class="cplusplus">using DocumentFormat.OpenXml;<br />using DocumentFormat.OpenXml.Presentation;<br />using DocumentFormat.OpenXml.Packaging;<br />using DocumentFormat.OpenXml.Drawing.Charts;<br /></code></pre>
<p>Modify Index view under Home Controller to generate jqPlot chart as shown below:</p>
<pre class="scroll"><code class="html">@using (Html.BeginForm())<br /> {<br /> &lt;div&gt;<br /> &lt;div id="divChart" style="width:350px;height:400px;"&gt;&lt;/div&gt;<br /> Graph's Image:<br /> &lt;div id="divChartImg"&gt;&lt;/div&gt;<br /> &lt;br /&gt;<br /> &lt;input type="button" name="ExportGraph" id="ExportGraph" value="Export Chart" /&gt;<br /> &lt;input type="hidden" name="imgData" id="imgData" value="hidden text" /&gt;<br /> &lt;/div&gt;<br /> }<br /> <br /> &lt;script type="text/javascript"&gt;<br /> $(document).ready(function () {<br /> <br /> //Draw a Sample jqPlot chart<br /> var data = [['Heavy Industry', 12], ['Retail', 9], ['Light Industry', 14], ['Out of home', 16], ['Commuting', 7], ['Orientation', 9]];<br /> var plot1 = jQuery.jqplot('divChart', [data], { seriesDefaults: { renderer: jQuery.jqplot.PieRenderer, rendererOptions: { showDataLabels: true} }, legend: { show: true, location: 'e'} }); // Save Image's data embedded in src attribute in a hidden variable <br /> $("#ExportGraph").click(function () //Convert Graph to Image<br /> var j = $("#divChart").jqplotToImageElem();<br /> $("#divChartImg").append(j);<br /> $('#divChart').hide();<br /> $("#imgData").val($("#divChartImg img").attr('src'));<br /> $('form').submit();<br /> });<br /> });<br /> &lt;/script&gt;</code></pre>
<p>On click of Export Chart button, we&nbsp;converted&nbsp;Pie chart to a image using jqplotToImageElem() . Than, the Graph's image content embedded in src attribute of divChartImg is stored in a hidden variable to access in our action after form submission. <br />Create a PowerPoint file having a sample image named as Template.pptx under Content folde as shown below:</p>
<pre class="scroll"><code class="html"><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/86/08/8308.Untitled.png" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-86-08/8308.Untitled.png"><img src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/86/08/8308.Untitled.png" original-url="http://blogs.technet.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-86-08/8308.Untitled.png" alt="" border="0" /></a></code></pre>
<p>Add below POST action for saving the Graph's image and returning the PowerPoint.</p>
<pre class="scroll"><code class="csharp"> [HttpPost]<br /> public ActionResult Index(FormCollection form)<br /> {<br /> try<br /> {<br /> //Save Image of jqPlot Chart to a file<br /> string fileName = Guid.NewGuid().ToString()+".jpg";<br /> var data = form["imgData"].Replace("data:image/png;base64,", "");<br /> Byte[] bitmapData = new Byte[data.Length];<br /> bitmapData = Convert.FromBase64String(FixBase64ForImage(data));<br /> System.IO.MemoryStream streamBitmap = new System.IO.MemoryStream(bitmapData);<br /> Bitmap bitImage = new Bitmap((Bitmap)Image.FromStream(streamBitmap));<br /> //bitImage.Save(Server.MapPath("~/content/") + fileName);// This statement will save file locally as an Image.<br /> <br /> //Insert the jqPlot Chart's Image into PowerPoint<br /> using (PresentationDocument prstDoc = PresentationDocument.Open(Server.MapPath("~/content/") + "Template.pptx", true))<br /> {<br /> string imgId = "rId" + new Random().Next(2000).ToString();<br /> ImagePart imagePart = prstDoc.PresentationPart.SlideParts.FirstOrDefault().AddImagePart(ImagePartType.Jpeg, imgId);<br /> imagePart.FeedData(new MemoryStream(bitmapData.ToArray()));<br /> DocumentFormat.OpenXml.Drawing.Blip blip = prstDoc.PresentationPart.SlideParts.FirstOrDefault().Slide.Descendants&lt;DocumentFormat.OpenXml.Drawing.Blip&gt;().First();<br /> blip.Embed = imgId;<br /> prstDoc.PresentationPart.SlideParts.FirstOrDefault().Slide.Save();<br /> prstDoc.PresentationPart.Presentation.Save();<br /> prstDoc.Close();<br /> }<br /> return File(Server.MapPath("~/content/") + "Template.pptx", "application/mspowerpoint", "Graph.pptx");<br /> }<br /> catch (Exception ex)<br /> {<br /> <br /> return Content(ex.Message);<br /> }<br /> }<br /> public string FixBase64ForImage(string Image)<br /> {<br /> System.Text.StringBuilder sbText = new System.Text.StringBuilder(Image, Image.Length);<br /> <br /> sbText.Replace("\r\n", String.Empty);<br /> <br /> sbText.Replace(" ", String.Empty);<br /> <br /> return sbText.ToString();<br /> }<br /> <br /> }</code></pre>
<p>We read the byte stream of Chart's image and added as an Imagepart to PPT. Finally,&nbsp;PPT&nbsp;image is replaced with Graph's image and returned to client as a File Result. I will outline the steps followed for exporting jqPlot chart to PowerPoint:</p>
<p>1) Created a sample jqPlot Pie chart<br /> 2) Converted it to image using jqplotToImageElem().<br /> 3) Image content in bytes is submitted to the action as a hidden variable.<br /> 4) This image's bytes are passed as a Memory stream in PowerPoint and replaced the actual image by mapping it to new ImgId.<br /> <br /> I am attaching the source code reference. By tweaking the above code, we can export any jqPlot&nbsp;graph&nbsp;to an image and than into&nbsp;PowerPoint<span style="font-family: Calibri;">. </span>&nbsp;I hope this article might be helpful to all.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/telligent.evolution.components.attachments/01/8608/00/00/03/59/42/69/ExportjqPlotChart.zip" original-url="http://blogs.technet.com/cfs-filesystemfile.ashx/__key/telligent-evolution-components-attachments/01-8608-00-00-03-59-42-69/ExportjqPlotChart.zip">ExportjqPlotChart.zip</a></p>]]></content:encoded>
    </item>
    <item>
      <title>Customize Bar chart using Open XML in MVC application</title>
      <link>https://docs.microsoft.com/archive/blogs/sateesh-arveti/customize-bar-chart-using-open-xml-in-mvc-application</link>
      <pubDate>Mon, 02 Sep 2013 06:00:00 GMT</pubDate>
      <dc:creator><![CDATA[sateesharveti]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/sateesh-arveti/2013/09/02/customize-bar-chart-using-open-xml-in-mvc-application/</guid>
      <description><![CDATA[Open XML is a Microsoft library to manipulate Office documents like Word, Excel, PowerPoint...]]></description>
      <content:encoded><![CDATA[<p><span style="font-family: Calibri;">Open XML is a Microsoft library to manipulate Office documents like Word, Excel, PowerPoint programmatically and can be downloaded from </span><a href="http://www.microsoft.com/en-in/download/details.aspx?id=5124"><span style="color: #0000ff; font-family: Calibri;">here</span></a><span style="font-family: Calibri;">. It&rsquo;s also a document format which consists of XML parts in ZIP package representing Word (WordprocessingML), Excel (SpreadsheetML), PowerPoint (PresentationML).</span></p>
<p><span style="font-family: Calibri;">&nbsp;In this article, we will be looking into customization of a Bar chart in PowerPoint using Open XML library within ASP.NET MVC application. Create a new MVC 3 Internet application on VS 2010 and name it as PPTBarChart. Add a reference to DocumentFormat.OpenXml.dll, WindowsBase.dll&nbsp;[Download from </span><a href="http://www.microsoft.com/en-in/download/details.aspx?id=5124"><span style="color: #0000ff; font-family: Calibri;">here</span></a><span style="font-family: Calibri;">]. Create a PowerPoint 2007/2010 with bar chart having two categories under Content folder as shown below:</span></p>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/86/08/5635.Untitled.png" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-86-08/5635.Untitled.png"><img src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/86/08/5635.Untitled.png" original-url="http://blogs.technet.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-86-08/5635.Untitled.png" alt="" border="0" /></a>&nbsp;</p>
<p><span style="font-family: Calibri;">Modify Index view as shown below to enter values for customizing the bar chart&rsquo;s values, Maximum, Direction &amp; Grouping etc:</span></p>
<p>&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/86/08/7573.Untitled.png" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-86-08/7573.Untitled.png"><img src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/86/08/7573.Untitled.png" original-url="http://blogs.technet.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-86-08/7573.Untitled.png" alt="" border="0" /></a></p>
<p><span style="font-family: Calibri;">Include&nbsp;below namespaces in the HomeController:</span></p>
<p><span style="font-family: Calibri;">using DocumentFormat.OpenXml;<br />using DocumentFormat.OpenXml.Presentation;<br />using DocumentFormat.OpenXml.Packaging;<br />using DocumentFormat.OpenXml.Drawing.Charts;</span></p>
<p><span style="font-family: Calibri;">Create below POST action to read the PowerPoint, replace the chart&rsquo;s value and send it to client for download as shown below:</span></p>
<p><code class="cplusplus">[HttpPost]<br /> public ActionResult Index(FormCollection form)<br /> {<br /> //Read PPT in-memory for inline editing<br /> byte[] byteArrayPPT = System.IO.File.ReadAllBytes(Server.MapPath(@"~\content\BarGraphPPT.pptx"));<br /> MemoryStream FPmem = new MemoryStream();<br /> FPmem.Write(byteArrayPPT, 0, (int)byteArrayPPT.Length);<br /> PresentationDocument barPPT = PresentationDocument.Open(FPmem, true);<br /> // Get the chart in the first slide<br /> ChartPart chartPart = barPPT.PresentationPart.SlideParts.First().ChartParts.First();<br /> ChartSpace chartSpace = chartPart.ChartSpace;<br /> List&lt;int&gt; indexOfUsedItems = new List&lt;int&gt;();<br /> BarChart barChart = chartSpace.Descendants&lt;BarChart&gt;().FirstOrDefault();<br /> //Set Max Value for Y Axis:<br /> if (((DocumentFormat.OpenXml.Drawing.Charts.MaxAxisValue)chartPart.ChartSpace.Descendants&lt;DocumentFormat.OpenXml.Drawing.Charts.MaxAxisValue&gt;().FirstOrDefault()) != null)<br /> {<br /> ((DocumentFormat.OpenXml.Drawing.Charts.MaxAxisValue)chartPart.ChartSpace.Descendants&lt;DocumentFormat.OpenXml.Drawing.Charts.MaxAxisValue&gt;().FirstOrDefault()).Val.Value = Convert.ToInt32(Request.Form["MaxValue"]);<br /> }<br /> //Set Bar Direction:<br /> if (form["BarDirection"] == "Column")<br /> {<br /> barChart.BarDirection = new BarDirection() { Val = BarDirectionValues.Column };<br /> }<br /> else if (form["BarDirection"] == "Bar")<br /> {<br /> barChart.BarDirection = new BarDirection() { Val = BarDirectionValues.Bar };<br /> }<br /> <br /> //Set Bar Grouping:<br /> if (form["BarGroup"] == "Clustered")<br /> {<br /> barChart.BarGrouping = new BarGrouping() { Val = BarGroupingValues.Clustered };<br /> }<br /> else if (form["BarGroup"] == "Stacked")<br /> {<br /> barChart.BarGrouping = new BarGrouping() { Val = BarGroupingValues.Stacked };<br /> }<br /> else if (form["BarGroup"] == "PercentStacked")<br /> {<br /> barChart.BarGrouping = new BarGrouping() { Val = BarGroupingValues.PercentStacked };<br /> }<br /> else if (form["BarGroup"] == "Standard")<br /> {<br /> barChart.BarGrouping = new BarGrouping() { Val = BarGroupingValues.Standard };<br /> }<br /> //Set Bar's Value:<br /> if(!String.IsNullOrEmpty(form["Series11Value"].ToString()))<br /> barChart.Descendants&lt;NumericPoint&gt;().ElementAt(0).NumericValue = new NumericValue(form["Series11Value"].ToString());<br /> if (!String.IsNullOrEmpty(form["Series21Value"].ToString()))<br /> barChart.Descendants&lt;NumericPoint&gt;().ElementAt(1).NumericValue = new NumericValue(form["Series21Value"].ToString());<br /> if (!String.IsNullOrEmpty(form["Series12Value"].ToString()))<br /> barChart.Descendants&lt;NumericPoint&gt;().ElementAt(2).NumericValue = new NumericValue(form["Series12Value"].ToString());<br /> if (!String.IsNullOrEmpty(form["Series22Value"].ToString()))<br /> barChart.Descendants&lt;NumericPoint&gt;().ElementAt(3).NumericValue = new NumericValue(form["Series22Value"].ToString());<br /> if (!String.IsNullOrEmpty(form["Series31Value"].ToString()))<br /> barChart.Descendants&lt;NumericPoint&gt;().ElementAt(4).NumericValue = new NumericValue(form["Series31Value"].ToString());<br /> if (!String.IsNullOrEmpty(form["Series32Value"].ToString()))<br /> barChart.Descendants&lt;NumericPoint&gt;().ElementAt(5).NumericValue = new NumericValue(form["Series32Value"].ToString());<br /> <br /> <br /> barPPT.PresentationPart.Presentation.Save();<br /> <br /> barPPT.Close();<br /> <br /> string fileName = Server.MapPath(@"~\content\"+Guid.NewGuid().ToString()+".pptx");<br /> using (FileStream fileStream = new FileStream(fileName, System.IO.FileMode.Create))<br /> {<br /> FPmem.WriteTo(fileStream);<br /> FPmem.Flush();<br /> FPmem.Close();<br /> <br /> }<br /> return File(fileName, "application/mspowerpoint", "BarGraphPPT.pptx");<br /> }<br /> </code></p>
<p><span style="font-family: Calibri;">Let&rsquo;s dig into above code:</span></p>
<p><span style="font-family: Calibri;">1)</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="font-family: Calibri;">We read the PPT content into Memory for in-line editing. This will avoid the changes to be written onto original file [BarGraphPPT.pptx].</span></p>
<p><span style="font-family: Calibri;">2)</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="font-family: Calibri;">Find the first chart on the first slide and set its Maximum Y Axis value.</span></p>
<p><span style="font-family: Calibri;">3)</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="font-family: Calibri;">Similar way, we are setting other values retrieved from the view like bar direction, Group and Category&rsquo;s values.</span></p>
<p><span style="font-family: Calibri;">4)</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="font-family: Calibri;">We are saving all the changes of the in-memory PPT and&nbsp;written to a file.</span></p>
<p><span style="font-family: Calibri;">5)</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="font-family: Calibri;">Finally, we are returning the file back to client for download.</span></p>
<p><span style="font-family: Calibri;">&nbsp;We can run the application and customize the properties of the Bar chart and click on "Download Graph" to download the PowerPoint. By tweaking the above code, we can customize any kind &amp; number of graphs within a PowerPoint</span><span style="font-family: Calibri;">. I hope this article will be helpful.</span></p>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/telligent.evolution.components.attachments/01/8608/00/00/03/59/40/93/PPTBarChart.zip" original-url="http://blogs.technet.com/cfs-filesystemfile.ashx/__key/telligent-evolution-components-attachments/01-8608-00-00-03-59-40-93/PPTBarChart.zip">PPTBarChart.zip</a></p>]]></content:encoded>
    </item>
    <item>
      <title>Commands to ListExtract dlls from Memory Dump using WinDbg</title>
      <link>https://docs.microsoft.com/archive/blogs/sateesh-arveti/commands-to-listextract-dlls-from-memory-dump-using-windbg</link>
      <pubDate>Thu, 09 Feb 2012 02:26:00 GMT</pubDate>
      <dc:creator><![CDATA[sateesharveti]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/sateesh-arveti/2012/02/09/commands-to-listextract-dlls-from-memory-dump-using-windbg/</guid>
      <description><![CDATA[In this blog, we will look into commands that will help us in listing the modules (or) dlls loaded...]]></description>
      <content:encoded><![CDATA[<p>In this blog, we will look into commands that will help us in listing the modules (or) dlls loaded into your memory dump using WinDbg. Open your memory dump and load sos.dll. We can use lm command to list all loaded/unloaded modules in your dump.</p>
<p>Syntax:</p>
<p>lm Options [a Address] [m Pattern | M Pattern]</p>
<p>Output:</p>
<p>start&nbsp;&nbsp;&nbsp; end&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; module name<br /><strong>00600000 00602600&nbsp;&nbsp; 2xcxcnk7&nbsp;&nbsp; (deferred)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</strong>&nbsp;&nbsp;&nbsp;&nbsp; <br />00800000 00ac5000&nbsp;&nbsp; xpsp2res&nbsp;&nbsp; (no symbols)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br />01000000 01005000&nbsp;&nbsp; w3wp&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (private pdb symbols)&nbsp; c:\symsrv\w3wp.pdb\35B93EEEB1524E2C8368E5DAB78748A51\w3wp.pdb<br />02050000 02052600&nbsp;&nbsp; jf7rcnjd&nbsp;&nbsp; (deferred)&nbsp;</p>
<p>Unloaded modules:<br />5e320000 5e329000&nbsp;&nbsp; perfdisk.dll<br />5e310000 5e318000&nbsp;&nbsp; perfnet.dll</p>
<p>First Column [start] in the output shows the base/start address at which the module loaded.</p>
<p>Second Column [End] shows the address upto which the module loaded.</p>
<p>Third Column [Module Name] typically shows file name of the module without extension.</p>
<p>Last Column [without Header] shows the path of symbol file, if symbols loaded for that module.</p>
<p>In above output, for module <strong>2xcxcnk7</strong>&nbsp; <strong>start</strong> is "<strong>00600000" </strong>and end is "00602600". It means this module extends from "<strong>0X00600000</strong>" to "<strong>0X00602600</strong>",&nbsp;inclusive.</p>
<p>We can sort the output based on module name instead of start address&nbsp;using "lmsm". Use "lm 1m" to list only module names and "lm m *s*" to list modules having letter s in its module name.</p>
<p>In order to extract all modules/dlls from your memory dump to a folder, use "!sam c:\myModules" (or) !SaveAllModules c:\myModules.</p>
<p>To extract a specify module, use "!SaveModule startaddress path" as shown below:</p>
<p>!SaveModule 00600000 c:\test.dll</p>
<p>Use "!lmi start-address/Module-Name" command to get detailed information about a module.</p>
<p>!lmi 00600000</p>
<p>!lmi 2xcxcnk7</p>
<p>Output:</p>
<p>Loaded Module Info: [00600000] <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Module: 2xcxcnk7<br />&nbsp;&nbsp; Base Address: 00600000<br />&nbsp;&nbsp;&nbsp;&nbsp; Image Name: 2xcxcnk7.dll<br />&nbsp;&nbsp; Machine Type: 332 (I386)<br />&nbsp;&nbsp;&nbsp;&nbsp; Time Stamp: 4f3194b6 Wed Feb 08 02:46:38 2012<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Size: 8000<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CheckSum: 0<br />Characteristics: 2102&nbsp; <br />Debug Directories not present<br />&nbsp;&nbsp;&nbsp; Symbol Type: DEFERRED - No error - symbol load deferred<br />&nbsp;&nbsp;&nbsp; Load Report: no symbols loaded</p>
<p>&nbsp;</p>]]></content:encoded>
    </item>
    <item>
      <title>Look at Internet Explorer 9 Developer Tools</title>
      <link>https://docs.microsoft.com/archive/blogs/sateesh-arveti/look-at-internet-explorer-9-developer-tools</link>
      <pubDate>Wed, 04 Jan 2012 12:43:00 GMT</pubDate>
      <dc:creator><![CDATA[sateesharveti]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/sateesh-arveti/2012/01/04/look-at-internet-explorer-9-developer-tools/</guid>
      <description><![CDATA[...]]></description>
      <content:encoded><![CDATA[<div style="display: none;" id="cboxOverlay" jquery16108617946261021775="1"></div>
<div style="padding-bottom: 30px; padding-right: 2px; display: none;" id="colorbox" class="cboxIE" jquery16108617946261021775="11">
<div id="cboxWrapper">
<div>
<div style="float: left;" id="cboxTopLeft"></div>
<div style="float: left;" id="cboxTopCenter"></div>
<div style="float: left;" id="cboxTopRight"></div>
</div>
<div style="clear: left;">
<div style="float: left;" id="cboxMiddleLeft"></div>
<div style="float: left;" id="cboxContent">
<div style="width: 0px; height: 0px; overflow: hidden;" id="cboxLoadedContent" jquery16108617946261021775="3"></div>
<div id="cboxLoadingOverlay" jquery16108617946261021775="4"></div>
<div id="cboxLoadingGraphic" jquery16108617946261021775="5"></div>
<div id="cboxTitle" jquery16108617946261021775="6"></div>
<div id="cboxCurrent" jquery16108617946261021775="7"></div>
<div id="cboxNext" jquery16108617946261021775="8"></div>
<div id="cboxPrevious" jquery16108617946261021775="9"></div>
<div id="cboxSlideshow" jquery16108617946261021775="2"></div>
<div id="cboxClose" jquery16108617946261021775="10"></div>
</div>
<div style="float: left;" id="cboxMiddleRight"></div>
</div>
<div style="clear: left;">
<div style="float: left;" id="cboxBottomLeft"></div>
<div style="float: left;" id="cboxBottomCenter"></div>
<div style="float: left;" id="cboxBottomRight"></div>
</div>
</div>
<div style="position: absolute; width: 9999px; display: none; visibility: hidden;"></div>
</div>
<div style="display: none;" id="cboxOverlay" jquery16109218174750755341="1"></div>
<div style="padding-bottom: 30px; padding-right: 2px; display: none;" id="colorbox" class="cboxIE" jquery16109218174750755341="11">
<div id="cboxWrapper">
<div>
<div style="float: left;" id="cboxTopLeft"></div>
<div style="float: left;" id="cboxTopCenter"></div>
<div style="float: left;" id="cboxTopRight"></div>
</div>
<div style="clear: left;">
<div style="float: left;" id="cboxMiddleLeft"></div>
<div style="float: left;" id="cboxContent">
<div style="width: 0px; height: 0px; overflow: hidden;" id="cboxLoadedContent" jquery16109218174750755341="3"></div>
<div id="cboxLoadingOverlay" jquery16109218174750755341="4"></div>
<div id="cboxLoadingGraphic" jquery16109218174750755341="5"></div>
<div id="cboxTitle" jquery16109218174750755341="6"></div>
<div id="cboxCurrent" jquery16109218174750755341="7"></div>
<div id="cboxNext" jquery16109218174750755341="8"></div>
<div id="cboxPrevious" jquery16109218174750755341="9"></div>
<div id="cboxSlideshow" jquery16109218174750755341="2"></div>
<div id="cboxClose" jquery16109218174750755341="10"></div>
</div>
<div style="float: left;" id="cboxMiddleRight"></div>
</div>
<div style="clear: left;">
<div style="float: left;" id="cboxBottomLeft"></div>
<div style="float: left;" id="cboxBottomCenter"></div>
<div style="float: left;" id="cboxBottomRight"></div>
</div>
</div>
<div style="position: absolute; width: 9999px; display: none; visibility: hidden;"></div>
</div>
<p>In this Blog, We will look into Developer Tools for Internet Explorer 9 that helps Web developer to debug/troubleshoot issues. Our focus will be mainly on network tab in it, which will help to see request &amp; response headers, cookies, body Initiator and Timings etc. To analyze request/response headers &amp; body or capture a network trace&nbsp;in previous versions of Internet Explorer, We need external tools like Fiddler. But, in IE 9 we have built-in component inside Developer Tools to capture a trace and analyze it. We can show/hide Developer Tools from Tools menu&nbsp;-&gt; F12 Developer Tools or using F12 key. By default, Network capture is disabled as shown below:</p>
<p></p>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/86/08/8358.1.png" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-86-08/8358.1.png"><img border="0" alt="" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/86/08/8358.1.png" original-url="http://blogs.technet.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-86-08/8358.1.png" /></a></p>
<p>Click on Start Capturing and open a website like bing.com. It will capture network traffic as shown below:</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/86/08/6036.1.png" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-86-08/6036.1.png"><img border="0" alt="" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/86/08/6036.1.png" original-url="http://blogs.technet.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-86-08/6036.1.png" /></a></p>
<p>Initiator&nbsp;for a request shows who initiated that request. In above capture, it shows download/request for homepageFD_c.css is initiated by link tag referring it.</p>
<p>We can double-click on any of the request to see more details of it like header, body and cookies as shown below:</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/86/08/0435.1.png" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-86-08/0435.1.png"><img border="0" alt="" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/86/08/0435.1.png" original-url="http://blogs.technet.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-86-08/0435.1.png" /></a></p>
<p>We can save the network trace in xml or csv format for further analysis.</p>
<p>Some other cool features are:</p>
<p>1) We can use&nbsp;logging API instead of alert()&nbsp;for debugging using console.log() method&nbsp;as shown below:</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/86/08/2744.1.png" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-86-08/2744.1.png"><img border="0" alt="" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/86/08/2744.1.png" original-url="http://blogs.technet.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-86-08/2744.1.png" /></a></p>
<p>2) We can debug client side javascript, add conditional breakpoints similar to Visual Studio breakpoints.</p>
<p>3) Profiler shows&nbsp;the amount of time scripts took to execute functions. This data can be viewed either in <strong>Function</strong> view or <strong>Call tree</strong> view.</p>
<p>There are lot more features apart from the ones covered here.</p>]]></content:encoded>
    </item>
    <item>
      <title>Look at Sharing Common Assemblies in ASP.NET 4.5</title>
      <link>https://docs.microsoft.com/archive/blogs/sateesh-arveti/look-at-sharing-common-assemblies-in-asp-net-4-5</link>
      <pubDate>Tue, 29 Nov 2011 15:30:00 GMT</pubDate>
      <dc:creator><![CDATA[sateesharveti]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/sateesh-arveti/2011/11/29/look-at-sharing-common-assemblies-in-asp-net-4-5/</guid>
      <description><![CDATA[In this blog, we will look into sharing common assemblies in ASP.NET 4.5 Developer Preview. This...]]></description>
      <content:encoded><![CDATA[<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/86/08/3730.a.png" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-86-08/3730.a.png"></a><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/86/08/2352.123.png" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-86-08/2352.123.png"></a>In this blog, we will look into sharing common assemblies in ASP.NET 4.5 Developer Preview. This feature needs VS 11 SDK &amp; .NET Framework 4.0 latest update. Normally, multiple sites use to have its own copy of same assemblies from a starter kit like AjaxToolkit in its Bin directory. These assemblies are identical in object code &amp; functionality but differ in physical path. Due to this, each assembly has to be read separately during cold startup of the site and kept separately in memory. This will lead to have multiple copies of same assembly consuming RAM and performance hit to load the assembly. &nbsp;The new interning feature will resolve it by keeping a single copy of that assembly in the file system, and individual assemblies in the site Bin folders are replaced with symbolic links to the single copy. If an individual site needs a distinct version of the assembly, the symbolic link is replaced by the new version of the assembly, and only that site is affected. VS 11 provide a new tool called as aspnet_intern.exe for sharing assemblies using symbolic links. This tool lets you create and manage the store of interned assemblies.</p>
<p>Let&rsquo;s have a look at it with a live example. Open your VS 11 and create a simple class library Testlib with the below code:</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/86/08/3730.a.png" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-86-08/3730.a.png"><img border="0" alt="" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/86/08/3730.a.png" original-url="http://blogs.technet.com/resized-image.ashx/__size/200x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-86-08/3730.a.png" /></a></p>
<p>Build it and then create three new web applications with name as MyApp1, MyApp2 &amp; MyApp3 with a reference to Testlib as shown below:</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/86/08/3124.123.png" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-86-08/3124.123.png"><img border="0" alt="" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/86/08/3124.123.png" original-url="http://blogs.technet.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-86-08/3124.123.png" /></a></p>
<p>Then, run each web application. Now, open command prompt and point to VS 11 SDK [similar to C:\Program Files (x86)\Microsoft SDKs\Windows\v8.0A\bin\NETFX 4.0 Tools] and run below command to intern the common assemblies present under ASP.NET Temporary Files folder to CommonAssemblies folder [in our case it&rsquo;s testlib]:</p>
<p>aspnet_intern -mode exec -sourcedir "C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files" -interndir C:\CommonAssemblies</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/86/08/2352.123.png" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-86-08/2352.123.png"><img border="0" alt="" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/86/08/2352.123.png" original-url="http://blogs.technet.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-86-08/2352.123.png" /></a></p>
<p>By doing this, we can have only one copy of the assembly in RAM for use by multiple sites. &nbsp;An assembly will be interned, if it was found in more than 3 different locations by default. We can change this value by using minrefcount switch.</p>
<p>We can get detail report [verbose] without interning the assemblies by running below command:</p>
<p>aspnet_intern -mode analyze -sourcedir C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files" -interndir C:\ASPNETCommonAssemblies &nbsp;-v</p>
<p>For more options on this tool, run aspnet_intern /?</p>
<p>We can make sure all eligible assemblies have been interned by running aspnet_intern.exe periodically using a scheduled task.</p>
<p>Note: This blog is based on features of preview only, and is subject to change in later releases.</p>]]></content:encoded>
    </item>
  </channel>
</rss>