Philky001
Philky001

Reputation: 61

C# program fail bec. missing using directive or an assembly reference

the last 2 lines here are causing compiler error that 'are you missing a using directive or an assembly reference' where must I add this?

  using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Text;
  using OPTFDashboard.DataModel;
  using System.IO;
  using OPTFDashboard.Common.Modules.FailedTransmissions.DataModels;

      using NHapi.Base.Parser;
      using NHapi.Base.Model;

Upvotes: 0

Views: 619

Answers (5)

Tigran
Tigran

Reputation: 62256

Guess. Probbably you missed a reference to assembly NHapi.

How to add references in VS2010

Upvotes: 1

itsme86
itsme86

Reputation: 19496

You need to add whatever DLL has those namespaces to your project. In the solution explorer, right-click References and choose Add Reference.

Upvotes: 1

user596075
user596075

Reputation:

You need to add these namespaces as project references (the DLLs). Just because you state them in your using statement, doesn't mean they are automatically imported in. You can import them through your object explorer (References).

Once you have them referenced in your project, you will be able to utilize the namespace members.

Upvotes: 1

Reddog
Reddog

Reputation: 15579

You need to add a reference to the assemblies that contained those namespaces. Here's a helpful link on adding references in Visual Studio.

Upvotes: 2

Brad
Brad

Reputation: 1529

In project explorer, find the project, find reference folder, and right click -> add reference. select the assembly and click ok.

Upvotes: 1

Related Questions