Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4623020
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T02:55:35+00:00 2026-05-22T02:55:35+00:00

I’m really starting to lose hair here… I’m using the open source Razor engine

  • 0

I’m really starting to lose hair here…

I’m using the open source Razor engine to use Razor templating in my Webforms solution. I have one view (.cshtml) which I compile. Looks like this:

Sample.cshtml

@inherits RazorEngine.Templating.TemplateBase
<h1>hoi</h1>

I receive the following error and have NO clue on where to look… Any leads?

CS0103: The name ‘Context’ does not exist in the current context

Compiler source:

Line 37:         protected ASP.global_asax ApplicationInstance {
Line 38:             get {
Line 39:                 return ((ASP.global_asax)(Context.ApplicationInstance));
Line 40:             }
Line 41:         }

Line 1:    #pragma checksum "D:\local\SitecorePackageTesting\Test5\razor\Sample.cshtml" "{406ea660-64cf-4c82-b6f0-42d48172a799}" "F5A1E4ABBCBE9FEB2C5C3D7DA7B81AC7"
Line 2:    //------------------------------------------------------------------------------
Line 3:    // <auto-generated>
Line 4:    //     This code was generated by a tool.
Line 5:    //     Runtime Version:4.0.30319.225
Line 6:    //
Line 7:    //     Changes to this file may cause incorrect behavior and will be lost if
Line 8:    //     the code is regenerated.
Line 9:    // </auto-generated>
Line 10:   //------------------------------------------------------------------------------
Line 11:   
Line 12:   namespace ASP {
Line 13:       using System;
Line 14:       using System.Collections.Generic;
Line 15:       using System.IO;
Line 16:       using System.Linq;
Line 17:       using System.Net;
Line 18:       using System.Web;
Line 19:       using System.Web.Helpers;
Line 20:       using System.Web.Security;
Line 21:       using System.Web.UI;
Line 22:       using System.Web.WebPages;
Line 23:       using System.Web.Mvc;
Line 24:       using System.Web.Mvc.Ajax;
Line 25:       using System.Web.Mvc.Html;
Line 26:       using System.Web.Routing;
Line 27:       
Line 28:       
Line 29:       public class _Page_razor_Sample_cshtml : RazorEngine.Templating.TemplateBase {
Line 30:           
Line 31:   #line hidden
Line 32:   
Line 33:           
Line 34:           public _Page_razor_Sample_cshtml() {
Line 35:           }
Line 36:           
Line 37:           protected ASP.global_asax ApplicationInstance {
Line 38:               get {
Line 39:                   return ((ASP.global_asax)(Context.ApplicationInstance));
Line 40:               }
Line 41:           }
Line 42:           
Line 43:           public override void Execute() {
Line 44:   
Line 45:   WriteLiteral("<h1>hoi</h1>");
Line 46:   
Line 47:   
Line 48:           }
Line 49:       }
Line 50:   }
Line 51:   

Compiler output:

