Error “Type or namespace name could not be found” during build process

I am using a C # Windows application, I have

TempProWin → For Windows Application Applications
TempProApp -> For a database and functions such as a class file using the CSLA method.

In TempProWin.frmLogin.cs:

using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using TempProApp; private void frmLogin_Load(object sender, EventArgs e) { UserLoginList oUserLoginList = UserLoginList.GetUserLoginList(); cmbUserName.DataSource = oUserLoginList; cmbUserName.DisplayMember = "Select User"; } 

But when I create this application, I got the following error:

Error 5: Could not find the name of the type or namespace TempProApp (do you miss the using directive or assembly references?)

I already include the TempProApp.dll link from the path D: \ TempPro \ TempProApp \ bin \ Debug

+8
c # winforms 3-tier
source share
5 answers

RightClick on TempProApp and go to the definition.

At the top of the screen you will see the dll name and its version. You can check if you are using the same dll version or not.

+3
source share

A false "Type or namespace name cannot be found. A build error may occur if you have others warnings.

I would partially encode an asynchronous HTTP method that generated warnings about no expectations. I planned to get the rest of the system and then fix it.

But I started to get a difficult mistake. I spent the last three hours trying to isolate his case. I tried all the proposed fixes, four verified names, etc., and even deleted and recreated the project that caused the complaints. Without changes. It seemed strange to me that when I clicked Go To Definition on the violation link, VS 2012 could find it without any problems. WTF *

As a last resort, I commented on the code that issued the warnings. This fixed false error messages and the build was successful.

So, if you ruled out other reasons and you have other warnings about creating try to fix them.

+3
source share

Make sure that you specify the namespace you want to include correctly. A .dll link must also be created successfully.

One way to be sure of both of the above is to include the project that you want to use in your work project. This will also ensure that in every assembly of your working project, the link to PROJECT is also rebuilt, so any changes made will affect

 On Solution Explorer->Right Click-> Add existing Project-> Select the Project you would initially Reference On References->Add new Reference-> Select Projects Tab-> Select the Project you added 
0
source share

If the namespace you use does not provide public methods, it can also cause this error. Make sure the namespace you are using contains public methods in the public class.

0
source share

I encountered the same error when connecting Gamecenter Achievements, after which I realized that I missed the class name.

 using UnityEngine.SocialPlatforms; using UnityEngine.SocialPlatforms.GameCenter; 

perhaps you also lack 1 class name.

-2
source share

All Articles