简体   繁体   中英

How to solve this error?

How to solve the following error?

CS0234: The type or namespace name 'Helpers' does not exist in the namespace 'NerdDinner' (are you missing an assembly reference?)

If the error is occurring within a class:

Add using Nerddiners.Helpers; to the using statements in your class.

As a short cut, you can place your cursor on the relevant part of your code and press Ctrl + . and Visual Studio will add it for you.

If the error is occurring within a view:

Add the following to the top of your view (under the inherits definition)

<%@ Import Namespace="NerdDinner.Helpers" %>

or you can add it to the namespaces section of your projects web.config

<namespaces>
...
<add namespace="NerdDinner.Helpers" />

If the error is occurring within a test class you will need to add a project reference to your main NerdDinners project within the add references option of your test project.

给出的信息不多,但msdn的考试计划

Right click on your project in visual studio and click "add reference". Then find the assembly that contains your helpers and add it in.

Failing that you have a programming error

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM