This project is read-only.

Unknown Server tag

Dec 25, 2010 at 4:16 PM

I'm in the process of trying to migrate to a website under the root rather than a subdomain. When I try to add elements such as <blog:searchonsearch> it will not appear in the intellisense and it throws a "unknown server tag" error. I've added <%@ Import Namespace="BlogEngine.Core" %> as well as tried <%@ Import Namespace="BlogEngine.Core.Controls" %> with no luck, I've also tried adding the imports statements in the code behind. I have included the blogengine.core.dll. I'm not sure what else to try to and admittedly I'm not an expert at this. What I'm looking for is the blog components to appear in the intellisense as they do in the pages now, I just can't seem to find the difference that's causing it to work in one and not the other. I've googled like crazy and can't seem to find a solution, any help would be appreciated.

Dec 25, 2010 at 7:55 PM

If you're using BE 1.6 or earlier, in the web.config file, make sure you have the tag prefix of "blog" registered in the pages/controls section.  You'll see it there included in the web.config file that comes with BE.

<pages .......>
		<add namespace="Controls" tagPrefix="blog"/>
If you're using BE 2.0 (release candidate), then the namespace above would be "App_Code.Controls" instead of "Controls".

Dec 25, 2010 at 11:12 PM

Yep that's there, it's the new release that I'm using. If I start with a blank project and copy all the files over it works fine. If I start with a blank project and copy all but the site.master and themes folder it doesn't work. I'm thinking there is additional code in the site.master that I'm not seeing or able to see that may be calling this, maybe in a designer file. Does that sound reasonable? If so how would I view it? I'm at a loss and unfortunately am not grasping the complexity of some of the code, doesn't help that I don't do C# either. 

Dec 26, 2010 at 5:02 AM

There are no designer files.  For the specific error about <blog:searchonsearch> being an unknown server tag, one thing to make sure is that SearchOnSearch.cs exists in the App_Code\Controls folder.

A second thing is that all these files work in a Web Site project.  If you try to convert BE into a Web Application project (WAP), it's possible this type of problem could occur.  You mentioned "designer" files.  Web Site projects don't have designer files ... WAP projects do have them.

It's also possible that VS may initially report that <blog:searchonsearch> is an "unknown server tag", but you might want to try building or running it (F5), and then VS will hopefully start detecting SearchOnSearch.

Files in the App_Code folder, like SearchOnSearch, are compiled at runtime.  They are then available to be used.  I may have seen a circumstance where until the project gets built once, files in the App_Code directory are not recognized.

When you say that you're starting a "blank project" ... what type of project is that?  A Web Site project or Web Application project?

Dec 26, 2010 at 9:02 PM

I was trying to set it up as a WAP. It's easier for me to work with in this format. I'll check on the items you mentioned, for now I'll copy all the files over and work with it in that format. Thanks for your help.