<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns: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/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>Michael Sync</title>
	
	<link>http://michaelsync.net</link>
	<description>Sharing knowledge</description>
	<lastBuildDate>Wed, 05 Jun 2013 07:40:36 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/MichaelSync" /><feedburner:info uri="michaelsync" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.superfeedr.com/" /><feedburner:emailServiceId>MichaelSync</feedburner:emailServiceId><feedburner:feedburnerHostname>http://feedburner.google.com</feedburner:feedburnerHostname><item>
		<title>(Unsolved) FxCop + Portable Library</title>
		<link>http://feedproxy.google.com/~r/MichaelSync/~3/nTc-2urW-Ig/unsolved-fxcop-portable-library</link>
		<comments>http://michaelsync.net/2013/05/28/unsolved-fxcop-portable-library#comments</comments>
		<pubDate>Tue, 28 May 2013 09:56:40 +0000</pubDate>
		<dc:creator>Michael Sync</dc:creator>
				<category><![CDATA[FxCop/Code Analysis]]></category>

		<guid isPermaLink="false">http://michaelsync.net/?p=2358</guid>
		<description><![CDATA[No. It&#8217;s not the problem and solution post. This post is about the issue that we are not able to solve until now. We integrated the standalone version of FxCop with our custom ruleset to make sure all of our projects are following our guideline on our CI (Continuous Integration) server.We have a .NET 4.5 ...<a class="post-readmore" href="http://michaelsync.net/2013/05/28/unsolved-fxcop-portable-library">read more</a>]]></description>
				<content:encoded><![CDATA[<p>No. It&#8217;s not the problem and solution post. This post is about the issue that we are not able to solve until now. We integrated the standalone version of FxCop with our custom ruleset to make sure all of our projects are following our guideline on our CI (Continuous Integration) server.We have a .NET 4.5 project that is using an open source dependency injection framework called Autofac that has the dependency on the <a href="http://msdn.microsoft.com/en-us/library/vstudio/gg597391(v=vs.100).aspx">Portable Class library</a>. When we run FxCop for that project, we got the error below.</p>
<p><a href="http://michaelsync.net/wp-content/uploads/2013/05/FxCop-Portal-Library.png"><img class="alignnone size-full wp-image-2360" alt="FxCop Portal Library" src="http://michaelsync.net/wp-content/uploads/2013/05/FxCop-Portal-Library.png" width="507" height="119" /></a></p>
<p><strong>Error Message</strong></p>
<p>Microsoft.FxCop.Sdk.FxCopException: The indirectly-referenced Silverlight assembly &#8216;System.Core, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e, Retargetable=Yes&#8217; could not be found. This assembly is not required for analysis, however, analysis results could be incomplete. Silverlight reference assemblies should be specified with the &#8216;/reference&#8217; switch. This assembly was referenced by: {0}\bin\Autofac.dll.</p>
<p>I am still not able to find the solution yet but what I found is that a lot of people are having the same problem and asking for new version of FxCop for .NET 4.5.</p>
<p>Please vote this &#8220;<a href="http://visualstudio.uservoice.com/forums/121579-visual-studio/suggestions/3243367-update-standalone-fxcop-to-support-net-4-5-and-po">Update standalone FxCop to support .NET 4.5 and Portable Libraries</a>&#8221; if you are also looking for Fxcop for .NET 4.5.</p>
<p>Or, If you know the solution or workaround, please share with us. Thanks!
<div class='kouguu_fb_like_button'><iframe src="http://www.facebook.com/plugins/like.php?href=http://michaelsync.net/2013/05/28/unsolved-fxcop-portable-library&#038;layout=standard&#038;show_faces=false&#038;width=450&#038;height=25&#038;action=like&#038;colorscheme=light&#038;" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:450px; height:25px;"></iframe></div>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/MichaelSync?a=nTc-2urW-Ig:f9MMzBzJZmI:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/MichaelSync?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/MichaelSync?a=nTc-2urW-Ig:f9MMzBzJZmI:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/MichaelSync?i=nTc-2urW-Ig:f9MMzBzJZmI:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/MichaelSync?a=nTc-2urW-Ig:f9MMzBzJZmI:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/MichaelSync?i=nTc-2urW-Ig:f9MMzBzJZmI:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/MichaelSync?a=nTc-2urW-Ig:f9MMzBzJZmI:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/MichaelSync?i=nTc-2urW-Ig:f9MMzBzJZmI:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/MichaelSync?a=nTc-2urW-Ig:f9MMzBzJZmI:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/MichaelSync?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/MichaelSync?a=nTc-2urW-Ig:f9MMzBzJZmI:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/MichaelSync?d=dnMXMwOfBR0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/MichaelSync?a=nTc-2urW-Ig:f9MMzBzJZmI:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/MichaelSync?i=nTc-2urW-Ig:f9MMzBzJZmI:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/MichaelSync?a=nTc-2urW-Ig:f9MMzBzJZmI:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/MichaelSync?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/MichaelSync?a=nTc-2urW-Ig:f9MMzBzJZmI:KwTdNBX3Jqk"><img src="http://feeds.feedburner.com/~ff/MichaelSync?i=nTc-2urW-Ig:f9MMzBzJZmI:KwTdNBX3Jqk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/MichaelSync?a=nTc-2urW-Ig:f9MMzBzJZmI:l6gmwiTKsz0"><img src="http://feeds.feedburner.com/~ff/MichaelSync?d=l6gmwiTKsz0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/MichaelSync?a=nTc-2urW-Ig:f9MMzBzJZmI:TzevzKxY174"><img src="http://feeds.feedburner.com/~ff/MichaelSync?d=TzevzKxY174" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/MichaelSync/~4/nTc-2urW-Ig" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://michaelsync.net/2013/05/28/unsolved-fxcop-portable-library/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://michaelsync.net/2013/05/28/unsolved-fxcop-portable-library</feedburner:origLink></item>
		<item>
		<title>Windows Phone 8: PhoneGap Porting Challenge</title>
		<link>http://feedproxy.google.com/~r/MichaelSync/~3/RewhvOc_dC4/windows-phone-8-phonegap-porting-challenge</link>
		<comments>http://michaelsync.net/2013/05/26/windows-phone-8-phonegap-porting-challenge#comments</comments>
		<pubDate>Sun, 26 May 2013 12:16:46 +0000</pubDate>
		<dc:creator>Michael Sync</dc:creator>
				<category><![CDATA[Windows Phone]]></category>

		<guid isPermaLink="false">http://michaelsync.net/?p=2349</guid>
		<description><![CDATA[Take your existing PhoneGap (Apache Cordova) application published in any store and port it to Windows Phone 8. Prize 17 first prize winners will each receive a Windows Phone 8. 3 grand prize winners will each receive a Surface Pro and Windows Phone 8. 20 winners will be announced Friday, July 19th at the PhoneGap ...<a class="post-readmore" href="http://michaelsync.net/2013/05/26/windows-phone-8-phonegap-porting-challenge">read more</a>]]></description>
				<content:encoded><![CDATA[<p>Take your existing PhoneGap (Apache Cordova) application published in any store and port it to Windows Phone 8.</p>
<p><a href="http://www.phonegapwpchallenge.com/"><img class="alignnone size-full wp-image-2351" alt="Windows Phone 8" src="http://michaelsync.net/wp-content/uploads/2013/05/Windows-Phone-8.png" width="673" height="381" /></a></p>
<h2>Prize</h2>
<ul>
<li>17 first prize winners will each receive a Windows Phone 8.</li>
<li>3 grand prize winners will each receive a Surface Pro and Windows Phone 8.</li>
<li>20 winners will be announced Friday, July 19th at the PhoneGap Day event in Portland, Oregon.</li>
</ul>
<h2>How to participate?</h2>
<ul>
<li>Register with your Microsoft account and tell us about your app.</li>
<li>Port your app and test it in the Windows Phone Emulator.</li>
<li>Publish to the Windows Phone Store by June, 30th 2013.</li>
</ul>
<p>You can read more about this contest @ <a href="http://www.phonegapwpchallenge.com/">http://www.phonegapwpchallenge.com</a>
<div class='kouguu_fb_like_button'><iframe src="http://www.facebook.com/plugins/like.php?href=http://michaelsync.net/2013/05/26/windows-phone-8-phonegap-porting-challenge&#038;layout=standard&#038;show_faces=false&#038;width=450&#038;height=25&#038;action=like&#038;colorscheme=light&#038;" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:450px; height:25px;"></iframe></div>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/MichaelSync?a=RewhvOc_dC4:Sf1HQjWlV3E:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/MichaelSync?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/MichaelSync?a=RewhvOc_dC4:Sf1HQjWlV3E:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/MichaelSync?i=RewhvOc_dC4:Sf1HQjWlV3E:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/MichaelSync?a=RewhvOc_dC4:Sf1HQjWlV3E:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/MichaelSync?i=RewhvOc_dC4:Sf1HQjWlV3E:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/MichaelSync?a=RewhvOc_dC4:Sf1HQjWlV3E:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/MichaelSync?i=RewhvOc_dC4:Sf1HQjWlV3E:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/MichaelSync?a=RewhvOc_dC4:Sf1HQjWlV3E:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/MichaelSync?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/MichaelSync?a=RewhvOc_dC4:Sf1HQjWlV3E:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/MichaelSync?d=dnMXMwOfBR0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/MichaelSync?a=RewhvOc_dC4:Sf1HQjWlV3E:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/MichaelSync?i=RewhvOc_dC4:Sf1HQjWlV3E:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/MichaelSync?a=RewhvOc_dC4:Sf1HQjWlV3E:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/MichaelSync?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/MichaelSync?a=RewhvOc_dC4:Sf1HQjWlV3E:KwTdNBX3Jqk"><img src="http://feeds.feedburner.com/~ff/MichaelSync?i=RewhvOc_dC4:Sf1HQjWlV3E:KwTdNBX3Jqk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/MichaelSync?a=RewhvOc_dC4:Sf1HQjWlV3E:l6gmwiTKsz0"><img src="http://feeds.feedburner.com/~ff/MichaelSync?d=l6gmwiTKsz0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/MichaelSync?a=RewhvOc_dC4:Sf1HQjWlV3E:TzevzKxY174"><img src="http://feeds.feedburner.com/~ff/MichaelSync?d=TzevzKxY174" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/MichaelSync/~4/RewhvOc_dC4" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://michaelsync.net/2013/05/26/windows-phone-8-phonegap-porting-challenge/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://michaelsync.net/2013/05/26/windows-phone-8-phonegap-porting-challenge</feedburner:origLink></item>
		<item>
		<title>.NET 4.5 –  Visual Studio Web Designer API bug</title>
		<link>http://feedproxy.google.com/~r/MichaelSync/~3/cqvfjq7sdiE/net-4-5-visual-studio-web-designer-api-bug</link>
		<comments>http://michaelsync.net/2013/05/25/net-4-5-visual-studio-web-designer-api-bug#comments</comments>
		<pubDate>Sat, 25 May 2013 18:35:53 +0000</pubDate>
		<dc:creator>Michael Sync</dc:creator>
				<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[ASP.NET Web API]]></category>
		<category><![CDATA[Tips and Tricks]]></category>

		<guid isPermaLink="false">http://michaelsync.net/?p=2343</guid>
		<description><![CDATA[Recently, we developed one REST service using ASP.NET Web API. We have used a lot of  async/await in that projects. Before we deploy this project on our staging web server that has a few ASP.NET 4.0 websites, we installed .NET 4.5 on one of our local server and requested QA team to test all of ...<a class="post-readmore" href="http://michaelsync.net/2013/05/25/net-4-5-visual-studio-web-designer-api-bug">read more</a>]]></description>
				<content:encoded><![CDATA[<p>Recently, we developed one REST service using ASP.NET Web API. We have used a lot of  async/await in that projects. Before we deploy this project on our staging web server that has a few ASP.NET 4.0 websites, we installed .NET 4.5 on one of our local server and requested QA team to test all of our existing ASP.NET 4.0 websites. I know that it&#8217;s the extra effort for our QA team but we got no choice since .NET 4.5 can&#8217;t be installed side by side with .NET 4.0. Luckily, QA reported only one issue that I am going to share in this post.</p>
<p>The error message that we got is as below.</p>
<p>Error Message: <strong>The &#8216;VirtualItemCount&#8217; property cannot be set declaratively.</strong></p>
<p><a href="http://michaelsync.net/wp-content/uploads/2013/05/NET-4.5-error.png"><img class="alignnone size-full wp-image-2345" alt=".NET 4.5 error" src="http://michaelsync.net/wp-content/uploads/2013/05/NET-4.5-error.png" width="993" height="336" /></a></p>
<p>There is a custom control that we are using in our exisitng ASP.NET 4.0 project. There is the code that set VirtualItemCount in aspx but it stopped working after installing .NET 4.5 on the server.</p>
<p>Unfortunately, it turns out that it&#8217;s a known issue that has been reported in MS Connect. You can read about this bug report <a href="http://connect.microsoft.com/VisualStudio/feedback/details/766590/net-4-5-framework-install-issue-with-vs2010-web-config-app-pools">here</a>. Microsoft didn&#8217;t mention about fixing this bug so far but there is a workaround that you can use before Microsoft release the fixes.</p>
<h2>Workaround</h2>
<p>In the meantime, you can apply an easy workaround which is to set the custom control&#8217;s property value in code behind and remove the affected property from the mark up.
<div class='kouguu_fb_like_button'><iframe src="http://www.facebook.com/plugins/like.php?href=http://michaelsync.net/2013/05/25/net-4-5-visual-studio-web-designer-api-bug&#038;layout=standard&#038;show_faces=false&#038;width=450&#038;height=25&#038;action=like&#038;colorscheme=light&#038;" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:450px; height:25px;"></iframe></div>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/MichaelSync?a=cqvfjq7sdiE:EksEgrrBSi4:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/MichaelSync?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/MichaelSync?a=cqvfjq7sdiE:EksEgrrBSi4:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/MichaelSync?i=cqvfjq7sdiE:EksEgrrBSi4:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/MichaelSync?a=cqvfjq7sdiE:EksEgrrBSi4:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/MichaelSync?i=cqvfjq7sdiE:EksEgrrBSi4:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/MichaelSync?a=cqvfjq7sdiE:EksEgrrBSi4:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/MichaelSync?i=cqvfjq7sdiE:EksEgrrBSi4:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/MichaelSync?a=cqvfjq7sdiE:EksEgrrBSi4:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/MichaelSync?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/MichaelSync?a=cqvfjq7sdiE:EksEgrrBSi4:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/MichaelSync?d=dnMXMwOfBR0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/MichaelSync?a=cqvfjq7sdiE:EksEgrrBSi4:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/MichaelSync?i=cqvfjq7sdiE:EksEgrrBSi4:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/MichaelSync?a=cqvfjq7sdiE:EksEgrrBSi4:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/MichaelSync?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/MichaelSync?a=cqvfjq7sdiE:EksEgrrBSi4:KwTdNBX3Jqk"><img src="http://feeds.feedburner.com/~ff/MichaelSync?i=cqvfjq7sdiE:EksEgrrBSi4:KwTdNBX3Jqk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/MichaelSync?a=cqvfjq7sdiE:EksEgrrBSi4:l6gmwiTKsz0"><img src="http://feeds.feedburner.com/~ff/MichaelSync?d=l6gmwiTKsz0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/MichaelSync?a=cqvfjq7sdiE:EksEgrrBSi4:TzevzKxY174"><img src="http://feeds.feedburner.com/~ff/MichaelSync?d=TzevzKxY174" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/MichaelSync/~4/cqvfjq7sdiE" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://michaelsync.net/2013/05/25/net-4-5-visual-studio-web-designer-api-bug/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://michaelsync.net/2013/05/25/net-4-5-visual-studio-web-designer-api-bug</feedburner:origLink></item>
		<item>
		<title>Tip: FxCop issue with System.Net.Http</title>
		<link>http://feedproxy.google.com/~r/MichaelSync/~3/JtK8usaZLyg/tip-fxcop-issue-with-system-net-http</link>
		<comments>http://michaelsync.net/2013/05/25/tip-fxcop-issue-with-system-net-http#comments</comments>
		<pubDate>Sat, 25 May 2013 17:01:12 +0000</pubDate>
		<dc:creator>Michael Sync</dc:creator>
				<category><![CDATA[FxCop/Code Analysis]]></category>

		<guid isPermaLink="false">http://michaelsync.net/?p=2322</guid>
		<description><![CDATA[Error Message: CA0058 Error Running Code Analysis CA0058 : The referenced assembly &#8216;System.Net.Http, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a&#8217; could not be found. This assembly is required for analysis and was referenced by: {Your-Project-Path}\packages\Microsoft.AspNet.WebApi.Core.4.0.20710.0\lib\net40\System.Web.Http.dll. [Errors and Warnings] &#8211; (Global) Solution Go to &#8220;%ProgramFiles(x86)%\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop&#8221; or &#8220;%ProgramFiles(x86)%\Microsoft Visual Studio 11.0\Team Tools\Static Analysis Tools\FxCop&#8221; if ...<a class="post-readmore" href="http://michaelsync.net/2013/05/25/tip-fxcop-issue-with-system-net-http">read more</a>]]></description>
				<content:encoded><![CDATA[<p><strong>Error Message:</strong></p>
<p>CA0058 Error Running Code Analysis CA0058 : The referenced assembly &#8216;System.Net.Http, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a&#8217; could not be found. This assembly is required for analysis and was referenced by: {Your-Project-Path}\packages\Microsoft.AspNet.WebApi.Core.4.0.20710.0\lib\net40\System.Web.Http.dll. [Errors and Warnings] &#8211; (Global)</p>
<p><a href="http://michaelsync.net/wp-content/uploads/2013/05/FxCop-Issue.png"><img class="alignnone size-full wp-image-2324" alt="FxCop Issue" src="http://michaelsync.net/wp-content/uploads/2013/05/FxCop-Issue.png" width="322" height="277" /></a></p>
<p><strong>Solution</strong></p>
<ol>
<li>Go to &#8220;%ProgramFiles(x86)%\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop&#8221; or &#8220;%ProgramFiles(x86)%\Microsoft Visual Studio 11.0\Team Tools\Static Analysis Tools\FxCop&#8221; if you have VS 2012.</li>
<li>Open FxCopCmd.exe.config and change AssemblyReferenceResolveMode from StrongName to StrongNameIgnoringVersion</li>
<li>Save the change and rebuild your project</li>
</ol>
<p><strong>Credit: </strong></p>
<p>Thanks to this post. <a title="http://goo.gl/bnFMg" href="http://goo.gl/bnFMg">http://goo.gl/bnFMg</a>
<div class='kouguu_fb_like_button'><iframe src="http://www.facebook.com/plugins/like.php?href=http://michaelsync.net/2013/05/25/tip-fxcop-issue-with-system-net-http&#038;layout=standard&#038;show_faces=false&#038;width=450&#038;height=25&#038;action=like&#038;colorscheme=light&#038;" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:450px; height:25px;"></iframe></div>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/MichaelSync?a=JtK8usaZLyg:ArI9BW0GL9Q:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/MichaelSync?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/MichaelSync?a=JtK8usaZLyg:ArI9BW0GL9Q:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/MichaelSync?i=JtK8usaZLyg:ArI9BW0GL9Q:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/MichaelSync?a=JtK8usaZLyg:ArI9BW0GL9Q:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/MichaelSync?i=JtK8usaZLyg:ArI9BW0GL9Q:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/MichaelSync?a=JtK8usaZLyg:ArI9BW0GL9Q:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/MichaelSync?i=JtK8usaZLyg:ArI9BW0GL9Q:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/MichaelSync?a=JtK8usaZLyg:ArI9BW0GL9Q:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/MichaelSync?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/MichaelSync?a=JtK8usaZLyg:ArI9BW0GL9Q:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/MichaelSync?d=dnMXMwOfBR0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/MichaelSync?a=JtK8usaZLyg:ArI9BW0GL9Q:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/MichaelSync?i=JtK8usaZLyg:ArI9BW0GL9Q:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/MichaelSync?a=JtK8usaZLyg:ArI9BW0GL9Q:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/MichaelSync?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/MichaelSync?a=JtK8usaZLyg:ArI9BW0GL9Q:KwTdNBX3Jqk"><img src="http://feeds.feedburner.com/~ff/MichaelSync?i=JtK8usaZLyg:ArI9BW0GL9Q:KwTdNBX3Jqk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/MichaelSync?a=JtK8usaZLyg:ArI9BW0GL9Q:l6gmwiTKsz0"><img src="http://feeds.feedburner.com/~ff/MichaelSync?d=l6gmwiTKsz0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/MichaelSync?a=JtK8usaZLyg:ArI9BW0GL9Q:TzevzKxY174"><img src="http://feeds.feedburner.com/~ff/MichaelSync?d=TzevzKxY174" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/MichaelSync/~4/JtK8usaZLyg" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://michaelsync.net/2013/05/25/tip-fxcop-issue-with-system-net-http/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://michaelsync.net/2013/05/25/tip-fxcop-issue-with-system-net-http</feedburner:origLink></item>
		<item>
		<title>Tip: EF Command Error</title>
		<link>http://feedproxy.google.com/~r/MichaelSync/~3/1wwjApwD5To/tip-ef-command-error</link>
		<comments>http://michaelsync.net/2013/05/25/tip-ef-command-error#comments</comments>
		<pubDate>Sat, 25 May 2013 17:00:46 +0000</pubDate>
		<dc:creator>Michael Sync</dc:creator>
				<category><![CDATA[Entity Framework]]></category>

		<guid isPermaLink="false">http://michaelsync.net/?p=2317</guid>
		<description><![CDATA[If you are using Entity framework in Visual Studio, you might notice that EF&#8217;s cmdlet are not working in nuget console sometimes. It&#8217;s because EF module is not loaded in nuget console for some reasons. Error Message The term &#8216;update-database&#8217; is not recognized as the name of a cmdlet, function, script file, or operable program. ...<a class="post-readmore" href="http://michaelsync.net/2013/05/25/tip-ef-command-error">read more</a>]]></description>
				<content:encoded><![CDATA[<p>If you are using Entity framework in Visual Studio, you might notice that EF&#8217;s cmdlet are not working in nuget console sometimes. It&#8217;s because EF module is not loaded in nuget console for some reasons.</p>
<p><strong>Error Message</strong></p>
<p>The term &#8216;update-database&#8217; is not recognized as the name of a cmdlet, function, script file, or operable program. Che<br />
ck the spelling of the name, or if a path was included, verify that the path is correct and try again.<br />
At line:1 char:16<br />
+ update-database &lt;&lt;&lt;&lt; -script<br />
+ CategoryInfo : ObjectNotFound: (update-database:String) [], CommandNotFoundException<br />
+ FullyQualifiedErrorId : CommandNotFoundException</p>
<p><a href="http://michaelsync.net/wp-content/uploads/2013/05/image001.png"><img class="alignnone size-full wp-image-2319" alt="image001" src="http://michaelsync.net/wp-content/uploads/2013/05/image001.png" width="879" height="249" /></a></p>
<p><strong>Solution</strong></p>
<p>You can use the following command to import the EF module.</p>
<pre class="brush: powershell; title: ; notranslate">

Import-Module C:\Work\branches\v1\src\packages\EntityFramework.5.0.0\tools\EntityFramework.psd1

</pre>
<div class='kouguu_fb_like_button'><iframe src="http://www.facebook.com/plugins/like.php?href=http://michaelsync.net/2013/05/25/tip-ef-command-error&#038;layout=standard&#038;show_faces=false&#038;width=450&#038;height=25&#038;action=like&#038;colorscheme=light&#038;" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:450px; height:25px;"></iframe></div>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/MichaelSync?a=1wwjApwD5To:oXlEusSVPyA:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/MichaelSync?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/MichaelSync?a=1wwjApwD5To:oXlEusSVPyA:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/MichaelSync?i=1wwjApwD5To:oXlEusSVPyA:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/MichaelSync?a=1wwjApwD5To:oXlEusSVPyA:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/MichaelSync?i=1wwjApwD5To:oXlEusSVPyA:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/MichaelSync?a=1wwjApwD5To:oXlEusSVPyA:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/MichaelSync?i=1wwjApwD5To:oXlEusSVPyA:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/MichaelSync?a=1wwjApwD5To:oXlEusSVPyA:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/MichaelSync?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/MichaelSync?a=1wwjApwD5To:oXlEusSVPyA:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/MichaelSync?d=dnMXMwOfBR0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/MichaelSync?a=1wwjApwD5To:oXlEusSVPyA:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/MichaelSync?i=1wwjApwD5To:oXlEusSVPyA:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/MichaelSync?a=1wwjApwD5To:oXlEusSVPyA:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/MichaelSync?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/MichaelSync?a=1wwjApwD5To:oXlEusSVPyA:KwTdNBX3Jqk"><img src="http://feeds.feedburner.com/~ff/MichaelSync?i=1wwjApwD5To:oXlEusSVPyA:KwTdNBX3Jqk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/MichaelSync?a=1wwjApwD5To:oXlEusSVPyA:l6gmwiTKsz0"><img src="http://feeds.feedburner.com/~ff/MichaelSync?d=l6gmwiTKsz0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/MichaelSync?a=1wwjApwD5To:oXlEusSVPyA:TzevzKxY174"><img src="http://feeds.feedburner.com/~ff/MichaelSync?d=TzevzKxY174" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/MichaelSync/~4/1wwjApwD5To" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://michaelsync.net/2013/05/25/tip-ef-command-error/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://michaelsync.net/2013/05/25/tip-ef-command-error</feedburner:origLink></item>
		<item>
		<title>Tip: EF CodeFirst – Deleting child records</title>
		<link>http://feedproxy.google.com/~r/MichaelSync/~3/kstPTLro58k/tip-ef-codefirst-deleting-child-records</link>
		<comments>http://michaelsync.net/2012/06/26/tip-ef-codefirst-deleting-child-records#comments</comments>
		<pubDate>Wed, 27 Jun 2012 06:53:10 +0000</pubDate>
		<dc:creator>Michael Sync</dc:creator>
				<category><![CDATA[Entity Framework]]></category>

		<guid isPermaLink="false">http://michaelsync.net/?p=2288</guid>
		<description><![CDATA[Error Message The operation failed: The relationship could not be changed because one or more of the foreign-key properties is non-nullable. When a change is made to a relationship, the related foreign-key property is set to a null value. If the foreign-key does not support null values, a new relationship must be defined, the foreign-key ...<a class="post-readmore" href="http://michaelsync.net/2012/06/26/tip-ef-codefirst-deleting-child-records">read more</a>]]></description>
				<content:encoded><![CDATA[<p><img class="alignnone size-full wp-image-2306" title="Microsoft Entity Framework" src="http://michaelsync.net/wp-content/uploads/2012/06/Microsoft-Entity-Framework.png" alt="" width="490" height="93" /></p>
<p><strong>Error Message</strong></p>
<p>The operation failed: The relationship could not be changed because one or more of the foreign-key properties is non-nullable. When a change is made to a relationship, the related foreign-key property is set to a null value. If the foreign-key does not support null values, a new relationship must be defined, the foreign-key property must be assigned another non-null value, or the unrelated object must be deleted.</p>
<p><strong>Solution</strong></p>
<p>Have you ever encountered problems in deleting the child records? One team member from my team got that problem a couple of months back.. The only solution that I found is that you need to change the state of child object to &#8220;Deleted&#8221; instead of using &#8220;Remove()&#8221; function. The code below is to show you how to delete the child records. Please focus on &#8220;DeleteAllChildren()&#8221;. Please let me know if you have a better solution for this issue. Thanks!</p>
<pre class="brush: csharp; title: ; notranslate">
public class TestDbContext : DbContext
{
public DbSet Parent { get; set; }
}

public class Parent
{
public int Id { get; set; }
public string Name { get; set; }
public virtual ICollection Children { get; set; }
}

public class Child
{
public int Id { get; set; }
public int ParentId { get; set; }
public string Name { get; set; }
}

private static void DeleteAllChildren()
{
var context = new TestDbContext();

var existingRecord = context.Parent.Include(c =&gt; c.Children).First();

for (var i = existingRecord.Children.Count - 1; i &gt;= 0;i-- )
{
var child = existingRecord.Children.ElementAt(i);
var dbEntity = context.Entry(child);
dbEntity.State = System.Data.EntityState.Deleted;
}

context.SaveChanges();

Console.WriteLine(&quot;Done&quot;);
Console.ReadLine();
}

private static void Create()
{
var parent = new Parent()
{
Name = &quot;M&quot;,
Children = new Collection{
new Child (){ Name =&quot;A&quot;},
new Child (){ Name =&quot;B&quot;}
}
};

var context = new TestDbContext();
context.Parent.Add(parent);

context.SaveChanges();
}
var context = new TestDbContext();
var first = context.Parent.First();
context.Parent.Remove(first);
context.SaveChanges();

</pre>
<div class='kouguu_fb_like_button'><iframe src="http://www.facebook.com/plugins/like.php?href=http://michaelsync.net/2012/06/26/tip-ef-codefirst-deleting-child-records&#038;layout=standard&#038;show_faces=false&#038;width=450&#038;height=25&#038;action=like&#038;colorscheme=light&#038;" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:450px; height:25px;"></iframe></div>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/MichaelSync?a=kstPTLro58k:_20VGxJNFcQ:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/MichaelSync?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/MichaelSync?a=kstPTLro58k:_20VGxJNFcQ:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/MichaelSync?i=kstPTLro58k:_20VGxJNFcQ:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/MichaelSync?a=kstPTLro58k:_20VGxJNFcQ:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/MichaelSync?i=kstPTLro58k:_20VGxJNFcQ:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/MichaelSync?a=kstPTLro58k:_20VGxJNFcQ:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/MichaelSync?i=kstPTLro58k:_20VGxJNFcQ:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/MichaelSync?a=kstPTLro58k:_20VGxJNFcQ:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/MichaelSync?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/MichaelSync?a=kstPTLro58k:_20VGxJNFcQ:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/MichaelSync?d=dnMXMwOfBR0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/MichaelSync?a=kstPTLro58k:_20VGxJNFcQ:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/MichaelSync?i=kstPTLro58k:_20VGxJNFcQ:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/MichaelSync?a=kstPTLro58k:_20VGxJNFcQ:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/MichaelSync?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/MichaelSync?a=kstPTLro58k:_20VGxJNFcQ:KwTdNBX3Jqk"><img src="http://feeds.feedburner.com/~ff/MichaelSync?i=kstPTLro58k:_20VGxJNFcQ:KwTdNBX3Jqk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/MichaelSync?a=kstPTLro58k:_20VGxJNFcQ:l6gmwiTKsz0"><img src="http://feeds.feedburner.com/~ff/MichaelSync?d=l6gmwiTKsz0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/MichaelSync?a=kstPTLro58k:_20VGxJNFcQ:TzevzKxY174"><img src="http://feeds.feedburner.com/~ff/MichaelSync?d=TzevzKxY174" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/MichaelSync/~4/kstPTLro58k" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://michaelsync.net/2012/06/26/tip-ef-codefirst-deleting-child-records/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		<feedburner:origLink>http://michaelsync.net/2012/06/26/tip-ef-codefirst-deleting-child-records</feedburner:origLink></item>
		<item>
		<title>MvcMailer</title>
		<link>http://feedproxy.google.com/~r/MichaelSync/~3/lAbKC3QW6as/mvcmailer</link>
		<comments>http://michaelsync.net/2012/06/26/mvcmailer#comments</comments>
		<pubDate>Wed, 27 Jun 2012 06:24:12 +0000</pubDate>
		<dc:creator>Michael Sync</dc:creator>
				<category><![CDATA[ASP.NET MVC]]></category>

		<guid isPermaLink="false">http://michaelsync.net/?p=2292</guid>
		<description><![CDATA[Problem A lot of people recommended that MvcMailer is a great package for those who want to send email from ASP.NET MVC app but seems like the author of that package really didn&#8217;t get time to update the dependencies of his package. Here is what you will see when you try installing MvcMailer in VS ...<a class="post-readmore" href="http://michaelsync.net/2012/06/26/mvcmailer">read more</a>]]></description>
				<content:encoded><![CDATA[<h1>Problem</h1>
<h1><a href="http://michaelsync.net/wp-content/uploads/2012/06/MvcMailer.1.1.png"><img title="MvcMailer.1.1" src="http://michaelsync.net/wp-content/uploads/2012/06/MvcMailer.1.1.png" alt="" width="64" height="64" /></a></h1>
<p>A lot of people recommended that <a href=" http://nuget.org/packages/MvcMailer">MvcMailer</a> is a great package for those who want to send email from ASP.NET MVC app but seems like the author of that package really didn&#8217;t get time to update the dependencies of his package.</p>
<p>Here is what you will see when you try installing MvcMailer in VS 2010.</p>
<blockquote><p>PM&gt; Install-Package mvcmailer<br />
Attempting to resolve dependency &#8216;T4Scaffolding (≥ 0.9.7)&#8217;.<br />
Attempting to resolve dependency &#8216;EntityFramework (≥ 4.1.10311.0)&#8217;.<br />
You are downloading EntityFramework from Microsoft, the license agreement to which is available at http://go.microsoft.com/fwlink/?LinkId=224682. Check the package for additional dependencies, which may come with their own license agreement(s). Your use of the package and dependencies constitutes your acceptance of their license agreements. If you do not accept the license agreement(s), then delete the relevant components from your device.<br />
Successfully installed &#8216;EntityFramework 4.1.10715.0&#8242;.<br />
Successfully installed &#8216;T4Scaffolding 0.9.9&#8242;.<br />
Successfully installed &#8216;MvcMailer 1.1&#8242;.<br />
Successfully removed &#8216;EntityFramework 4.1.10331.0&#8242; from MvcApplication3.<br />
Successfully added &#8216;EntityFramework 4.1.10715.0&#8242; to MvcApplication3.<br />
Successfully added &#8216;T4Scaffolding 0.9.9&#8242; to MvcApplication3.<br />
<strong>Set-DefaultScaffolder : Unable to cast object of type &#8216;NuGet.SemanticVersion&#8217; to type &#8216;System.Version&#8217;.</strong><br />
<strong>At C:\users\michael.sync\documents\visual studio 2010\Projects\MvcApplication3\packages\T4Scaffolding.0.9.9\tools\install.ps1:22 char:22</strong><br />
<strong>+ Set-DefaultScaffolder &lt;&lt;&lt;&lt; -Name DbContext -Scaffolder T4Scaffolding.EFDbContext -SolutionWide -DoNotOverwriteExistingSetting</strong><br />
<strong> + CategoryInfo : NotSpecified: (:) [Set-DefaultScaffolder], InvalidCastException</strong><br />
<strong> + FullyQualifiedErrorId : T4Scaffolding.Cmdlets.SetDefaultScaffolderCmdlet</strong></p>
<p><strong>Set-DefaultScaffolder : Unable to cast object of type &#8216;NuGet.SemanticVersion&#8217; to type &#8216;System.Version&#8217;.</strong><br />
<strong>At C:\users\michael.sync\documents\visual studio 2010\Projects\MvcApplication3\packages\T4Scaffolding.0.9.9\tools\install.ps1:23 char:22</strong><br />
<strong>+ Set-DefaultScaffolder &lt;&lt;&lt;&lt; -Name Repository -Scaffolder T4Scaffolding.EFRepository -SolutionWide -DoNotOverwriteExistingSetting</strong><br />
<strong> + CategoryInfo : NotSpecified: (:) [Set-DefaultScaffolder], InvalidCastException</strong><br />
<strong> + FullyQualifiedErrorId : T4Scaffolding.Cmdlets.SetDefaultScaffolderCmdlet</strong></p>
<p><strong>Set-DefaultScaffolder : Unable to cast object of type &#8216;NuGet.SemanticVersion&#8217; to type &#8216;System.Version&#8217;.</strong><br />
<strong>At C:\users\michael.sync\documents\visual studio 2010\Projects\MvcApplication3\packages\T4Scaffolding.0.9.9\tools\install.ps1:24 char:22</strong><br />
<strong>+ Set-DefaultScaffolder &lt;&lt;&lt;&lt; -Name CustomTemplate -Scaffolder T4Scaffolding.CustomTemplate -SolutionWide -DoNotOverwriteExistingSetting</strong><br />
<strong> + CategoryInfo : NotSpecified: (:) [Set-DefaultScaffolder], InvalidCastException</strong><br />
<strong> + FullyQualifiedErrorId : T4Scaffolding.Cmdlets.SetDefaultScaffolderCmdlet</strong></p>
<p><strong>Set-DefaultScaffolder : Unable to cast object of type &#8216;NuGet.SemanticVersion&#8217; to type &#8216;System.Version&#8217;.</strong><br />
<strong>At C:\users\michael.sync\documents\visual studio 2010\Projects\MvcApplication3\packages\T4Scaffolding.0.9.9\tools\install.ps1:25 char:22</strong><br />
<strong>+ Set-DefaultScaffolder &lt;&lt;&lt;&lt; -Name CustomScaffolder -Scaffolder T4Scaffolding.CustomScaffolder -SolutionWide -DoNotOverwriteExistingSett</strong><br />
<strong>ing</strong><br />
<strong> + CategoryInfo : NotSpecified: (:) [Set-DefaultScaffolder], InvalidCastException</strong><br />
<strong> + FullyQualifiedErrorId : T4Scaffolding.Cmdlets.SetDefaultScaffolderCmdlet</strong></p>
<p>Successfully added &#8216;MvcMailer 1.1&#8242; to MvcApplication3.<br />
<strong>Set-DefaultScaffolder : Unable to cast object of type &#8216;NuGet.SemanticVersion&#8217; to type &#8216;System.Version&#8217;.</strong><br />
<strong>At C:\users\michael.sync\documents\visual studio 2010\Projects\MvcApplication3\packages\MvcMailer.1.1\tools\Install.ps1:23 char:22</strong><br />
<strong>+ Set-DefaultScaffolder &lt;&lt;&lt;&lt; -Name Mailer -Scaffolder $mailerScaffolder -SolutionWide -DoNotOverwriteExistingSetting</strong><br />
<strong> + CategoryInfo : NotSpecified: (:) [Set-DefaultScaffolder], InvalidCastException</strong><br />
<strong> + FullyQualifiedErrorId : T4Scaffolding.Cmdlets.SetDefaultScaffolderCmdlet</strong><br />
<strong>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;READ ME&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</strong></p>
<p>Your default Mailer Scaffolder is set to Mailer.Razor</p>
<p>You can generate your Mailers and Views using the following Scaffolder Command</p>
<p>PM&gt; Scaffold Mailer UserMailer Welcome,GoodBye</p>
<p>Edit the smtp configuration at web.config file before you send an email</p>
<p>You can find more at: https://github.com/smsohan/MvcMailer/wiki/MvcMailer-Step-by-Step-Guide</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
Successfully uninstalled &#8216;EntityFramework 4.1.10331.0&#8242;.</p>
<p>PM&gt;</p></blockquote>
<h1>Solution</h1>
<p>As you can see, MvcMailer has the dependency on &#8220;<a href="http://nuget.org/packages/T4Scaffolding">T4Scaffolding</a> (v0.9.9)&#8221; package which has dependency on &#8220;EFCodeFirst&#8221; package which is the outdated version of EF. All you have to do to make MvcMailer works is very simple. Just update &#8220;T4Scaffolding&#8221; package by using &#8220;Update-Package&#8221; command from Nuget Console.</p>
<blockquote><p>PM&gt; Update-Package T4Scaffolding<br />
Updating &#8216;T4Scaffolding&#8217; from version &#8217;0.9.9&#8242; to &#8217;1.0.6&#8242; in project &#8216;MvcApplication3&#8242;.<br />
Successfully removed &#8216;T4Scaffolding 0.9.9&#8242; from MvcApplication3.<br />
Successfully installed &#8216;T4Scaffolding 1.0.6&#8242;.<br />
&#8212;<br />
A different version of T4Scaffolding is already running in this instance of Visual Studio<br />
Please restart Visual Studio to avoid unexpected behavior.<br />
You won&#8217;t be able to use scaffolding until you restart Visual Studio.<br />
&#8212;<br />
Successfully added &#8216;T4Scaffolding 1.0.6&#8242; to MvcApplication3.<br />
Successfully uninstalled &#8216;T4Scaffolding 0.9.9&#8242;.</p></blockquote>
<p>After updating the package, you need to restart the Visual Studio.</p>
<h1>Testing</h1>
<p>Now, you can test MvcMailer&#8217;s Scaffold by using the command below. If you want to know more details, you can read &#8220;<a href="https://github.com/smsohan/MvcMailer/wiki/MvcMailer-Step-by-Step-Guide">MvcMaler: Step by Stp Guide</a>&#8220;.</p>
<blockquote><p>PM&gt; Scaffold Mailer.Razor UserMailer Welcome,PasswordReset<br />
Added MvcMailer output &#8216;Mailers\IUserMailer.cs&#8217;<br />
Added MvcMailer output &#8216;Mailers\UserMailer.cs&#8217;<br />
Added MyScaffolder output &#8216;Views\UserMailer\_Layout.cshtml&#8217;<br />
Added MyScaffolder output &#8216;Views\UserMailer\Welcome.cshtml&#8217;<br />
Added MyScaffolder output &#8216;Views\UserMailer\PasswordReset.cshtml&#8217;<br />
PM&gt;</p></blockquote>
<div class='kouguu_fb_like_button'><iframe src="http://www.facebook.com/plugins/like.php?href=http://michaelsync.net/2012/06/26/mvcmailer&#038;layout=standard&#038;show_faces=false&#038;width=450&#038;height=25&#038;action=like&#038;colorscheme=light&#038;" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:450px; height:25px;"></iframe></div>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/MichaelSync?a=lAbKC3QW6as:0-_XQ12uSLc:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/MichaelSync?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/MichaelSync?a=lAbKC3QW6as:0-_XQ12uSLc:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/MichaelSync?i=lAbKC3QW6as:0-_XQ12uSLc:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/MichaelSync?a=lAbKC3QW6as:0-_XQ12uSLc:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/MichaelSync?i=lAbKC3QW6as:0-_XQ12uSLc:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/MichaelSync?a=lAbKC3QW6as:0-_XQ12uSLc:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/MichaelSync?i=lAbKC3QW6as:0-_XQ12uSLc:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/MichaelSync?a=lAbKC3QW6as:0-_XQ12uSLc:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/MichaelSync?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/MichaelSync?a=lAbKC3QW6as:0-_XQ12uSLc:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/MichaelSync?d=dnMXMwOfBR0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/MichaelSync?a=lAbKC3QW6as:0-_XQ12uSLc:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/MichaelSync?i=lAbKC3QW6as:0-_XQ12uSLc:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/MichaelSync?a=lAbKC3QW6as:0-_XQ12uSLc:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/MichaelSync?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/MichaelSync?a=lAbKC3QW6as:0-_XQ12uSLc:KwTdNBX3Jqk"><img src="http://feeds.feedburner.com/~ff/MichaelSync?i=lAbKC3QW6as:0-_XQ12uSLc:KwTdNBX3Jqk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/MichaelSync?a=lAbKC3QW6as:0-_XQ12uSLc:l6gmwiTKsz0"><img src="http://feeds.feedburner.com/~ff/MichaelSync?d=l6gmwiTKsz0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/MichaelSync?a=lAbKC3QW6as:0-_XQ12uSLc:TzevzKxY174"><img src="http://feeds.feedburner.com/~ff/MichaelSync?d=TzevzKxY174" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/MichaelSync/~4/lAbKC3QW6as" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://michaelsync.net/2012/06/26/mvcmailer/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://michaelsync.net/2012/06/26/mvcmailer</feedburner:origLink></item>
		<item>
		<title>Anthem.NET and .NET 4.0</title>
		<link>http://feedproxy.google.com/~r/MichaelSync/~3/eD3erCnF5mk/anthem-net-and-net-4-0</link>
		<comments>http://michaelsync.net/2012/06/24/anthem-net-and-net-4-0#comments</comments>
		<pubDate>Mon, 25 Jun 2012 01:57:25 +0000</pubDate>
		<dc:creator>Michael Sync</dc:creator>
				<category><![CDATA[AJAX]]></category>
		<category><![CDATA[ASP.NET]]></category>

		<guid isPermaLink="false">http://michaelsync.net/?p=2274</guid>
		<description><![CDATA[Solution for making Anthem.NET works in .NET 4.0 project. Problem Anthem.NET Ajax library written by Jason Diamonds supports only ASP.NET 1.1 and ASP.NET 2.0. This library is totally depending on the classic client id generation. When we upgraded our project to .NET 4.0, we found that the pages that use Anthem.NET doesn&#8217;t work anymore. Please refer ...<a class="post-readmore" href="http://michaelsync.net/2012/06/24/anthem-net-and-net-4-0">read more</a>]]></description>
				<content:encoded><![CDATA[<p>Solution for making Anthem.NET works in .NET 4.0 project.</p>
<p><a href="http://michaelsync.net/wp-content/uploads/2012/04/home_net4.png"><img class="alignnone size-full wp-image-2280" title="home_net4" src="http://michaelsync.net/wp-content/uploads/2012/04/home_net4.png" alt="" width="314" height="265" /></a></p>
<h1>Problem</h1>
<p>Anthem.NET Ajax library written by Jason Diamonds supports only ASP.NET 1.1 and ASP.NET 2.0. This library is totally depending on the classic client id generation. When we upgraded our project to .NET 4.0, we found that the pages that use Anthem.NET doesn&#8217;t work anymore.</p>
<p>Please refer to the following links below to see ASP.NET 4.0 breaking changes.</p>
<p><a href="http://www.asp.net/whitepapers/aspnet4/breaking-changes#0.1__Toc256770142">ASP.NET 4.0 breaking changes</a></p>
<p><a href="http://msdn.microsoft.com/en-us/library/system.web.ui.control.clientidmode.aspx">ClientIDMode</a>.</p>
<h1>Solution</h1>
<p>The solution for this issue is very simple. You can set the compatibility mode to 3.5 in web.config and then Anthem.NET will work without changing anything.</p>
<p><a href="http://michaelsync.net/wp-content/uploads/2012/04/Anthem.NET-and-.NET-4.0.png"><img class="alignnone size-single-thumbnail wp-image-2278" title="Anthem.NET and .NET 4.0" src="http://michaelsync.net/wp-content/uploads/2012/04/Anthem.NET-and-.NET-4.0.png" alt="" width="636" height="128" /></a></p>
<p>Here is the code that you copy.</p>
<pre class="brush: xml; title: ; notranslate">

&lt;pages controlRenderingCompatibilityVersion=&quot;3.5&quot; clientIDMode=&quot;AutoID&quot;&gt;

&lt;controls&gt;

&lt;add tagPrefix=&quot;asp&quot; namespace=&quot;System.Web.UI&quot; assembly=&quot;System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35&quot;/&gt;

&lt;add tagPrefix=&quot;asp&quot; namespace=&quot;System.Web.UI.WebControls&quot; assembly=&quot;System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35&quot;/&gt;

&lt;/controls&gt;

&lt;/pages&gt;

</pre>
<p><strong>Download</strong></p>
<p>I converted the existing project to .NET 4.0 as well. You can download it from the link below.</p>
<ul>
<li>git@github.com:michaelsync/Michael-Sync-s-blog-sample.git</li>
<li><a href="https://github.com/michaelsync/Michael-Sync-s-blog-sample/tree/master/anthem-1.5.3">https://github.com/michaelsync/Michael-Sync-s-blog-sample/tree/master/anthem-1.5.3</a></li>
</ul>
<div class='kouguu_fb_like_button'><iframe src="http://www.facebook.com/plugins/like.php?href=http://michaelsync.net/2012/06/24/anthem-net-and-net-4-0&#038;layout=standard&#038;show_faces=false&#038;width=450&#038;height=25&#038;action=like&#038;colorscheme=light&#038;" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:450px; height:25px;"></iframe></div>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/MichaelSync?a=eD3erCnF5mk:YAzKrFtUCXU:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/MichaelSync?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/MichaelSync?a=eD3erCnF5mk:YAzKrFtUCXU:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/MichaelSync?i=eD3erCnF5mk:YAzKrFtUCXU:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/MichaelSync?a=eD3erCnF5mk:YAzKrFtUCXU:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/MichaelSync?i=eD3erCnF5mk:YAzKrFtUCXU:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/MichaelSync?a=eD3erCnF5mk:YAzKrFtUCXU:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/MichaelSync?i=eD3erCnF5mk:YAzKrFtUCXU:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/MichaelSync?a=eD3erCnF5mk:YAzKrFtUCXU:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/MichaelSync?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/MichaelSync?a=eD3erCnF5mk:YAzKrFtUCXU:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/MichaelSync?d=dnMXMwOfBR0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/MichaelSync?a=eD3erCnF5mk:YAzKrFtUCXU:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/MichaelSync?i=eD3erCnF5mk:YAzKrFtUCXU:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/MichaelSync?a=eD3erCnF5mk:YAzKrFtUCXU:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/MichaelSync?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/MichaelSync?a=eD3erCnF5mk:YAzKrFtUCXU:KwTdNBX3Jqk"><img src="http://feeds.feedburner.com/~ff/MichaelSync?i=eD3erCnF5mk:YAzKrFtUCXU:KwTdNBX3Jqk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/MichaelSync?a=eD3erCnF5mk:YAzKrFtUCXU:l6gmwiTKsz0"><img src="http://feeds.feedburner.com/~ff/MichaelSync?d=l6gmwiTKsz0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/MichaelSync?a=eD3erCnF5mk:YAzKrFtUCXU:TzevzKxY174"><img src="http://feeds.feedburner.com/~ff/MichaelSync?d=TzevzKxY174" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/MichaelSync/~4/eD3erCnF5mk" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://michaelsync.net/2012/06/24/anthem-net-and-net-4-0/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://michaelsync.net/2012/06/24/anthem-net-and-net-4-0</feedburner:origLink></item>
		<item>
		<title>Tips! ASP.NET MVC – JavaScriptSerializer – 3 Questions and 3 Answers</title>
		<link>http://feedproxy.google.com/~r/MichaelSync/~3/TluMypY3FLU/tips-asp-net-mvc-javascriptserializer-3-questions-and-3-answers</link>
		<comments>http://michaelsync.net/2012/04/05/tips-asp-net-mvc-javascriptserializer-3-questions-and-3-answers#comments</comments>
		<pubDate>Thu, 05 Apr 2012 07:16:22 +0000</pubDate>
		<dc:creator>Michael Sync</dc:creator>
				<category><![CDATA[ASP.NET MVC]]></category>

		<guid isPermaLink="false">http://michaelsync.net/?p=2246</guid>
		<description><![CDATA[Thanks to Darin Dimitrov (MVP)  for answering questions in very details! Test Project Download ~ git clone: git@github.com:michaelsync/Michael-Sync-s-blog-sample.git AjaxJsonTest Scenario I have the following model, view and controller. Model View Controller Questions 1) Why can&#8217;t we use the public field instead of properties in Model?  Because the model binder works only with properties. It is by ...<a class="post-readmore" href="http://michaelsync.net/2012/04/05/tips-asp-net-mvc-javascriptserializer-3-questions-and-3-answers">read more</a>]]></description>
				<content:encoded><![CDATA[<blockquote><p>Thanks to <a href="http://stackoverflow.com/users/29407/darin-dimitrov">Darin Dimitrov (MVP)</a>  for answering questions in very details!</p></blockquote>
<p><a href="http://michaelsync.net/wp-content/uploads/2012/04/asp-net-mvc-3.gif"><img class="alignnone size-full wp-image-2247" title="asp-net-mvc-3" src="http://michaelsync.net/wp-content/uploads/2012/04/asp-net-mvc-3.gif" alt="" width="376" height="292" /></a></p>
<p><strong>Test Project Download</strong> ~</p>
<ul>
<li>git clone: git@github.com:michaelsync/Michael-Sync-s-blog-sample.git</li>
<li><a href="https://github.com/michaelsync/Michael-Sync-s-blog-sample/blob/master/AjaxJsonTest/AjaxJsonTest.zip">AjaxJsonTest</a></li>
</ul>
<h1>Scenario</h1>
<p>I have the following model, view and controller.</p>
<p><strong>Model</strong></p>
<pre class="brush: csharp; title: ; notranslate">
public class Person {
 public string Name;// { get; set; }
 public string Occupation { get; set; }
 public int Salary { get; set; }
 public int[] NumArr { get; set; }
}

</pre>
<p><strong>View</strong></p>
<pre class="brush: jscript; title: ; notranslate">
&lt;input id=&quot;Test&quot; type=&quot;button&quot; value=&quot;Test&quot; /&gt;

@section Javascript{
&lt;script type=&quot;text/javascript&quot;&gt;// &lt;![CDATA[
 $(function () {
 $(&quot;#Test&quot;).click(function () {
 var data = { Name: &quot;Michael Tom&quot;, Occupation: &quot;Programmer&quot;, Salary: 8500, NumArr: [2,6,4,9] };
 var url = &quot;Home/GetJson&quot;;
 $.ajax({
 url: url,
 dataType: &quot;json&quot;,
 type: &quot;POST&quot;,
 data: data,
 traditional: true,
 success: function (result) {

}
 });

});
 });
// ]]&gt;&lt;/script&gt;
}

</pre>
<p><strong>Controller</strong></p>
<pre class="brush: csharp; title: ; notranslate">
public class HomeController : Controller
 {
 public ActionResult Index()
 {
 return View();
 }

public JsonResult GetJson(Person person) {

return Json(......);
 }
 }
</pre>
<h1>Questions</h1>
<p><strong>1) Why can&#8217;t we use the public field instead of properties in Model? </strong></p>
<p>Because the model binder works only with properties. It is by design. Normally fields should be private in your classes. They are implementation detail. Use properties to expose some behavior to the outer world.</p>
<p><strong>2) If I changed the type of NumArr property to List&lt;int&gt; then it doesn&#8217;t work. How can we use List instead of the int[]? I know I&#8217;m passing the array from JS. Can we pass List&lt;T&gt; from JS as well?</strong></p>
<p>It should work. No matter whether you use List&lt;int&gt;, IEnumerable&lt;int&gt; or int[], it&#8217;s the same and it works. What wouldn&#8217;t work is if you wanted to use a collection of some complex object like for example List&lt;SomeComplexType&gt; (see my answer below for a solution to this).</p>
<p><strong>3) I&#8217;m using &#8220;traditional: true&#8221; in Javascript code block of View because serialization doesn&#8217;t work with &#8220;traditional: false&#8221;. Does ASP.NET MVC&#8217;s serializer support only old version?</strong></p>
<p>Yes, the <a href="http://api.jquery.com/jQuery.param/">traditional parameter</a> was introduced in jQuery 1.4 when they changed the way jQuery serializes parameters. The change happened to be non-compatible with the standard convention that the model binder uses in MVC when <a href="http://haacked.com/archive/2008/10/23/model-binding-to-a-list.aspx">binding to lists</a>.</p>
<p>So download a javascript debugging tool such as FireBug and start playing. You will see the differences in the way jQuery sends the request when you set this parameter.</p>
<p>All this being said I would recommend you to send JSON encoded requests to your controller actions. This will work with any complex objects and you don&#8217;t have to ask yourself which version of jQuery you are using or whatever because JSON is a standard interoperable format. The advantage of a standard interoperable format is that no matter which system you use, you should be able to make them talk the same language (unless of course there are bugs in those systems and they do not respect the defined standard).</p>
<p>But now you could tell me that <a href="http://www.w3.org/TR/html401/interact/forms.html#h-17.13.4.1">application/x-www-form-urlencoded</a> is also a standard and inetroperable format. And that&#8217;s true. The problem is that the model binder uses a convention when binding the name of the input fields into properties of your models. And this convention is far from something being interoperable or industry standard.</p>
<p>So for example you could have an hierarchy of models:</p>
<pre class="brush: csharp; title: ; notranslate">
public class Person
{
 public string Name { get; set; }
 public string Occupation { get; set; }
 public int Salary { get; set; }
 public List SubObjects { get; set; }
}

public class SubObject
{
 public int Id { get; set; }
 public string Name { get; set; }
}
</pre>
<p>You could imagine any complex hierarchy you like (at the exception of circular references which are not supported by the JSON format). and then:</p>
<pre class="brush: jscript; title: ; notranslate">
var data = {
 name: &quot;Michael Tom&quot;,
 occupation: &quot;Programmer&quot;,
 salary: 8500,
 subObjects: [
 { id: 1, name: 'sub 1' },
 { id: 2, name: 'sub 2' },
 { id: 3, name: 'sub 3' }
 ]
};

$.ajax({
 url: &quot;Home/GetJson&quot;,
 type: &quot;POST&quot;,
 data: JSON.stringify({ person: data }),
 contentType: 'application/json',
 success: function (result) {

}
});
</pre>
<p>We set the Content-Type request HTTP header to application/json to indicate the built-in JSON value provider factory that the request is JSON encoded (using the JSON.stringify method) and it will parse it back to your strongly typed model. The JSON.stringify method is natively built into modern browsers but if you wanted to support legacy browsers you could include the json2.js script to your page.</p>
<p><strong>Reference</strong>:</p>
<ul>
<li><a href="http://stackoverflow.com/questions/9978254/mvc-3-json-serializer">MVC 3 &#8211; JSON serializer</a></li>
</ul>
<div class='kouguu_fb_like_button'><iframe src="http://www.facebook.com/plugins/like.php?href=http://michaelsync.net/2012/04/05/tips-asp-net-mvc-javascriptserializer-3-questions-and-3-answers&#038;layout=standard&#038;show_faces=false&#038;width=450&#038;height=25&#038;action=like&#038;colorscheme=light&#038;" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:450px; height:25px;"></iframe></div>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/MichaelSync?a=TluMypY3FLU:hzjhR0DrwNg:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/MichaelSync?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/MichaelSync?a=TluMypY3FLU:hzjhR0DrwNg:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/MichaelSync?i=TluMypY3FLU:hzjhR0DrwNg:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/MichaelSync?a=TluMypY3FLU:hzjhR0DrwNg:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/MichaelSync?i=TluMypY3FLU:hzjhR0DrwNg:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/MichaelSync?a=TluMypY3FLU:hzjhR0DrwNg:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/MichaelSync?i=TluMypY3FLU:hzjhR0DrwNg:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/MichaelSync?a=TluMypY3FLU:hzjhR0DrwNg:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/MichaelSync?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/MichaelSync?a=TluMypY3FLU:hzjhR0DrwNg:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/MichaelSync?d=dnMXMwOfBR0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/MichaelSync?a=TluMypY3FLU:hzjhR0DrwNg:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/MichaelSync?i=TluMypY3FLU:hzjhR0DrwNg:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/MichaelSync?a=TluMypY3FLU:hzjhR0DrwNg:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/MichaelSync?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/MichaelSync?a=TluMypY3FLU:hzjhR0DrwNg:KwTdNBX3Jqk"><img src="http://feeds.feedburner.com/~ff/MichaelSync?i=TluMypY3FLU:hzjhR0DrwNg:KwTdNBX3Jqk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/MichaelSync?a=TluMypY3FLU:hzjhR0DrwNg:l6gmwiTKsz0"><img src="http://feeds.feedburner.com/~ff/MichaelSync?d=l6gmwiTKsz0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/MichaelSync?a=TluMypY3FLU:hzjhR0DrwNg:TzevzKxY174"><img src="http://feeds.feedburner.com/~ff/MichaelSync?d=TzevzKxY174" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/MichaelSync/~4/TluMypY3FLU" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://michaelsync.net/2012/04/05/tips-asp-net-mvc-javascriptserializer-3-questions-and-3-answers/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://michaelsync.net/2012/04/05/tips-asp-net-mvc-javascriptserializer-3-questions-and-3-answers</feedburner:origLink></item>
		<item>
		<title>Building ASP.NET MVC, Web API, and Web Pages source code</title>
		<link>http://feedproxy.google.com/~r/MichaelSync/~3/ceYSVuGSafM/building-asp-net-mvc-web-api-and-web-pages-source-code</link>
		<comments>http://michaelsync.net/2012/04/01/building-asp-net-mvc-web-api-and-web-pages-source-code#comments</comments>
		<pubDate>Mon, 02 Apr 2012 05:42:50 +0000</pubDate>
		<dc:creator>Michael Sync</dc:creator>
				<category><![CDATA[ASP.NET]]></category>

		<guid isPermaLink="false">http://michaelsync.net/?p=2212</guid>
		<description><![CDATA[Update #1: Brad Wilson replied me as below ~ Paul Betts has diagnosed this as having some auto-generated files which are currently UTF16, which Git does not support. I&#8217;m working to figure out exactly how widespread the problem is. Seems like codeplex is having the encoding problem with UTF16 file on git repository. Update #2: Brad Wilson said ...<a class="post-readmore" href="http://michaelsync.net/2012/04/01/building-asp-net-mvc-web-api-and-web-pages-source-code">read more</a>]]></description>
				<content:encoded><![CDATA[<p><strong>Update #1:</strong> Brad Wilson replied me as below ~</p>
<blockquote><p>Paul Betts has diagnosed this as having some auto-generated files which are currently UTF16, which Git does not support. I&#8217;m working to figure out exactly how widespread the problem is.</p></blockquote>
<p>Seems like codeplex is having the encoding problem with UTF16 file on git repository.</p>
<p><strong>Update #2:</strong> Brad Wilson said that he has fixed that file. I re-pulled the repo again and tested it.. It works! </p>
<h1>Introduction</h1>
<p><a href="http://michaelsync.net/wp-content/uploads/2012/04/Building-ASP.NET-MVC-sourcecode.png"><img class="alignnone size-full wp-image-2220" title="Building ASP.NET MVC sourcecode" src="http://michaelsync.net/wp-content/uploads/2012/04/Building-ASP.NET-MVC-sourcecode.png" alt="" width="760" height="560" /></a></p>
<p>Scott Guthrie announced that Microsoft is releasing the source code of ASP.NET Web API and ASP.NET Web Pages (aka Razor) under an open source license (Apache 2.0). They will be accepting the contributions from community as well. What a great news for us! I&#8217;m really happy to see more open source projects coming out from Microsoft.</p>
<p><a href="http://michaelsync.net/wp-content/uploads/2012/03/aspnet-250x250.png"><img class="alignnone size-full wp-image-2216" title="aspnet-250x250" src="http://michaelsync.net/wp-content/uploads/2012/03/aspnet-250x250.png" alt="" width="100" height="100" /></a></p>
<p>Even though I&#8217;m currently occupied with my school, work and etc, I tried downloading the source code from codeplex and building it with a lot and lot of love. (If you don&#8217;t know how to install git on your machine, please follow this post &#8220;<a href="http://help.github.com/win-set-up-git/">Set Up Git</a>&#8221; from github. )</p>
<ul>
<li><strong>Git</strong>: git clone https://git01.codeplex.com/aspnetwebstack.git</li>
</ul>
<p>I got the following folders once I cloned the git repository.</p>
<p><a href="http://michaelsync.net/wp-content/uploads/2012/03/File-Explorer.png"><img class="alignnone size-full wp-image-2213" title="File Explorer" src="http://michaelsync.net/wp-content/uploads/2012/03/File-Explorer.png" alt="" width="476" height="423" /></a></p>
<p>The first thing that I need to do is to restore the nuget packages. Microsoft put the nuget configuration file only instead of  all those third-party assemblies that are required to build the source code. This can be achieved by running &#8220;build RestorePackages&#8221; from the root of the repository that I just cloned.</p>
<p><img class="alignnone size-full wp-image-2214" title="Build RestorePackages" src="http://michaelsync.net/wp-content/uploads/2012/03/Build-RestorePackages.png" alt="" width="676" height="136" /></p>
<p>You can enable the nuget restore permanently by adding this system variable in your environment.</p>
<p><a href="http://michaelsync.net/wp-content/uploads/2012/03/EnableNuGetPackageRestore.png"><img class="alignnone size-full wp-image-2215" title="EnableNuGetPackageRestore" src="http://michaelsync.net/wp-content/uploads/2012/03/EnableNuGetPackageRestore.png" alt="" width="513" height="502" /></a></p>
<p>Otherwise, you will get this error.</p>
<blockquote><p>Error 1 NuGet package restore is not currently enabled. For more information, please see: http://aspnetwebstack.codeplex.com/wikipage?title=NuGet+Packages System.Web.Razor</p></blockquote>
<p>According to the <a href="http://aspnetwebstack.codeplex.com/documentation">official document</a>, we need to download &#8220;<a href="http://www.codeplex.com/Download?ProjectName=aspnetwebstack&amp;DownloadId=360565">SkipStorngNames</a>&#8221; and run “skipstrongnames -e&#8221; with admin right in command prompt but I didn&#8217;t do it on one of my machines and I can still build the whole code (including test) from VS10. I&#8217;m still pretty new to the code base so I will download and run it when I need.</p>
<h1>Errors and Warning</h1>
<p>When I tried building the solution, I got this error below.</p>
<blockquote><p>WebGrid\_WebGridRenderer.generated.cs(1,1): error CS0116: A namespace cannot directly contain members such as fields or methods [C:\aspnetwebstack\src\System.Web.Helpers\System.Web.Helpers.csproj]</p></blockquote>
<p>I thought that the auto-generated code got screwed up so I deleted everything from that file and tried saving the _WebGridRenderer.cshtml again. Nothing was generated and found two warnings below.</p>
<blockquote><p>Warning 8 C:\Michael Sync\++ Project\aspnetwebstack\aspnetwebstack\src\System.Web.Helpers\WebGrid\_WebGridRenderer.cshtml: ASP.NET runtime error: There is no build provider registered for the extension &#8216;.cshtml&#8217;. You can register one in the &lt;compilation&gt;&lt;buildProviders&gt; section in machine.config or web.config. Make sure is has a BuildProviderAppliesToAttribute attribute which includes the value &#8216;Web&#8217; or &#8216;All&#8217;. C:\Michael Sync\++ Project\aspnetwebstack\aspnetwebstack\src\System.Web.Helpers\WebGrid\_WebGridRenderer.cshtml 1 1 System.Web.Helpers</p>
<p>Warning 1 Cannot find custom tool &#8216;RazorHelperGenerator&#8217; on this system. C:\Michael Sync\++ Project\aspnetwebstack\aspnetwebstack\src\System.Web.Helpers\WebGrid\_WebGridRenderer.cshtml System.Web.Helpers</p></blockquote>
<h1>(Temp?) Solution</h1>
<p>Ok! There are a lot of doubts and questions but I will share the way that I fixed in order to build the solution without any error.</p>
<p>The main problem that we can&#8217;t build is that _WebGridRenderer.generated.cs file has weird non-English characters but when you look at <a href="http://aspnetwebstack.codeplex.com/SourceControl/changeset/view/ef2dfab3f6fb#src%2fSystem.Web.Helpers%2fWebGrid%2f_WebGridRenderer.generated.cs">that file</a> in browser, you can see the English version.</p>
<p>The picture below shows the differences between the file that I have and the file on server.</p>
<p><a href="http://michaelsync.net/wp-content/uploads/2012/04/git-vs-web.png"><img class="alignnone size-full wp-image-2227" title="git vs web" src="http://michaelsync.net/wp-content/uploads/2012/04/git-vs-web.png" alt="" width="1304" height="768" /></a></p>
<p>So, I manually copied it from browser (downloading the code as zip file doesn&#8217;t work either) and override everything in _WebGridRenderer.generated.cs. After that, it works.</p>
<p>If you are desperately willing to build the code right now, you can follow what I did. I will keep you updated once I found something useful.</p>
<h1>Conclusion</h1>
<p>You are no longer need to use the temp solution that I mentioned above.. The coordinator from project has fixed the issue and you should be able to re-pull the repository and can build the project already.</p>
<p>Thanks!
<div class='kouguu_fb_like_button'><iframe src="http://www.facebook.com/plugins/like.php?href=http://michaelsync.net/2012/04/01/building-asp-net-mvc-web-api-and-web-pages-source-code&#038;layout=standard&#038;show_faces=false&#038;width=450&#038;height=25&#038;action=like&#038;colorscheme=light&#038;" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:450px; height:25px;"></iframe></div>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/MichaelSync?a=ceYSVuGSafM:gAlr1U6mbCI:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/MichaelSync?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/MichaelSync?a=ceYSVuGSafM:gAlr1U6mbCI:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/MichaelSync?i=ceYSVuGSafM:gAlr1U6mbCI:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/MichaelSync?a=ceYSVuGSafM:gAlr1U6mbCI:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/MichaelSync?i=ceYSVuGSafM:gAlr1U6mbCI:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/MichaelSync?a=ceYSVuGSafM:gAlr1U6mbCI:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/MichaelSync?i=ceYSVuGSafM:gAlr1U6mbCI:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/MichaelSync?a=ceYSVuGSafM:gAlr1U6mbCI:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/MichaelSync?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/MichaelSync?a=ceYSVuGSafM:gAlr1U6mbCI:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/MichaelSync?d=dnMXMwOfBR0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/MichaelSync?a=ceYSVuGSafM:gAlr1U6mbCI:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/MichaelSync?i=ceYSVuGSafM:gAlr1U6mbCI:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/MichaelSync?a=ceYSVuGSafM:gAlr1U6mbCI:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/MichaelSync?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/MichaelSync?a=ceYSVuGSafM:gAlr1U6mbCI:KwTdNBX3Jqk"><img src="http://feeds.feedburner.com/~ff/MichaelSync?i=ceYSVuGSafM:gAlr1U6mbCI:KwTdNBX3Jqk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/MichaelSync?a=ceYSVuGSafM:gAlr1U6mbCI:l6gmwiTKsz0"><img src="http://feeds.feedburner.com/~ff/MichaelSync?d=l6gmwiTKsz0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/MichaelSync?a=ceYSVuGSafM:gAlr1U6mbCI:TzevzKxY174"><img src="http://feeds.feedburner.com/~ff/MichaelSync?d=TzevzKxY174" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/MichaelSync/~4/ceYSVuGSafM" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://michaelsync.net/2012/04/01/building-asp-net-mvc-web-api-and-web-pages-source-code/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://michaelsync.net/2012/04/01/building-asp-net-mvc-web-api-and-web-pages-source-code</feedburner:origLink></item>
	</channel>
</rss>
