.NET 6 + VSCode 引入Autodesk.Forge包报错求助
解决Autodesk.Forge包安装失败及命名空间找不到的问题
修复步骤
检查NuGet源配置
确认本地NuGet源包含官方NuGet.org,Autodesk.Forge包托管在此源上。在VSCode终端执行命令查看当前源:dotnet nuget list source若未找到nuget.org,执行命令添加:
dotnet nuget add source https://api.nuget.org/v3/index.json -n nuget.org指定版本安装包
直接安装失败时,尝试指定具体版本(可在NuGet平台查询最新稳定版,示例使用1.18.0):dotnet add package Autodesk.Forge --version 1.18.0清理缓存并重新还原
清理本地NuGet缓存后重新还原项目依赖:dotnet nuget locals all --clear dotnet restore验证项目目标框架
确认项目文件(.csproj)中目标框架为.NET 6:<PropertyGroup> <TargetFramework>net6.0</TargetFramework> </PropertyGroup>重新加载项目
包安装完成后,按下Ctrl+Shift+P选择"Reload Window",让VSCode重新识别已安装的包引用。
内容的提问来源于stack exchange,提问作者BPC
相关产品推荐
相关产品推荐

