2013-08-15 38 views
5

Khi tôi triển khai (sử dụng triển khai web) dự án asp.net Web API của tôi, tôi nhận được lỗi sau (xem stack trace dưới đây)Magick.NET-x64 là ném một ngoại lệ "dll không tìm thấy" khi triển khai

Server Error in '/images.mysite.com' Application. 

Could not load file or assembly 'Magick.NET-x64.DLL' or one of its dependencies. The specified module could not be found. 

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.IO.FileNotFoundException: Could not load file or assembly 'Magick.NET-x64.DLL' or one of its dependencies. The specified module could not be found. 

Source Error: 

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. 

Stack Trace: 


[FileNotFoundException: Could not load file or assembly 'Magick.NET-x64.DLL' or one of its dependencies. The specified module could not be found.] 
    System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +0 
    System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +210 
    System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean forIntrospection) +242 
    System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +17 
    System.Reflection.Assembly.Load(String assemblyString) +35 
    System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +122 

[ConfigurationErrorsException: Could not load file or assembly 'Magick.NET-x64.DLL' or one of its dependencies. The specified module could not be found.] 
    System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +12762790 
    System.Web.Configuration.CompilationSection.LoadAllAssembliesFromAppDomainBinDirectory() +503 
    System.Web.Configuration.AssemblyInfo.get_AssemblyInternal() +142 
    System.Web.Compilation.BuildManager.GetReferencedAssemblies(CompilationSection compConfig) +334 
    System.Web.Compilation.BuildManager.CallPreStartInitMethods(String preStartInitListPath) +203 
    System.Web.Compilation.BuildManager.ExecutePreAppStart() +152 
    System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters, PolicyLevel policyLevel, Exception appDomainCreationException) +1151 

[HttpException (0x80004005): Could not load file or assembly 'Magick.NET-x64.DLL' or one of its dependencies. The specified module could not be found.] 
    System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +12883252 
    System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +159 
    System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +12724313 

Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.17929 

máy chủ của tôi là windows server 2008 R2 chuẩn

Chạy IIS: windows máy chủ tiêu chuẩn r2 2008

tính chất dự án của tôi là:

  • Cấu hình: Active (Debug)

  • Hệ điều hành: Active (x64) mục tiêu

  • Hệ điều hành: x64

  • mức cảnh báo: 4

  • đầu ra pasth: bin \

  • coi cảnh báo là lỗi: none

  • tạo lắp ráp seriealization: auto

Trên một mặt lưu ý, khi tôi DO bố ông dự án tôi đã nhận thấy rằng “ImageMagick (Magick.NET-x64)” không hiển thị trong gói manifest. Lạ? Cái quái gì thế?

<?xml version="1.0" encoding="utf-8"?> 
<packages> 
    <package id="EntityFramework" version="5.0.0" targetFramework="net45" /> 
    <package id="EtsTraceLogger" version="1.0.0" targetFramework="net45" /> 
    <package id="Microsoft.AspNet.Mvc" version="4.0.20710.0" targetFramework="net45" /> 
    <package id="Microsoft.AspNet.Razor" version="2.0.20710.0" targetFramework="net45" /> 
    <package id="Microsoft.AspNet.Web.Optimization" version="1.0.0" targetFramework="net45" /> 
    <package id="Microsoft.AspNet.WebApi" version="4.0.20710.0" targetFramework="net45" /> 
    <package id="Microsoft.AspNet.WebApi.Client" version="4.0.20710.0" targetFramework="net45" /> 
    <package id="Microsoft.AspNet.WebApi.Core" version="4.0.30506.0" targetFramework="net45" /> 
    <package id="Microsoft.AspNet.WebApi.OData" version="4.0.30506" targetFramework="net45" /> 
    <package id="Microsoft.AspNet.WebApi.WebHost" version="4.0.20710.0" targetFramework="net45" /> 
    <package id="Microsoft.AspNet.WebPages" version="2.0.20710.0" targetFramework="net45" /> 
    <package id="Microsoft.Data.Edm" version="5.2.0" targetFramework="net45" /> 
    <package id="Microsoft.Data.OData" version="5.2.0" targetFramework="net45" /> 
    <package id="Microsoft.Net.Http" version="2.0.20710.0" targetFramework="net45" /> 
    <package id="Microsoft.Web.Infrastructure" version="1.0.0.0" targetFramework="net45" /> 
    <package id="Newtonsoft.Json" version="4.5.6" targetFramework="net45" /> 
    <package id="System.Spatial" version="5.2.0" targetFramework="net45" /> 
    <package id="WebGrease" version="1.1.0" targetFramework="net45" /> 
</packages> 

Bất kỳ trợ giúp nào khi triển khai ứng dụng dựa trên Magick.NET-x64 sẽ được đánh giá cao.

+0

Cần thêm thông tin): – Erik5388

+0

Vì vậy, các chi tiết cụ thể của lỗi khi bạn đặt lỗi tùy chỉnh thành "tắt" là gì? –

Trả lời

8

Oh ...

tôi cố định này bằng cách cài đặt sau,

http://www.microsoft.com/en-us/download/details.aspx?id=30679

Hy vọng rằng sẽ giúp!

+0

Cài đặt nó trên máy chủ - thường là env dev không cần cài đặt vì bạn đã sử dụng Visual Studio, nhưng máy chủ không có các thư viện cần thiết này và ném ngoại lệ tối nghĩa này. –

1

Magick.NET Needs VC 2012 Thời gian chạy cần cài đặt. (Visual C++ Redistributable cho Visual Studio 2012)

Ngoài ra khi Visual C++ Redistributable cho Visual Studio 2012 được cài đặt trên máy chủ, nó yêu cầu khởi động lại.