Skip to content

[MCP Server]: Unhandled exception. System.DllNotFoundException: Dll was not found. #14677

@Demonese

Description

@Demonese

Issue Type

Bug

MCP Server Package Version

1.1.12

.NET Version

10.0.100

Environment

  • Visual Studio
  • VS Code
  • GitHub Copilot Coding Agent
  • CLI
  • Other (please specify below)

If "Other", please specify

Cherry Studio

Prompt or Input

N/A

Expected Response

N/A

Actual Response

Unhandled exception. System.DllNotFoundException: Dll was not found.
   at Microsoft.Build.Locator.NativeMethods.hostfxr_resolve_sdk2(String exe_dir, String working_dir, hostfxr_resolve_sdk2_flags_t flags, hostfxr_resolve_sdk2_result_fn result)
   at Microsoft.Build.Locator.DotNetSdkLocationHelper.GetSdkFromGlobalSettings(String workingDirectory)
   at Microsoft.Build.Locator.DotNetSdkLocationHelper.GetDotNetBasePaths(String workingDirectory)+MoveNext()
   at Microsoft.Build.Locator.DotNetSdkLocationHelper.GetInstances(String workingDirectory, Boolean allowQueryAllRuntimes)+MoveNext()
   at Microsoft.Build.Locator.MSBuildLocator.GetInstances(VisualStudioInstanceQueryOptions options)+MoveNext()
   at System.Linq.Enumerable.TryGetFirstNonIterator[TSource](IEnumerable`1 source, Boolean& found)
   at System.Linq.Enumerable.FirstOrDefault[TSource](IEnumerable`1 source)
   at Microsoft.Build.Locator.MSBuildLocator.RegisterDefaults()
   at NuGet.Mcp.Server.Program.Main(String[] args) in /_/src/NuGet.Mcp.Server/Program.cs:line 27
   at NuGet.Mcp.Server.Program.<Main>(String[] args)

Additional Context or Description

What are the environmental requirements for the MCP service? Have I missed anything?

Image
Application: NuGet.Mcp.Server.exe
CoreCLR Version: 10.0.25.45207
.NET Version: 10.0.0-rc.1.25451.107
Description: The process was terminated due to an unhandled exception.
Exception Info: System.DllNotFoundException: Dll was not found.
   at Microsoft.Build.Locator.NativeMethods.hostfxr_resolve_sdk2(String exe_dir, String working_dir, hostfxr_resolve_sdk2_flags_t flags, hostfxr_resolve_sdk2_result_fn result)
   at Microsoft.Build.Locator.DotNetSdkLocationHelper.GetSdkFromGlobalSettings(String workingDirectory)
   at Microsoft.Build.Locator.DotNetSdkLocationHelper.GetDotNetBasePaths(String workingDirectory)+MoveNext()
   at Microsoft.Build.Locator.DotNetSdkLocationHelper.GetInstances(String workingDirectory, Boolean allowQueryAllRuntimes)+MoveNext()
   at Microsoft.Build.Locator.MSBuildLocator.GetInstances(VisualStudioInstanceQueryOptions options)+MoveNext()
   at System.Linq.Enumerable.TryGetFirstNonIterator[TSource](IEnumerable`1 source, Boolean& found)
   at System.Linq.Enumerable.FirstOrDefault[TSource](IEnumerable`1 source)
   at Microsoft.Build.Locator.MSBuildLocator.RegisterDefaults()
   at NuGet.Mcp.Server.Program.Main(String[] args) in /_/src/NuGet.Mcp.Server/Program.cs:line 27
   at NuGet.Mcp.Server.Program.<Main>(String[] args)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions