dotnet / vscode-csharp

Official C# support for Visual Studio Code
MIT License
2.86k stars 670 forks source link

Running sample projects from an external programs C# SDK #4468

Open thecriticalpoint opened 3 years ago

thecriticalpoint commented 3 years ago

Let me preclude everything here by saying that I'm not averse to work, but at the same time I'm so new to omnisharp that I don't even know what I don't know.

When extensions are subject to change it's very hard to find information that applies to the current version. I don't want to spin my wheels trying things from 2018 if they are no longer relevant.

I'm happy to do anything you say, or to accept that what I'm trying to do isn't possible due to some kind of dependency or unsupported feature.

I'm running VSCode 1.55.0

image

and have ms-dotnettools.csharp 1.23.9 installed

image

along with dotnet 5.0.201

image

I'm trying to work with an SDK for a drafting program called DraftSight and have been trying to work with their documentation but am probably missing something so obvious (to the initiated) that it's hardly worth mentioning.

When I load any of the examples I see the following problems image

I located where the Omnisharp Logs are sent in %Appdata%. Here is the most recent log

On the nose it seems like I need to include something... but I don't know where or how.

image

When I read the csharp documentation here I see there are several ways to open a project

image

But I can't seem to find where to put (or find) omnisharp.json so that when I open the samples the namespace is correct. I can't find it in the ms-dotnettools.csharp extensions folder

image

and I don't see one is %userprofile%.omnisharp.

I've seen some forum posts saying that the location of this changed... but once again I don't know where that changed to, or what should even be in it in order to run the samples (that is if it's even possible). It seems like it could either be in the project folder root, in the %userprofile%.omnisharp directory, in the .vscode extensions folder, or even in %appdata% according to some posts. I don't know what's current. It seems like there is a way to set this up in settings.json but some some seem to others based on a host of parameters.

It seems like getting intellisense to work is going to be a completely different issue.

Please don't assume that I know what you know. I'm happy to provide any other details that you need. I'm not entitled to your labor but I sure am grateful for your help.

There seems to be a lot of ways to accomplish some things in vscode. Some people seems to get hung up on what they think is the "proper" way. I don't care so much about what is proper or most efficient for now. Those discussions give me analysis paralysis.

If you have an idea about what ANY way for me to move forward is I would love to hear it.

https://www.strathweb.com/2020/09/support-for-unimported-types-in-omnisharp-and-c-extension-for-vs-code/

Steps to Reproduce

Expected Behavior

Actual Behavior

Logs

OmniSharp log

Here is the most recent log

C# log

These logs in %appdata% are empty

Environment information

VSCode version: 1.55.0 C# Extension: 1.23.9

Dotnet Information .NET SDK (reflecting any global.json): Version: 5.0.201 Commit: a09bd5c86c Runtime Environment: OS Name: Windows OS Version: 10.0.19041 OS Platform: Windows RID: win10-x64 Base Path: C:\Program Files\dotnet\sdk\5.0.201\ Host (useful for support): Version: 5.0.4 Commit: f27d337295 .NET SDKs installed: 5.0.201 [C:\Program Files\dotnet\sdk] .NET runtimes installed: Microsoft.AspNetCore.App 5.0.4 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.NETCore.App 5.0.4 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.WindowsDesktop.App 5.0.4 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] To install additional .NET runtimes or SDKs: https://aka.ms/dotnet-download
Visual Studio Code Extensions |Extension|Author|Version| |---|---|---| |better-comments|aaron-bond|2.1.0| |cpptools|ms-vscode|1.3.0-insiders2| |csharp|ms-dotnettools|1.23.9| |gather|ms-python|2021.4.0| |gitlens|eamodio|11.3.0| |jupyter|ms-toolsai|2021.5.702919634| |namespace|adrianwilczynski|1.1.2| |prettier-vscode|esbenp|6.3.1| |python|ms-python|2021.3.680753044| |python|tht13|0.2.3| |python-coding-conventions|igress|0.0.4| |pythonsnippets|frhtylcn|1.0.2| |remote-containers|ms-vscode-remote|0.166.0| |remote-wsl|ms-vscode-remote|0.54.6| |tos-ts|LethalArts|1.0.0| |vscode-docker|ms-azuretools|1.11.0| |vscodeintellicode|VisualStudioExptTeam|1.2.12|;
JoeRobich commented 3 years ago

@thecriticalpoint Thanks for including so much information. From looking at the DockControl project file, it appears that it is having issues locating two of its dependencies.

    <Reference Include="DraftSight.Interop.dsAddin, Version=8.0.0.2115, Culture=neutral, PublicKeyToken=c96800c7bd580f4e, processorArchitecture=MSIL">
      <SpecificVersion>False</SpecificVersion>
      <HintPath>..\..\..\..\tlb\DraftSight.Interop.dsAddin.dll</HintPath>
    </Reference>
    <Reference Include="DraftSight.Interop.dsAutomation, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
      <SpecificVersion>False</SpecificVersion>
      <HintPath>..\..\..\..\tlb\DraftSight.Interop.dsAutomation.dll</HintPath>
    </Reference>

These two files are included in the SDK within a \tlb folder. The project expects that the \tlb folder will be 4 folders up from the sample project. Most likely you will need to add these two references and update the <HintPath> accordingly.