2011-02-23 97 views
1

我有一個web應用程序,當我決定在IIS 7上測試時,我嘗試加載使用實體框架4的幾個頁面時出現此異常。我使用EF 4自己的CRUD程序集,但有時使用EntityDataSource。我注意到這個問題並沒有出現在我的所有網頁中,但我認爲那些使用EntityDataSource的問題。發佈ASP.NET Web應用程序時的異常問題

下面是從頁日誌:

Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information. 

mscorlib 

System.Type[] GetTypes(System.Reflection.RuntimeModule) 

    at System.Reflection.RuntimeModule.GetTypes(RuntimeModule module) 
    at System.Reflection.RuntimeModule.GetTypes() 
    at System.Reflection.Assembly.GetTypes() 
    at System.Data.Metadata.Edm.ObjectItemConventionAssemblyLoader.LoadTypesFromAssembly() 
    at System.Data.Metadata.Edm.ObjectItemAssemblyLoader.Load() 
    at System.Data.Metadata.Edm.AssemblyCache.LoadAssembly(Assembly assembly, Boolean loadReferencedAssemblies, ObjectItemLoadingSessionData loadingData) 
    at System.Data.Metadata.Edm.AssemblyCache.LoadAssembly(Assembly assembly, Boolean loadReferencedAssemblies, KnownAssembliesSet knownAssemblies, EdmItemCollection edmItemCollection, Action`1 logLoadMessage, Object& loaderCookie, Dictionary`2& typesInLoading, List`1& errors) 
    at System.Data.Metadata.Edm.ObjectItemCollection.LoadAssemblyFromCache(ObjectItemCollection objectItemCollection, Assembly assembly, Boolean loadReferencedAssemblies, EdmItemCollection edmItemCollection, Action`1 logLoadMessage) 
    at System.Data.Metadata.Edm.ObjectItemCollection.ExplicitLoadFromAssembly(Assembly assembly, EdmItemCollection edmItemCollection, Action`1 logLoadMessage) 
    at System.Data.Metadata.Edm.MetadataWorkspace.ExplicitLoadFromAssembly(Assembly assembly, ObjectItemCollection collection, Action`1 logLoadMessage) 
    at System.Data.Metadata.Edm.MetadataWorkspace.LoadFromAssembly(Assembly assembly, Action`1 logLoadMessage) 
    at System.Web.UI.WebControls.EntityDataSourceView.ConstructContext() 
    at System.Web.UI.WebControls.EntityDataSourceView.ExecuteSelect(DataSourceSelectArguments arguments) 
    at System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback) 

................它不是完整的,但我想你可以看到最新的breadcumb ...

只是爲了更多的信息我張貼另一個頁面的問題。

Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information. 

mscorlib 

System.Type[] GetTypes(System.Reflection.RuntimeModule) 

    at System.Reflection.RuntimeModule.GetTypes(RuntimeModule module) 
    at System.Reflection.RuntimeModule.GetTypes() 
    at System.Reflection.Assembly.GetTypes() 
    at System.Data.Metadata.Edm.ObjectItemConventionAssemblyLoader.LoadTypesFromAssembly() 
    at System.Data.Metadata.Edm.ObjectItemAssemblyLoader.Load() 
    at System.Data.Metadata.Edm.AssemblyCache.LoadAssembly(Assembly assembly, Boolean loadReferencedAssemblies, ObjectItemLoadingSessionData loadingData) 
    at System.Data.Metadata.Edm.AssemblyCache.LoadAssembly(Assembly assembly, Boolean loadReferencedAssemblies, KnownAssembliesSet knownAssemblies, EdmItemCollection edmItemCollection, Action`1 logLoadMessage, Object& loaderCookie, Dictionary`2& typesInLoading, List`1& errors) 
    at System.Data.Metadata.Edm.ObjectItemCollection.LoadAssemblyFromCache(ObjectItemCollection objectItemCollection, Assembly assembly, Boolean loadReferencedAssemblies, EdmItemCollection edmItemCollection, Action`1 logLoadMessage) 
    at System.Data.Metadata.Edm.ObjectItemCollection.ExplicitLoadFromAssembly(Assembly assembly, EdmItemCollection edmItemCollection, Action`1 logLoadMessage) 
    at System.Data.Metadata.Edm.MetadataWorkspace.ExplicitLoadFromAssembly(Assembly assembly, ObjectItemCollection collection, Action`1 logLoadMessage) 
    at System.Data.Metadata.Edm.MetadataWorkspace.LoadFromAssembly(Assembly assembly, Action`1 logLoadMessage) 
    at System.Web.UI.WebControls.EntityDataSourceView.ConstructContext() 
    at System.Web.UI.WebControls.EntityDataSourceView.ExecuteSelect(DataSourceSelectArguments arguments) 
    at System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback) 
    at System.Web.UI.WebControls.DataBoundControl.PerformSelect() 
    at System.Web.UI.WebControls.BaseDataBoundControl.DataBind() 
    at System.Web.UI.WebControls.FormView.DataBind() 
    at System.Web.UI.WebControls.BaseDataBoundControl.EnsureDataBound() 
    at System.Web.UI.WebControls.FormView.EnsureDataBound() 
    at System.Web.UI.WebControls.CompositeDataBoundControl.CreateChildControls() 
    at System.Web.UI.Control.EnsureChildControls() 
    at System.Web.UI.Control.PreRenderRecursiveInternal() 
    at System.Web.UI.Control.PreRenderRecursiveInternal() 
    at System.Web.UI.Control.PreRenderRecursiveInternal() 
    at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) 

我認爲它的電火花加工問題,但我不能通過。 我應該提到,在我的開發電腦工作都完美!

我的控件是DevExpress,但我不認爲這應該扮演任何角色!

謝謝。

[編輯]

謝謝RD的編輯。 忘了提及我在一個單獨的程序集中使用Entities.tt的自我跟蹤模板!

[編輯2]

在我的本地Windows 7 IIS工作正常!這是Windows Server 2008我無法完成!

+0

您的程序集是否已部署實體? –

+0

是的所有組件都是正確的。我編輯了一些信息。檢查 –

回答

0

這是一個錯誤,因爲它似乎沒有加載程序集。該應用程序需要我不使用到我的應用程序集,但我想它使用反射進行搜索。這與DevExpress程序集有關,我猜測它是在另一個DevExpress程序集中反射引用或加載的。解決方案是記錄LoaderExceptions並查看你需要的組件。

相關問題