【发布时间】:2023-03-22 16:59:01
【问题描述】:
我正在尝试在 VS Code 中将 shell32.dll 添加和使用到我的控制台项目中。我把它放到项目的根目录下,..\bin 和 ..\bin\Debug。我做了dotnet restore。我的 .csproj 文件中的代码是:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.1</TargetFramework>
</PropertyGroup>
<ItemGroup>
<Reference Include="Shell32">
<HintPath>shell32.dll</HintPath>
<SpecificVersion>False</SpecificVersion>
</Reference>
</ItemGroup>
</Project>
但是当我将using Shell32; 添加到 Program.cs 时,它会给出错误“找不到类型或命名空间名称‘Shell32’”。请指教我做错了什么?
【问题讨论】:
标签: c# visual-studio-code dll shell32