<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>c# &#8211; martinklinke.com</title>
	<atom:link href="https://www.martinklinke.com/tag/c/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.martinklinke.com</link>
	<description>IT&#039;s my business</description>
	<lastBuildDate>Wed, 01 Jun 2016 22:14:29 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.0</generator>
	<item>
		<title>Interactive coding in Visual Studio with Alive</title>
		<link>https://www.martinklinke.com/2016/06/02/interactive-coding-in-visual-studio-with-alive/</link>
		
		<dc:creator><![CDATA[Martin Klinke]]></dc:creator>
		<pubDate>Wed, 01 Jun 2016 22:14:03 +0000</pubDate>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[interactive-coding]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[tools]]></category>
		<guid isPermaLink="false">http://www.martinklinke.com/?p=121</guid>

					<description><![CDATA[If you like NCrunch, you should take a look atÂ the Visual Studio pluginÂ Alive. I stumbled upon this tool while researching for my previous post about C# code generation. Just like NCrunch, it executes your code while you type. But instead of test outcomes, it focusses on the details of the code execution and provides invaluable [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>If you like <a href="http://www.ncrunch.net/">NCrunch</a>, you should take a look atÂ the Visual Studio pluginÂ <a href="https://comealive.io/">Alive</a>. I stumbled upon this tool while researching for my previous post about C# code generation.</p>
<p>Just like NCrunch, it executes your code while you type. But instead of test outcomes, it focusses on the details of the code execution and provides invaluable insight into the contents of variables and even the control flow as you type. You can even drag a slider to see differentÂ iterations in loops. All you need is a starting point like a static method, a test method or any method where the parent type can be instantiated with some generic defaults.</p>
<p>This short video (~6 minutes) gives a great first impression so far:</p>
<p><span id="more-121"></span></p>
<p><iframe title="Alive - Helps you catch bugs quickly." width="500" height="281" src="https://www.youtube.com/embed/C40Ozwohgm8?feature=oembed" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe></p>
<p>I might take a look at the free 30 day trial as soon as I am back in Visual Studio.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>How to generate C# code in 2016</title>
		<link>https://www.martinklinke.com/2016/06/01/how-to-generate-c-code-in-2016/</link>
		
		<dc:creator><![CDATA[Martin Klinke]]></dc:creator>
		<pubDate>Wed, 01 Jun 2016 21:15:21 +0000</pubDate>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[.net]]></category>
		<category><![CDATA[automation]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[tools]]></category>
		<guid isPermaLink="false">http://www.martinklinke.com/?p=117</guid>

					<description><![CDATA[Today I wanted to generate a bit of rather trivial C# code to provide a convenient facade to an internal library. After creating a T4 template, loadingÂ the required assembly and adding some namespace imports,Â I found it rather inefficientÂ to write code in that simple text editor without IntelliSense. So of course, there is always the option [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>Today I wanted to generate a bit of rather trivial C# code to provide a convenient facade to an internal library. After creating a <a href="https://msdn.microsoft.com/en-us/library/bb126445.aspx">T4 template</a>, loadingÂ the required assembly and adding some namespace imports,Â I found it rather inefficientÂ to write code in that simple text editor without IntelliSense. So of course, there is always the option to write a code generator class with a method that returns a string. The T4 template can instantiate that class, call the method and emit the value directly:</p>
<blockquote><p>&lt;#= new CodeGenerator().Generate() #&gt;</p></blockquote>
<p>Next comes the question of how to implement the generator. StringBuilder? Come on, there must be a better way. I checked in another library that I knew was using code generation. Then IÂ sawÂ thatÂ the library was usingÂ <a href="https://msdn.microsoft.com/en-us/library/y2k85ax6(v=vs.110).aspx">CodeDOM</a>. For my simple needs, I decided that this would be sufficient for the time being (and efficient, since I didn&#8217;t want to spend too much time there).</p>
<p>But then I started toÂ wonder. WillÂ CodeDOMÂ still work with the newÂ <a href="https://dotnet.github.io/">.NET Core</a>?</p>
<p><span id="more-117"></span></p>
<p>The answer was <a href="http://stackoverflow.com/questions/7852926/microsoft-roslyn-vs-codedom">no</a>.</p>
<p>The linked StackOverflow question already includes the &#8220;replacement&#8221; of CodeDOM (CodeDOM is referred to as someÂ precursor to part of what Roslyn does): The &#8220;new&#8221; <a href="https://github.com/dotnet/roslyn">Roslyn compiler platform</a> (which has been around for a while by now). More specifically, the <a href="https://johnkoerner.com/csharp/creating-code-using-the-syntax-factory/">SyntaxFactory</a>Â that comes with Roslyn.</p>
<p>The only draw-back I see immediately: The code that uses the SyntaxFactoryÂ seemsÂ a lot more verbose than the CodeDOM API. On the plus side, theÂ Roslyn way should beÂ superior toÂ CodeDOM regarding features and support for language constructs.</p>
<p>There are already articlesÂ available for <a href="https://dogschasingsquirrels.com/2014/07/16/generating-code-with-roslyn/">generating code with Roslyn</a>, so I will leave the details to the interested reader.</p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
