Dotnet Core library issue

I am totally new to dotnet core.
I generated a new Folder on my drive, after this I executed this command:
Donet new classlib -o DLL-Test
after this I went to the Project Folder and changed the class1.cs file like this:

using System;

namespace dll_test
    public class Class1
        public static string NewString(){
            return "Newstring";

after this I added the powershell lib like this:
dotnet add package PowerShellStandard.Library --version 5.1.0-preview-02

finally i build the dll, which is now showing up:
dotnet build

and now I try to Import this via powershell by add-type and specify the source of the file.
BUT I get an error which is complaining about: At least one type in the assembly could not be loaded.

Did you had this strange issue before OR you can see directly what i am doing wrong?


Unfortunately, this isn’t a .NET forum - you might have better luck getting a good answer someplace like StackOverflow. This website is dedicated to PowerShell.

Works for me.

$env:path += ';C:\Windows\Microsoft.NET\Framework64\v4.0.30319'
csc /t:library class1.cs

add-type -path '.\class1.dll'