Question: I have big trouble deploying my webservice. It is the basic helloWorld start webservice.

At my localhost everything os ok. But when I copy the service to my server in my virtual directory i recieve this error:

> 
> Server Error in '/' Application.
> 
> 
> Parser Error Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.
> 
> 
> Parser Error Message: Could not create type 'Service'.
> 
> 
> Source Error: Line 1: <%@ WebService Language="vb" CodeBehind="~/App\_Code/Service.vb" Class="Service" %>
> 
> 
> Source File: /customers/iv\_webservice/Service.asmx Line: 1
> Version Information: Microsoft .NET Framework Version:2.0.50727.4952; ASP.NET Version:2.0.50727.4955
> 
> 
> 

Now I have tried almost everything. Including scanning the web for the past 9 hours for an answer.

I know my virtual directory in the web.config is ok, since I have other virtual websites on my server. I even manage to have aspx. files in the same directory and they are ok.

Now, what am I missing?

Answer: 
I created a helper method for ASP.NET MVC 3 that works like this, inspired by Html.BeginForm:

within the view:

```
@using (Html.BeginHtmlTemplate("templateId"))
{
    <div>enter template here</div>
}

```

Anything within the @using scope will be syntax highlighted.

The code for the helper:

```
public static class HtmlHelperExtensions
{
    public static ScriptTag BeginHtmlTemplate(this HtmlHelper helper,string id)
    {
        return new ScriptTag(helper,"text/html", id);
    }
}

public class ScriptTag : IDisposable
{
    private readonly TextWriter writer;

    private readonly TagBuilder builder;

    public ScriptTag(HtmlHelper helper, string type, string id)
    {
        this.writer = helper.ViewContext.Writer;
        this.builder = new TagBuilder("script");
        this.builder.MergeAttribute("type", type);
        this.builder.MergeAttribute("id", id);
        writer.WriteLine(this.builder.ToString(TagRenderMode.StartTag));
    }

    public void Dispose()
    {
        writer.WriteLine(this.builder.ToString(TagRenderMode.EndTag));
    }
}

```
If you're using MVC you can make an extension method for the HtmlHelper like this:

```
public static class HtmlExtensions
{
     public static MvcHtmlString Template(this HtmlHelper htmlHelper, string id, Func<dynamic, HelperResult> content)
     {
         var sb = new StringBuilder();
         sb.AppendFormat("<script type='text/html' id='{0}'>", id);
         sb.Append(content(null));
         sb.Append("</script>");

         return new MvcHtmlString(sb.ToString());
     }
}

```

Use like 

```
@Html.Template("whatever", @<text>
    <tr><td>template stuff here</td></tr>
</text>)

```

You'll get full syntax coloring and intellisense that way. (though, VS might warn about invalid nesting of html elements depending on what your templates consist of)