You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

.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

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.02 03:55:15