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

部署网站至服务器时Microsoft.SqlServer.SqlEnum程序集加载失败求助

Fix for "Could not load file or assembly 'Microsoft.SqlServer.SqlEnum, Version=10.0.0.0'" Error

Hey Neda, I’ve run into this exact assembly loading issue multiple times when deploying .NET apps that interact with SQL Server tools. Let’s walk through the most effective fixes to get your site up and running on the server:

The Microsoft.SqlServer.SqlEnum.dll (version 10.0.0.0) is part of the SQL Server Management Objects (SMO) components included in the SQL Server 2008 Feature Pack. Here’s what to do:

  • On your server, download the Microsoft SQL Server 2008 Management Objects package (make sure to pick the correct architecture: x86/x64 matching your server).
  • Run the installer—this will automatically register the required DLL in the Global Assembly Cache (GAC), which is where .NET looks for shared assemblies.

2. Manually Copy the DLL to Your Website’s Bin Directory

If installing server-wide components isn’t an option (e.g., you’re on a shared hosting plan), you can copy the DLL directly from your local machine to the server:

  • On your local PC, navigate to C:\Program Files\Microsoft SQL Server\100\SDK\Assemblies (or C:\Program Files (x86)\... if you’re on a 64-bit system running 32-bit tools).
  • Locate Microsoft.SqlServer.SqlEnum.dll and copy it to the bin folder of your deployed website on the server.
  • Pro tip: In your local Visual Studio project, find the reference to Microsoft.SqlServer.SqlEnum, right-click it, go to Properties, and set Copy Local to True. This way, the DLL will automatically be included when you publish your site next time.

3. Verify Assembly Version and References

Double-check that your local project’s reference matches the version the server is looking for:

  • In Visual Studio, expand the References folder, right-click Microsoft.SqlServer.SqlEnum, and select Properties.
  • Confirm the Version is set to 10.0.0.0. If you’re referencing a newer version locally, the server won’t find it unless you install the corresponding Feature Pack version.

4. Check the Server’s Global Assembly Cache (GAC)

To confirm if the DLL is already registered on the server:

  • Open Command Prompt as Administrator on the server.
  • Run the command: gacutil -l Microsoft.SqlServer.SqlEnum
  • If no results for version 10.0.0.0 show up, you’ll need to either install the Feature Pack or manually register the DLL using gacutil -i "path\to\Microsoft.SqlServer.SqlEnum.dll".

One last thing: Make sure the server’s architecture (x86 vs x64) matches the version of the DLL you’re using—mismatches can also cause "file not found" errors even if the DLL is present.

内容的提问来源于stack exchange,提问作者user3177758

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.05.08 12:17:42