douglasg14b / BetterConsoleTables

Faster, colorable, more configurable, and more robust console colors & tables for C# console applications
GNU Lesser General Public License v3.0
92 stars 16 forks source link

Cant find ns for Column #30

Closed atari-monk closed 2 years ago

atari-monk commented 2 years ago

I added nuget and try to use Column type Cant find ns Shame, i wanted to use this lib

douglasg14b commented 2 years ago

Please provide additional information, such as the full error message, a code example that generates it...etc

It's not possible to help you otherwise.

atari-monk commented 2 years ago

Yes, hello better-console-tables-wrapper.zip I atached repo. I want to wrapp lib to learn to use it, and produce some standard way of it. I add test app. Here is proj file

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

    <ItemGroup>
        <ProjectReference Include="..\Better.Console.Tables.Wrapper\Better.Console.Tables.Wrapper.csproj" />
    </ItemGroup>

    <PropertyGroup>
        <OutputType>Exe</OutputType>
        <TargetFramework>net6.0</TargetFramework>
        <ImplicitUsings>enable</ImplicitUsings>
        <Nullable>enable</Nullable>
    </PropertyGroup>

    <ItemGroup>
        <PackageReference Include="BetterConsoleTables" Version="1.1.3" />
    </ItemGroup>

</Project>

I copy first method from ur example

using BetterConsoleTables;
using AConsole = System.Console;

namespace Better.Console.Tables.TestApp;

internal class Program
{
    private static void Main(string[] args)
    {
        NoRows();
        AConsole.WriteLine("Complete");
        AConsole.ReadLine();
    }

    private static void NoRows()
    {
        Column[] headers = new[]
        {
            new Column("Left"),
            new Column("Left Header"),
            new Column("Right Header"),
        };

        var table = new Table(headers);
        table.Config = TableConfig.Unicode();

        var ret = table.ToString();

        AConsole.Write(ret);
    }
}

This is my problem The type or namespace name 'Column' could not be found (are you missing a using directive or an assembly reference?

Now there was some warrning that nuget is not stamped by nuget,org or whatever, but after admin mode it was gone when installing it.

I checked from ur repo for this namespace. It is there. There was problem with compiling ur repo till i comented some preformance testing class. I dont know what is the problem

douglasg14b commented 2 years ago

The problem is you have version 1 installed from nuget, and are trying to use the v2 api. Types are not found because they don't exist, that's not a problem with this lib.

The readme for this repo has examples of how to use v1 of this library, please use those if you are using v1. If you want to use v2, you will need to install the beta nuget package.

atari-monk commented 2 years ago

Thank you for information. I will try to use it when i go back to this task.