NikolajW
NikolajW

Reputation: 21

CS0234 Error on runtime, for classes in the same assembly

We have an ASP.NET 4 Web Application Project. This project contains a number of pages. After having made some changes I get an error at runtime (ASP.NET Compile time) that this or that namespace cannot be found.

At design time (in Visual Studio 2010) there is no problem for Intellisense to see these namespaces and classes, which are in the project assembly themselves. And there is no problems at compile time in Visual Studio either.

Upvotes: 1

Views: 760

Answers (2)

Jack Ukleja
Jack Ukleja

Reputation: 13511

This will be a page compilation error. The reason it works fine at design/compile time is because page compilation does not happen then...it happens at runtime.

You need to look into the compilation.assemblies configuration and pages.namespaces, which let you configure the assemblies and namespaces used in the generated code for pages. The other way to ensure assemblies are referenced during page compilation is to mark them as "Copy Local" in your solution.

Upvotes: 0

Flipster
Flipster

Reputation: 4401

Check out the answer I received for a very similar question and see if this does the trick for you (it did for me!):

.Net Extension Method (this string Foo) Only Partially Visible

Upvotes: 1

Related Questions