I have a few issues with the tutorial and I think I have them due to lack of experience with Visual Studio 2022 (I usually use VS Code). I hope you might find the time to help me in clarifying these issues.
1: Adding a reference to the Console project: It is only possible to add one of there: .exe, .dll, .tlb, .olb, .ocx or .winmd. It seems you reference a csproj file. What am I doing wrong here?
2: Browsing for the dll in the debug or release folders brings nothing before the ClassLib project has been build. This is kind of related to 1. If I’m supposed to reference the csproj file, that makes perfect sense, but after building and referencing the dll, I get a different reference in my csproj file the the one in the guide.
3: Building the ClassLib project and referencing the dll, makes the following line from the console application code point to a file that does not exist: powerShell.AddCommand(“Import-Module”).AddParameter(“Name”, Path.Combine(Environment.CurrentDirectory, “ClassLibrary1.dll”)); I suppose the csproj file should do some kind of magic when building the project and place the dll files in the same directory, but that does not seem to happen. Adding the include reference for the ClassLibrary1cs.proj file in the Console project does not seem to be enough to build a folder with both dlls. What am I missing here?
The target process exited without raising a CoreCLR started event. Ensure that the target process is configured to use .NET Core. This may be expected if the target process did not run on .NET Core.
The program '[26872] ConsoleApp1.exe' has exited with code 3221225794 (0xc0000142) 'DLL Initialization Failed'.
The program '[26872] ConsoleApp1.exe: Program Trace' has exited with code 0 (0x0).