logo
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
Nibblez4everybody  
#1 Posted : Thursday, June 16, 2022 3:43:22 PM(UTC)
Nibblez4everybody

Rank: Newbie

Groups: Registered
Joined: 10/5/2021(UTC)
Posts: 9
United States
Location: Bakersfield

I am trying to get a C# console app within visual studio(code) and everything was going fine until I got the following error:

The type or namespace name 'CenterPointDataBrowser' could not be found (are you missing a using directive or an assembly reference?) [my_project_name]

I know is most likely due to the fact that I am not setting up my reference correctly. wondering if someone could help me figure out setting them up correctly within visual studio code or the project.csproj file.


Below is what I have on the .csproj file which is not working:
Code:

<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>net6.0</TargetFramework>
    <ImplicitUsings>enable</ImplicitUsings>
    <Nullable>enable</Nullable>
    <Platforms>x86</Platforms>
  </PropertyGroup>
  <ItemGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86'">
    <Reference Include="CenterPointDataBrowser">
      <HintPath>dlls\CenterPointDataBrowser.dll</HintPath>
    </Reference>
  </ItemGroup>

</Project>


Below is my C# script:
Code:

using System.Data;
using CenterPointDataBrowser;

class currentmonthGL
{
    static void Main(string[] args)

    {
        string databaseName = "TASTE";
        string reportKey = "myreport key";
        string userName = "myusername";
        string password = "mypassword";

        // Initialize the API
        DataAccessAPI api = new DataAccessAPI();

        // Open the database
        api.OpenDatabase(databaseName, userName, password);

        // Retrieve the report
        Report report = api.GetReport(reportKey);

        // Get Data
        DataSet ds = report.GetReportData();

        // Output Data to CSV
        var outputFileName = "C:\\etl\\currentmonthGL.csv";
        api.OutputFile(report, ds, outputFileName);
    }
}


And line 3 on the C# script 'Using CenterPointDataBrowser' is the first line with a the red underline error.
tony  
#2 Posted : Thursday, June 16, 2022 4:13:31 PM(UTC)
tony

Rank: Advanced Member

Groups: Registered
Joined: 2/28/2018(UTC)
Posts: 48
United States
Location: Pennsylvani mostly

Was thanked: 7 time(s) in 7 post(s)
You are targeting .Net 6. You'll need to be in .Net 4.72 or .Net 4.80 to access CenterPointDataBrowser.DLL.
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.