2012-06-27 36 views
12

chào này tập tin cấu hình của tôiKhông thể tải tập tin hoặc lắp ráp 'System.Web.Providers"

<?xml version="1.0"?> 
<configuration> 
    <configSections> 
    <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=4.4.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false"/> 
    <sectionGroup name="elmah"> 
     <section name="security" requirePermission="false" type="Elmah.SecuritySectionHandler, Elmah"/> 
     <section name="errorLog" requirePermission="false" type="Elmah.ErrorLogSectionHandler, Elmah"/> 
     <section name="errorMail" requirePermission="false" type="Elmah.ErrorMailSectionHandler, Elmah"/> 
     <section name="errorFilter" requirePermission="false" type="Elmah.ErrorFilterSectionHandler, Elmah"/> 
    </sectionGroup> 
    </configSections> 
    <connectionStrings> 
    <add name="DefaultConnection" connectionString="Data Source=.\SQLEXPRESS;Initial Catalog=aspnet-MedicallexiconProject-2012615153521;Integrated Security=True" providerName="System.Data.SqlClient"/> 
    </connectionStrings> 
    <appSettings> 
    <add key="webpages:Version" value="2.0.0.0"/> 
    <add key="webpages:Enabled" value="true"/> 
    <add key="PreserveLoginUrl" value="true"/> 
    <add key="ClientValidationEnabled" value="true"/> 
    <add key="UnobtrusiveJavaScriptEnabled" value="true"/> 
    </appSettings> 
    <system.web> 
    <compilation targetFramework="4.0" debug="true"/> 
    <authentication mode="Forms"> 
     <forms loginUrl="~/Account/Login" timeout="2880"/> 
    </authentication> 
    <pages> 
     <namespaces> 
     <add namespace="System.Web.Helpers"/> 
     <add namespace="System.Web.Mvc"/> 
     <add namespace="System.Web.Mvc.Ajax"/> 
     <add namespace="System.Web.Mvc.Html"/> 
     <add namespace="System.Web.Routing"/> 
     <add namespace="System.Web.WebPages"/> 
     </namespaces> 
    </pages> 
    <profile defaultProvider="DefaultProfileProvider"> 
     <providers> 
     <add name="DefaultProfileProvider" type="System.Web.Providers.DefaultProfileProvider, System.Web.Providers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" connectionStringName="DefaultConnection" applicationName="/"/> 
     </providers> 
    </profile> 
    <membership defaultProvider="DefaultMembershipProvider"> 
     <providers> 
     <add name="DefaultMembershipProvider" type="System.Web.Providers.DefaultMembershipProvider, System.Web.Providers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" connectionStringName="DefaultConnection" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" requiresUniqueEmail="false" maxInvalidPasswordAttempts="5" minRequiredPasswordLength="6" minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10" applicationName="/"/> 
     </providers> 
    </membership> 
    <roleManager defaultProvider="DefaultRoleProvider"> 
     <providers> 
     <add name="DefaultRoleProvider" type="System.Web.Providers.DefaultRoleProvider, System.Web.Providers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" connectionStringName="DefaultConnection" applicationName="/"/> 
     </providers> 
    </roleManager> 
    <sessionState mode="InProc" customProvider="DefaultSessionProvider"> 
     <providers> 
     <add name="DefaultSessionProvider" type="System.Web.Providers.DefaultSessionStateProvider, System.Web.Providers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" connectionStringName="DefaultConnection" applicationName="/"/> 
     </providers> 
    </sessionState> 
    <httpModules> 
     <add name="ErrorLog" type="Elmah.ErrorLogModule, Elmah"/> 
     <add name="ErrorMail" type="Elmah.ErrorMailModule, Elmah"/> 
     <add name="ErrorFilter" type="Elmah.ErrorFilterModule, Elmah"/> 
    </httpModules> 
    </system.web> 
    <system.webServer> 
    <validation validateIntegratedModeConfiguration="false"/> 
    <modules runAllManagedModulesForAllRequests="true"> 
     <add name="ErrorLog" type="Elmah.ErrorLogModule, Elmah" preCondition="managedHandler"/> 
     <add name="ErrorMail" type="Elmah.ErrorMailModule, Elmah" preCondition="managedHandler"/> 
     <add name="ErrorFilter" type="Elmah.ErrorFilterModule, Elmah" preCondition="managedHandler"/> 
    </modules> 
    </system.webServer> 
    <runtime> 
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> 
     <dependentAssembly> 
     <assemblyIdentity name="System.Web.Helpers" publicKeyToken="31bf3856ad364e35"/> 
     <bindingRedirect oldVersion="1.0.0.0-2.0.0.0" newVersion="2.0.0.0"/> 
     </dependentAssembly> 
     <dependentAssembly> 
     <assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35"/> 
     <bindingRedirect oldVersion="1.0.0.0-4.0.0.0" newVersion="4.0.0.0"/> 
     </dependentAssembly> 
     <dependentAssembly> 
     <assemblyIdentity name="System.Web.WebPages" publicKeyToken="31bf3856ad364e35"/> 
     <bindingRedirect oldVersion="1.0.0.0-2.0.0.0" newVersion="2.0.0.0"/> 
     </dependentAssembly> 
     <dependentAssembly> 
     <assemblyIdentity name="EntityFramework" publicKeyToken="b77a5c561934e089" culture="neutral"/> 
     <bindingRedirect oldVersion="0.0.0.0-4.4.0.0" newVersion="4.4.0.0"/> 
     </dependentAssembly> 
    </assemblyBinding> 
    </runtime> 
    <entityFramework> 
    <defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework"/> 
    </entityFramework> 
    <elmah> 
    <security allowRemoteAccess="false"/> 
    </elmah> 
    <location path="elmah.axd" inheritInChildApplications="false"> 
    <system.web> 
     <httpHandlers> 
     <add verb="POST,GET,HEAD" path="elmah.axd" type="Elmah.ErrorLogPageFactory, Elmah"/> 
     </httpHandlers> 
    </system.web> 
    <system.webServer> 
     <handlers> 
     <add name="ELMAH" verb="POST,GET,HEAD" path="elmah.axd" type="Elmah.ErrorLogPageFactory, Elmah" preCondition="integratedMode"/> 
     </handlers> 
    </system.webServer> 
    </location> 
