<?xml version="1.0"?><?xml-stylesheet type="text/xsl" href="/rss.xsl"?><rss version="2.0"><channel><title>razorengine Discussions Rss Feed</title><link>http://razorengine.codeplex.com/discussions</link><description>razorengine Discussions Rss Description</description><item><title>New Post: 'object' does not contain a definition for 'Header'</title><link>http://razorengine.codeplex.com/discussions/439936</link><description>&lt;div style="line-height: normal;"&gt;Okay, wow, I feel dumb... My model class was private. Making it public fixed my issue.&lt;br /&gt;
&lt;/div&gt;</description><author>DeeboSan</author><pubDate>Thu, 11 Apr 2013 14:00:26 GMT</pubDate><guid isPermaLink="false">New Post: 'object' does not contain a definition for 'Header' 20130411020026P</guid></item><item><title>New Post: 'object' does not contain a definition for 'Header'</title><link>http://razorengine.codeplex.com/discussions/439936</link><description>&lt;div style="line-height: normal;"&gt;Hello,&lt;br /&gt;
&lt;br /&gt;
I'm getting this error when parsing my template even though my model object does have the Header property on it. The odd thing is if I use and anonymous type it works fine. Any ideas how I can fix this? I'm using .NET 4.0.&lt;br /&gt;
&lt;br /&gt;
FAILS&lt;br /&gt;
string body = Razor.Parse&amp;lt;EmailBodyModel&amp;gt;(template, model);&lt;br /&gt;
&lt;br /&gt;
WORKS&lt;br /&gt;
string body = Razor.Parse(template, new { Header = &amp;quot;xxx&amp;quot;} );&lt;br /&gt;
&lt;br /&gt;
I came accross the discussion below but that appears to be the opposite issue that I have.&lt;br /&gt;
&lt;br /&gt;
&lt;a href="http://razorengine.codeplex.com/discussions/248593" rel="nofollow"&gt;http://razorengine.codeplex.com/discussions/248593&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Thanks&lt;br /&gt;
&lt;/div&gt;</description><author>DeeboSan</author><pubDate>Thu, 11 Apr 2013 13:56:37 GMT</pubDate><guid isPermaLink="false">New Post: 'object' does not contain a definition for 'Header' 20130411015637P</guid></item><item><title>New Post: Performance Issue when using RazorEngine.Razor.SetTemplateService</title><link>http://razorengine.codeplex.com/discussions/436068</link><description>&lt;div style="line-height: normal;"&gt;I found the solution, I just moved the code that sets the template service to App_Start in global.asax and now everything works great :)&lt;br /&gt;
&lt;/div&gt;</description><author>robi2</author><pubDate>Mon, 11 Mar 2013 12:25:44 GMT</pubDate><guid isPermaLink="false">New Post: Performance Issue when using RazorEngine.Razor.SetTemplateService 20130311122544P</guid></item><item><title>New Post: Performance Issue when using RazorEngine.Razor.SetTemplateService</title><link>http://razorengine.codeplex.com/discussions/436068</link><description>&lt;div style="line-height: normal;"&gt;Hi,&lt;br /&gt;
&lt;br /&gt;
I noticed that if I use a base template for my razor views, the views don't get cached and are always begin parsed from scratch.&lt;br /&gt;
&lt;br /&gt;
This is the code i am using:&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;// Set razor engine base template
                    var config = new RazorEngine.Configuration.TemplateServiceConfiguration
                    {
                        BaseTemplateType = typeof(MyTemplateBase&amp;lt;&amp;gt;)
                    };

                    using (var service = new TemplateService(config))
                    {
                        RazorEngine.Razor.SetTemplateService(service);
                        // Parse the template and also save it to cache
                        m_content.Text = RazorEngine.Razor.Parse(myTemplate, myModel, myCacheName);
                    }&lt;/code&gt;&lt;/pre&gt;

