1

I guess I have been using the Web Site model ever since .NET 2.0 and never looked back. Now I'm using the Web Application mode on a few projects. How do you tell the compiler to compile .cs files in the project? I assume you can do this since the newer-MVC projects do it for the Controllers.

I have a class, RestRouteHandler, that implements the IRouteHandler interface but because I think the .cs file is not being compiled I can't use it in my Global.asax.

2 Answers 2

4

Right-click the .cs file in the Solution Explorer and click Properties. Set the "Build Action" to compile.

Sign up to request clarification or add additional context in comments.

2 Comments

That's the ticket. Ran into this other day and couldn't remember that's how I fixed it. Thanks. +1 and answer.
No problem. I ran into this a few times as well after I converted some projects to Web Applications.
0

use the "Build" menu in Visual Studio

3 Comments

I do. Then I get this message: The type or namespace name 'RestRouteHandler' could not be found (are you missing a using directive or an assembly reference?)
The other weird thing... Is when I add a .cs file to my project. It comes in completely blank. No code. weird.
are you missing a reference or using statement in your code? If your templates are empty it may be worth it to try reinstalling VS.NET and all of the Service Packs.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.