</configuration> 

nhưng khi pulish trên Rais máy chủ lỗi này Lỗi cấu hình

Mô tả: Một lỗi đã xảy ra trong việc xử lý tệp cấu hình cần thiết để phục vụ yêu cầu này. Vui lòng xem lại chi tiết lỗi cụ thể bên dưới và sửa đổi tệp cấu hình của bạn một cách thích hợp

Thông báo lỗi phân tích cú pháp: Không thể tải tệp hoặc lắp ráp 'System.Web.Providers, Ver sion = 1.0.0.0, Văn hóa = trung lập, PublicKeyToken = 31bf3856ad364e35 'hoặc một trong các phụ thuộc của nó. Hệ thống không thể tìm thấy các tập tin được chỉ định.

Nguồn Lỗi:

Line 44:  <membership defaultProvider="DefaultMembershipProvider"> 
Line 45:  <providers> 
Line 46:   <add name="DefaultMembershipProvider" type="System.Web.Providers.DefaultMembershipProvider, System.Web.Providers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" connectionStringName="DefaultConnection" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" requiresUniqueEmail="false" maxInvalidPasswordAttempts="5" minRequiredPasswordLength="6" minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10" applicationName="/"/> 
Line 47:  </providers> 
Line 48:  </membership> 

Trả lời

3

Tôi nghĩ bạn nên đặt Sao chép địa phương = true và đảm bảo sử dụng cùng một phiên bản khung .net.

+0

Cách thức hoạt động? Tôi đã cố gắng làm theo các hướng dẫn này, nhưng không thể làm như vậy, vì tôi không thấy nút "Hiển thị tất cả các tệp" [những]: msdn.microsoft.com/en-us/library/t1zz5y8c (v = vs .90) .aspx –

7

Rõ ràng bạn chưa triển khai lắp ráp System.Web.Providers trong thư mục bin của bạn. Đảm bảo rằng nó được đánh dấu bằng Copy Local=true?

+0

Tất cả các tài liệu tham khảo trong dự án của tôi là Sao chép Local = true – Mohammad

+0

Và bạn đã xác minh rằng lắp ráp trong câu hỏi là hiện tại trong thư mục bin trên máy chủ web của bạn? –

+0

vâng tôi đã xác minh – Mohammad

32

Sử dụng lệnh NuGet này để cài đặt DLL của bạn tự động:

Install-Package Microsoft.AspNet.Providers.Core 

Để biết thêm thông tin về NuGet Packages, đọc thisthis one for a tutorial.

1

Đối với tôi, tôi đã nâng cấp phiên bản Nhà cung cấp dịch vụ web với NuGet và điều này đã phá vỡ ứng dụng của tôi. Tôi đã phải đi vào web.config và tự cập nhật tất cả các tài liệu tham khảo lắp ráp trong phần nhà cung cấp để 2.0.0.0 thay vì 1.0.0.0 kể từ khi phiên bản mới của System.Web.Providers lắp ráp là 2.0.0.0.

+0

Để được rõ ràng, nó thực sự thêm trống mới, nhưng các mục nhập nhà cung cấp trùng lặp cho biết 2.0.0.0. Tôi đã xóa chúng và thay đổi những cái hiện có của tôi thành 2.0.0.0 và mọi thứ hoạt động như một sự quyến rũ. – Pugz

2

Trong Package Manager Console, tôi đã cài đặt các gói mới như dưới đây và tất cả đều tốt trên thế giới một lần nữa.

Install-Package Microsoft.AspNet.Providers
Install-Package Microsoft.AspNet.Providers.Core

+0

bạn cần thực hiện unInstall-Package Microsoft.AspNet.Providers.Core và sau đó Cài đặt gói Microsoft.AspNet.Providers.Core –

Các vấn đề liên quan