This code runs on every request, and I think that is the problem.&lt;br /&gt;
&lt;br /&gt;
Can someone point me in the right direction?&lt;br /&gt;
&lt;br /&gt;
Thanks,&lt;br /&gt;
Robert&lt;br /&gt;
&lt;/div&gt;</description><author>robi2</author><pubDate>Sun, 10 Mar 2013 18:59:47 GMT</pubDate><guid isPermaLink="false">New Post: Performance Issue when using RazorEngine.Razor.SetTemplateService 20130310065947P</guid></item><item><title>New Post: ArgumentNullException when using Assembly.LoadFrom</title><link>http://razorengine.codeplex.com/discussions/270474</link><description>&lt;div style="line-height: normal;"&gt;I debugged the code and found that the issue is the RazorEngine is trying to load itself when compile the template but can't find that in the loaded assemblies. So I fixed this problem by install RazorEngine dll in the GAC using .NET Framewok 4 tool with the following command.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Install RazorEngine to GAC 4.0&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin\NETFX 4.0 Tools\x64\gacutil&amp;quot; /f /i RazorEngine.dll&lt;br /&gt;
&lt;/div&gt;</description><author>mrmohsoft</author><pubDate>Thu, 28 Feb 2013 11:46:38 GMT</pubDate><guid isPermaLink="false">New Post: ArgumentNullException when using Assembly.LoadFrom 20130228114638A</guid></item><item><title>New Post: Do I have to use dynamic models?</title><link>http://razorengine.codeplex.com/discussions/433799</link><description>&lt;div style="line-height: normal;"&gt;Is it necessary to use dynamic models?&lt;br /&gt;
&lt;br /&gt;
I created a class &amp;quot;SampleModelClass&amp;quot; inheriting from abstract class ModelClassBase. I defined properties SampleModelClass.Firstname and SampleModelClass.Lastname. &lt;br /&gt;
When calling Razor.Parse&amp;lt;SampleModelClass&amp;gt;(templateContent, sampleModel); I get an exception telling me that Firstname is not found in class &amp;quot;ModelClassBase&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
I don't understand why RazorEngine wants to use ModelClassBase? If I use a dynamic model (new {Firstname = &amp;quot;Foo&amp;quot;, Lastname = &amp;quot;Bar&amp;quot;;) it works fine.&lt;br /&gt;
&lt;/div&gt;</description><author>tojak</author><pubDate>Wed, 20 Feb 2013 12:57:39 GMT</pubDate><guid isPermaLink="false">New Post: Do I have to use dynamic models? 20130220125739P</guid></item><item><title>New Post: RazorEngine and shared @helpers</title><link>http://razorengine.codeplex.com/discussions/431620</link><description>&lt;div style="line-height: normal;"&gt;&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;How do i use a shared helper within a razor view that's compiled by RazorEngine? i have a helper located in App_Code that contains some common markup, but when i call the helper i get a string representation, not raw html.&lt;/p&gt;
&lt;p&gt;thanks&lt;/p&gt;
&lt;/div&gt;</description><author>shearer3000</author><pubDate>Fri, 01 Feb 2013 02:27:01 GMT</pubDate><guid isPermaLink="false">New Post: RazorEngine and shared @helpers 20130201022701A</guid></item><item><title>New Post: ArgumentNullException when using Assembly.LoadFrom</title><link>http://razorengine.codeplex.com/discussions/270474</link><description>&lt;div style="line-height: normal;"&gt;
&lt;p&gt;Is this problem officially fixed? or do we have go with the work around for now?&lt;/p&gt;
&lt;/div&gt;</description><author>kingseaeast</author><pubDate>Mon, 21 Jan 2013 23:20:16 GMT</pubDate><guid isPermaLink="false">New Post: ArgumentNullException when using Assembly.LoadFrom 20130121112016P</guid></item><item><title>New Post: ArgumentNullException when using Assembly.LoadFrom</title><link>http://razorengine.codeplex.com/discussions/270474</link><description>&lt;div style="line-height: normal;"&gt;
&lt;p&gt;Here's what fixed this problem for me. I had to help the runtime load the missing assemblies, so I used the AssemblyResolve event of the current AppDomain and manually loaded the missed assemblies:&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;div style="color:black; background-color:white"&gt;
&lt;pre&gt;        &lt;span style="color:blue"&gt;public&lt;/span&gt; &lt;span style="color:blue"&gt;string&lt;/span&gt; RenderText&amp;lt;T&amp;gt;(&lt;span style="color:blue"&gt;string&lt;/span&gt; templateText, T data)
        {
            AppDomain.CurrentDomain.AssemblyResolve += CurrentDomain_AssemblyResolve;
            &lt;span style="color:blue"&gt;try&lt;/span&gt; {
                &lt;span style="color:blue"&gt;return&lt;/span&gt; Razor.Parse(templateText, data);
            } &lt;span style="color:blue"&gt;finally&lt;/span&gt; {
                AppDomain.CurrentDomain.AssemblyResolve -= CurrentDomain_AssemblyResolve;
            }
        }

        &lt;span style="color:blue"&gt;private&lt;/span&gt; Assembly CurrentDomain_AssemblyResolve(&lt;span style="color:blue"&gt;object&lt;/span&gt; sender, ResolveEventArgs args) {
            &lt;span style="color:blue"&gt;return&lt;/span&gt; Assembly.Load(args.Name);
        }