C:\Windows\SysWOW64\inetsrv> “C:\Windows\Microsoft.NET\Framework\v4.0.30319\csc.exe” /t:library /utf8output /R:”C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Web.ApplicationServices\v4.0_4.0.0.0__31bf3856ad364e35\System.Web.ApplicationServices.dll” /R:”C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\d16e214a\21d2630\assembly\dl3\3c7fdb05\0071c9c6_144bca01\Oracle.DataAccess.DLL” /R:”C:\Windows\Microsoft.Net\assembly\GAC_MSIL\Microsoft.CSharp\v4.0_4.0.0.0__b03f5f7f11d50a3a\Microsoft.CSharp.dll” /R:”C:\Windows\Microsoft.Net\assembly\GAC_32\System.EnterpriseServices\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.EnterpriseServices.dll” /R:”C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.ServiceModel.Activities\v4.0_4.0.0.0__31bf3856ad364e35\System.ServiceModel.Activities.dll” /R:”C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\d16e214a\21d2630\assembly\dl3\f5a0c252\00398325_277fcb01\Newtonsoft.Json.DLL” /R:”C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\d16e214a\21d2630\assembly\dl3\da38f160\00c98b4e_059ecb01\ITHit.WebDAV.Server.DLL” /R:”C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Core\v4.0_4.0.0.0__b77a5c561934e089\System.Core.dll” /R:”C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\d16e214a\21d2630\assembly\dl3\9cecdc75\007560c1_267fcb01\Stimulsoft.Base.DLL” /R:”C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\d16e214a\21d2630\assembly\dl3\8a7d9672\5208376d_9d10cc01\RazorForSitecore.DLL” /R:”C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Web.Services\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Web.Services.dll” /R:”C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Data.Linq\v4.0_4.0.0.0__b77a5c561934e089\System.Data.Linq.dll” /R:”C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\d16e214a\21d2630\assembly\dl3\a806f09a\00c4d72a_20a1cb01\Sitecore.Publishing.WebDeploy.DLL” /R:”C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.ServiceModel\v4.0_4.0.0.0__b77a5c561934e089\System.ServiceModel.dll” /R:”C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\d16e214a\21d2630\assembly\dl3\5cb7410e\00101326_20a1cb01\Sitecore.Client.DLL” /R:”C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\d16e214a\21d2630\assembly\dl3\ffa50f50\001e3a2d_20a1cb01\Sitecore.Zip.DLL” /R:”C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\d16e214a\21d2630\assembly\dl3\28562d1f\006a7528_20a1cb01\sitecore.nexus.DLL” /R:”C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Web.WebPages\v4.0_1.0.0.0__31bf3856ad364e35\System.Web.WebPages.dll” /R:”C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\d16e214a\21d2630\assembly\dl3\dd89a851\0057df41_164bca01\Mvp.Xml.DLL” /R:”C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Web.DynamicData\v4.0_4.0.0.0__31bf3856ad364e35\System.Web.DynamicData.dll” /R:”C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Configuration\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Configuration.dll” /R:”C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\d16e214a\21d2630\assembly\dl3\4c2d1e9c\08f628bf_8710cc01\RazorEngine.DLL” /R:”C:\Windows\Microsoft.Net\assembly\GAC_32\System.Web\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Web.dll” /R:”C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\d16e214a\21d2630\assembly\dl3\071b6ade\00398325_277fcb01\Stimulsoft.Report.Web.DLL” /R:”C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\d16e214a\21d2630\assembly\dl3\93ebae80\00398325_277fcb01\ComponentArt.Web.UI.DLL” /R:”C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Web.Mvc\v4.0_3.0.0.0__31bf3856ad364e35\System.Web.Mvc.dll” /R:”C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.ComponentModel.DataAnnotations\v4.0_4.0.0.0__31bf3856ad364e35\System.ComponentModel.DataAnnotations.dll” /R:”C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Data.DataSetExtensions\v4.0_4.0.0.0__b77a5c561934e089\System.Data.DataSetExtensions.dll” /R:”C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Xml.Linq\v4.0_4.0.0.0__b77a5c561934e089\System.Xml.Linq.dll” /R:”C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Xml\v4.0_4.0.0.0__b77a5c561934e089\System.Xml.dll” /R:”C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Web.Extensions\v4.0_4.0.0.0__31bf3856ad364e35\System.Web.Extensions.dll” /R:”C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\d16e214a\21d2630\assembly\dl3\e04df5ec\d65f8d4c_d30fcc01\CompiledDomainModel.DLL” /R:”C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\d16e214a\21d2630\assembly\dl3\21aafcf9\0057df41_164bca01\RadEditor.Net2.DLL” /R:”C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\d16e214a\21d2630\assembly\dl3\470febb1\00398325_277fcb01\Stimulsoft.Report.WebDesign.DLL” /R:”C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\d16e214a\21d2630\assembly\dl3\cf7e7f0f\00be0505_904eca01\Lucene.Net.DLL” /R:”C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\d16e214a\21d2630\App_Code.gztscyme.dll” /R:”C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.IdentityModel\v4.0_4.0.0.0__b77a5c561934e089\System.IdentityModel.dll” /R:”C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\d16e214a\21d2630\assembly\dl3\531c473b\0035ec2a_154bca01\HtmlAgilityPack.DLL” /R:”C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\d16e214a\21d2630\assembly\dl3\38a9e22a\00aca609_2796cb01\Telerik.Web.UI.DLL” /R:”C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Web.Helpers\v4.0_1.0.0.0__31bf3856ad364e35\System.Web.Helpers.dll” /R:”C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Web.Abstractions\v4.0_4.0.0.0__31bf3856ad364e35\System.Web.Abstractions.dll” /R:”C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Web.Routing\v4.0_4.0.0.0__31bf3856ad364e35\System.Web.Routing.dll” /R:”C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\d16e214a\21d2630\assembly\dl3\33b9b8c0\007560c1_267fcb01\Stimulsoft.Report.DLL” /R:”C:\Windows\Microsoft.NET\Framework\v4.0.30319\mscorlib.dll” /R:”C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\d16e214a\21d2630\assembly\dl3\1b84e797\00f1082c_20a1cb01\Sitecore.Update.DLL” /R:”C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Web.WebPages.Deployment\v4.0_1.0.0.0__31bf3856ad364e35\System.Web.WebPages.Deployment.dll” /R:”C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.WorkflowServices\v4.0_4.0.0.0__31bf3856ad364e35\System.WorkflowServices.dll” /R:”C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.ServiceModel.Web\v4.0_4.0.0.0__31bf3856ad364e35\System.ServiceModel.Web.dll” /R:”C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System\v4.0_4.0.0.0__b77a5c561934e089\System.dll” /R:”C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\d16e214a\21d2630\assembly\dl3\d8d920fa\0057df41_164bca01\RadSpell.Net2.DLL” /R:”C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\d16e214a\21d2630\assembly\dl3\ad9c306b\00101326_20a1cb01\Sitecore.Analytics.DLL” /R:”C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\d16e214a\21d2630\assembly\dl3\1e6a806e\007560c1_267fcb01\Stimulsoft.Database.DLL” /R:”C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Drawing\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Drawing.dll” /R:”C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Runtime.Serialization\v4.0_4.0.0.0__b77a5c561934e089\System.Runtime.Serialization.dll” /R:”C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.ServiceModel.Activation\v4.0_4.0.0.0__31bf3856ad364e35\System.ServiceModel.Activation.dll” /R:”C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Web.WebPages.Razor\v4.0_1.0.0.0__31bf3856ad364e35\System.Web.WebPages.Razor.dll” /R:”C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\d16e214a\21d2630\App_global.asax.epwwf_0j.dll” /R:”C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\d16e214a\21d2630\assembly\dl3\29ec3d62\003d4427_20a1cb01\Sitecore.Kernel.DLL” /R:”C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\d16e214a\21d2630\assembly\dl3\515b39c8\eb89866d_9d10cc01\Test5.DLL” /R:”C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\d16e214a\21d2630\assembly\dl3\5dc738c0\0097a629_20a1cb01\Sitecore.NVelocity.DLL” /R:”C:\Windows\Microsoft.Net\assembly\GAC_32\System.Data\v4.0_4.0.0.0__b77a5c561934e089\System.Data.dll” /R:”C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\d16e214a\21d2630\assembly\dl3\1d85ead0\00c4d72a_20a1cb01\Sitecore.Oracle.DLL” /R:”C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Activities\v4.0_4.0.0.0__31bf3856ad364e35\System.Activities.dll” /R:”C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\d16e214a\21d2630\assembly\dl3\d38bbdbe\006a7528_20a1cb01\Sitecore.Logging.DLL” /out:”C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\d16e214a\21d2630\App_Web_sample.cshtml.24833d72.4mrrqd0w.dll” /D:DEBUG /debug+ /optimize- /w:4 /nowarn:1659;1699;1701 /warnaserror- “C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\d16e214a\21d2630\App_Web_sample.cshtml.24833d72.4mrrqd0w.0.cs” “C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\d16e214a\21d2630\App_Web_sample.cshtml.24833d72.4mrrqd0w.1.cs”

Microsoft (R) Visual C# 2010 Compiler version 4.0.30319.1
Copyright (C) Microsoft Corporation. All rights reserved.

c:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\d16e214a\21d2630\App_Web_sample.cshtml.24833d72.4mrrqd0w.0.cs(39,43): error CS0103: The name ‘Context’ does not exist in the current context

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T02:55:35+00:00Added an answer on May 22, 2026 at 2:55 am

    The problem was related to the Webforms based CMS i use. It tried to load the Razor file as Usercontrol which obviously isn’t possible…

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I am trying to understand how to use SyndicationItem to display feed which is
I am reading a book about Javascript and jQuery and using one of the
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I want use html5's new tag to play a wav file (currently only supported
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
We're building an app, our first using Rails 3, and we're having to build
We are using XSLT to translate a RIXML file to XML. Our RIXML contains

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.