This project is read-only.

Adding CS File to Theme

Topics: Writing themes
Dec 29, 2013 at 12:11 PM
Hi all,

I've created a new theme (MyTheme) using WebMatrix 3. Additionally, I created a C# code file (MyHelper.cs) into my theme's root folder with a test method as:
using System;

namespace MyNamespace
public static class MyHelper
public static int MyMethod()
return 0;
I added the following into my MyTheme.csproj file:
<ItemGroup><Compile Include="MyHelper.cs" /></ItemGroup>
Trying to use this method into a Parts.Blogs.RecentBlogPosts-url-homepage.cshtml file calling
I get the following error message:
The name 'MyNamespace' does not exist in the current context

A more or less same error message is returned when i try the following:
@using MyNamespace;
Am I missing something?

Thanks in advance