&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;For me this error was&amp;nbsp;happening in a custom MSBuild task that I wrote using RazorEngine to create a report.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;/div&gt;</description><author>sergiopereira</author><pubDate>Thu, 10 Jan 2013 18:42:19 GMT</pubDate><guid isPermaLink="false">New Post: ArgumentNullException when using Assembly.LoadFrom 20130110064219P</guid></item><item><title>New Post: ArgumentNullException when using Assembly.LoadFrom</title><link>http://razorengine.codeplex.com/discussions/270474</link><description>&lt;div style="line-height: normal;"&gt;
&lt;p&gt;&lt;span&gt;All, I am fac&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;ing the same issue. Did you find a solution?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;AntarisZX&lt;/span&gt;,&lt;/p&gt;
&lt;p&gt;Did you have a version with a fix?&lt;/p&gt;
&lt;/div&gt;</description><author>mrmohsoft</author><pubDate>Tue, 08 Jan 2013 13:24:07 GMT</pubDate><guid isPermaLink="false">New Post: ArgumentNullException when using Assembly.LoadFrom 20130108012407P</guid></item><item><title>New Post: Are there any plans to release this for System.Web.Razor Version 2.0.0.0</title><link>http://razorengine.codeplex.com/discussions/428452</link><description>&lt;div style="line-height: normal;"&gt;
&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;First of all, thanks for developing and sharing this package.This has helped me a lot in my applications.&lt;/p&gt;
&lt;p&gt;I am consuming this package in one of my MVC 4 application, and hence facing issues as MVC 4 is referencing System.Web.Razor 2.0.0.0, and RazorEngine package is referencing version 1.0.0.0.. this making the live deployment difficult.&lt;/p&gt;
&lt;p&gt;Could you please let us know if there are any plans to release RazorEngine package for S.W.R. V 2.0.0.0?&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;
&lt;p&gt;Nirman&lt;/p&gt;
&lt;/div&gt;</description><author>nirman1983</author><pubDate>Fri, 04 Jan 2013 04:28:09 GMT</pubDate><guid isPermaLink="false">New Post: Are there any plans to release this for System.Web.Razor Version 2.0.0.0 20130104042809A</guid></item><item><title>New Post: foreach with a single item</title><link>http://razorengine.codeplex.com/discussions/406301</link><description>&lt;div style="line-height: normal;"&gt;
&lt;p&gt;When iterating an expando object with a Razor foreach, I receive the &amp;quot;'System.Collections.Generic.KeyValuePair&amp;lt;string,object&amp;gt;'&amp;nbsp;does not contain a definition for ...&amp;quot; error. &amp;nbsp;This only happens when there is a single object in the
 array. &amp;nbsp;As soon as there is more than object in the array, it works.&lt;/p&gt;
