Click here to Skip to main content
15,610,588 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

Compiler Error Message: CS0246: The type or namespace name 'Lead' could not be found (are you missing a using directive or an assembly reference?)

Source Error:
public string BuildEmail(string EmailType, Lead lead, FollowUp followup)
StringBuilder email = new StringBuilder();

Getting the above error when deploying my app in iis. Works fine locally. Can anyone help?

Lead is a type that definitely exist. I have read some things about possibly framework version issues but not sure where to begin.
Updated 7-Jun-12 7:47am

1 solution

Can you verify which cs file has the class Lead in it?

If so, check the namespace of that class and include a "using" with that namespace at the top of the page accessing it.

If it is a web application project, make sure you "build" your application and move the files within the bin directory to the production server.
Share this answer
sjones_30 7-Jun-12 14:26pm    
namespace Entities
public class Lead

I have my using Entities; statement at the top of the page. I have moved the bin directory to the prodcution server as well.
thoiness 7-Jun-12 15:47pm    
There should be an Entities.somealphanumeric.dll (depending on how you are compiling) that contains that class. If the using was at the top of the page and the app was compiled before moving the bin directory, then I'd be out of ideas at this point.
sjones_30 7-Jun-12 15:51pm    
Same here. I exhausted all I could think of.
thoiness 7-Jun-12 15:53pm    
Ah... One more thing I can think of. Was this a dll that was included externally? If so, did you include it in the references section of your application by browsing to the dll and adding it?

That's definitely the last idea I have.
thoiness 7-Jun-12 16:05pm    
Or... Maybe the assumptions I am making that this is a code issue are wrong.

In IIS, is this site in the root of the web, or is it in a sub-directory of a root web? If it's in a sub-directory, have you double checked to ensure that the sub-directory has been converted into an application? I ask, because obviously, if it's in a sub-directory, and not an application, it would be searching the root /bin directory for your dlls.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900