&lt;p&gt;Is there a&amp;nbsp;workaround&amp;nbsp;for this?&lt;/p&gt;
&lt;p&gt;Thank you advance.&lt;/p&gt;
&lt;/div&gt;</description><author>myname182</author><pubDate>Mon, 10 Dec 2012 20:38:21 GMT</pubDate><guid isPermaLink="false">New Post: foreach with a single item 20121210083821P</guid></item><item><title>New Post: Usage of BaseTemplateType</title><link>http://razorengine.codeplex.com/discussions/399363</link><description>&lt;div style="line-height: normal;"&gt;
&lt;p&gt;Hello.&lt;/p&gt;
&lt;p&gt;Can you help me?&lt;br&gt;
I have a BaseTemplateType:&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;div style="color:black; background-color:white"&gt;
&lt;pre&gt;&lt;span style="color:blue"&gt;public&lt;/span&gt; &lt;span style="color:blue"&gt;class&lt;/span&gt; MessageTemplateBase&amp;lt;T&amp;gt; : RazorEngine.Templating.TemplateBase&amp;lt;T&amp;gt;
	{
		&lt;span style="color:blue"&gt;protected&lt;/span&gt; &lt;span style="color:blue"&gt;string&lt;/span&gt; Subject { &lt;span style="color:blue"&gt;get&lt;/span&gt;; &lt;span style="color:blue"&gt;set&lt;/span&gt;; }
		&lt;span style="color:blue"&gt;protected&lt;/span&gt; &lt;span style="color:blue"&gt;string&lt;/span&gt; Body { &lt;span style="color:blue"&gt;get&lt;/span&gt;; &lt;span style="color:blue"&gt;set&lt;/span&gt;; }
	}&lt;br&gt;&lt;br&gt; &lt;br&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I can Set this class to razor:&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;div style="color:black; background-color:white"&gt;
&lt;pre&gt;&lt;span style="color:blue"&gt;var&lt;/span&gt; service = &lt;span style="color:blue"&gt;new&lt;/span&gt; TemplateService(&lt;span style="color:blue"&gt;new&lt;/span&gt; TemplateServiceConfiguration
			{
				BaseTemplateType = &lt;span style="color:blue"&gt;typeof&lt;/span&gt;(MessageTemplateBase&amp;lt;&amp;gt;)
			});
&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Also I have model.&lt;/p&gt;
&lt;p&gt;How I can get parsed Subject amd Body &lt;span id="result_box" lang="en"&gt;&lt;span&gt;separately&lt;/span&gt;&lt;/span&gt;?&lt;/p&gt;
&lt;/div&gt;</description><author>Silvochka</author><pubDate>Mon, 15 Oct 2012 09:32:45 GMT</pubDate><guid isPermaLink="false">New Post: Usage of BaseTemplateType 20121015093245A</guid></item><item><title>New Post: strongly typed views?</title><link>http://razorengine.codeplex.com/discussions/397321</link><description>&lt;div style="line-height: normal;"&gt;&lt;p&gt;Thank markchivs! &amp;nbsp;This is exactly what I needed!&lt;/p&gt;&lt;/div&gt;</description><author>peterneorr</author><pubDate>Wed, 03 Oct 2012 14:37:27 GMT</pubDate><guid isPermaLink="false">New Post: strongly typed views? 20121003023727P</guid></item><item><title>New Post: Is there any way to list leftover substitution placeholders?</title><link>http://razorengine.codeplex.com/discussions/397190</link><description>&lt;div style="line-height: normal;"&gt;&lt;p&gt;Hi Evan,&lt;/p&gt;
&lt;p&gt;Post your query on the Github site for RazorEngine:&amp;nbsp;&lt;a href="https://github.com/Antaris/RazorEngine"&gt;https://github.com/Antaris/RazorEngine&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I'm not sure I understand how you're handling your data on the server side, but these guys will know if you post some code it might help.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Mark&amp;nbsp;&lt;/p&gt;&lt;/div&gt;</description><author>markchivs</author><pubDate>Wed, 03 Oct 2012 10:30:29 GMT</pubDate><guid isPermaLink="false">New Post: Is there any way to list leftover substitution placeholders? 20121003103029A</guid></item><item><title>New Post: strongly typed views?</title><link>http://razorengine.codeplex.com/discussions/397321</link><description>&lt;div style="line-height: normal;"&gt;
&lt;p&gt;Hi Peter,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Does this help you?&amp;nbsp;&lt;a href="https://github.com/Antaris/RazorEngine/wiki/Intellisense-and-ReSharper"&gt;https://github.com/Antaris/RazorEngine/wiki/Intellisense-and-ReSharper&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Specifically in the example here a custom Template derives from TemplateBase&amp;lt;T&amp;gt; with a strongly typed model version:&lt;/p&gt;
&lt;pre&gt;@inherits MyCustomizedTemplate&amp;lt;InvoiceModel&amp;gt;&lt;/pre&gt;
&lt;/div&gt;</description><author>markchivs</author><pubDate>Wed, 03 Oct 2012 10:27:51 GMT</pubDate><guid isPermaLink="false">New Post: strongly typed views? 20121003102751A</guid></item><item><title>New Post: Documentation? Reference? Wiki?</title><link>http://razorengine.codeplex.com/discussions/397716</link><description>&lt;div style="line-height: normal;"&gt;&lt;blockquote style="border: solid .1em #ccc; font-style: italic; margin: .25em 1em 0 1em; padding: 0 .25em 0 .25em;"&gt;&lt;strong&gt;zythra wrote:&lt;/strong&gt;&lt;br /&gt;
&lt;p&gt;The project has moved to GitHub (https://github.com/Antaris/RazorEngine).&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Awesome! Thanks a lot. Wasn't clear on here or I totally missed it&lt;/p&gt;
&lt;p&gt;Mark&amp;nbsp;&lt;/p&gt;&lt;/div&gt;</description><author>markchivs</author><pubDate>Wed, 03 Oct 2012 10:23:24 GMT</pubDate><guid isPermaLink="false">New Post: Documentation? Reference? Wiki? 20121003102324A</guid></item><item><title>New Post: Documentation? Reference? Wiki?</title><link>http://razorengine.codeplex.com/discussions/397716</link><description>&lt;div style="line-height: normal;"&gt;&lt;p&gt;The project has moved to GitHub (https://github.com/Antaris/RazorEngine).&lt;/p&gt;&lt;/div&gt;</description><author>zythra</author><pubDate>Tue, 02 Oct 2012 16:29:26 GMT</pubDate><guid isPermaLink="false">New Post: Documentation? Reference? Wiki? 20121002042926P</guid></item><item><title>New Post: Is there any way to list leftover substitution placeholders?</title><link>http://razorengine.codeplex.com/discussions/397190</link><description>&lt;div style="line-height: normal;"&gt;&lt;p&gt;Because I am using dynamic objects populated from JSON for my model. The entire reason I am using the RazorEngine is so that I don't need the MVC and all of it's accompanying overhead in my e-mail processor.&lt;/p&gt;&lt;/div&gt;</description><author>eezewski</author><pubDate>Tue, 02 Oct 2012 15:31:49 GMT</pubDate><guid isPermaLink="false">New Post: Is there any way to list leftover substitution placeholders? 20121002033149P</guid></item><item><title>New Post: Is there any way to list leftover substitution placeholders?</title><link>http://razorengine.codeplex.com/discussions/397190</link><description>&lt;div style="line-height: normal;"&gt;&lt;p&gt;Why not validate your model before injecting it into the template using RazorEngine?&lt;/p&gt;
&lt;p&gt;&lt;a href="http://weblogs.asp.net/scottgu/archive/2010/01/15/asp-net-mvc-2-model-validation.aspx"&gt;http://weblogs.asp.net/scottgu/archive/2010/01/15/asp-net-mvc-2-model-validation.aspx&lt;/a&gt;&lt;/p&gt;&lt;/div&gt;</description><author>markchivs</author><pubDate>Tue, 02 Oct 2012 15:22:34 GMT</pubDate><guid isPermaLink="false">New Post: Is there any way to list leftover substitution placeholders? 20121002032234P</guid></item></channel></rss>