none
System.Core not found

    Question

  • Hi all,

    I have this scenary:

    1) WebSite with some .aspx that have this code:
    <telerik:ReportViewer ID="ReportViewer1" runat="server" Height="600px" 
     Report="Reports.MyReport, Reports, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"
    ......
    </telerik:ReportViewer>

    2) The report Reports.MyReport is in a class library target to 3.5 framework
    3)The library project have a reference to System.Core, (i need to use linq in some reports)


    Problem: 

    In the aspx pages that i need to use Entity Framework, i have to register the assembly (because i have an asp:EntityDataSource):
    <%@ Register Assembly="System.Web.Entity, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" Namespace="System.Web.UI.WebControls" TagPrefix="asp" %>

    In every page that i register this System.Web.Entity, when i try to see the page in a browser, i get this error message:

    Could not load file or assembly 'System.Core, Version = 2.0.5.0, Culture = neutral, PublicKeyToken = 7cec85d7bea7798e' or one of its dependencies. The system can not find the file specified.

    The System.Core is referenced in the class library that have all the reports.

    The stack trace is this:


    [FileNotFoundException: Não foi possível carregar o ficheiro ou assemblagem 'System.Core, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e' ou uma das respectivas dependências. O sistema não conseguiu localizar o ficheiro especificado.]
       System.ModuleHandle.ResolveType(Int32 typeToken, RuntimeTypeHandle* typeInstArgs, Int32 typeInstCount, RuntimeTypeHandle* methodInstArgs, Int32 methodInstCount) +0
       System.ModuleHandle.ResolveTypeHandle(Int32 typeToken, RuntimeTypeHandle[] typeInstantiationContext, RuntimeTypeHandle[] methodInstantiationContext) +147
       System.Reflection.Module.ResolveType(Int32 metadataToken, Type[] genericTypeArguments, Type[] genericMethodArguments) +203
       System.Reflection.CustomAttribute.FilterCustomAttributeRecord(CustomAttributeRecord caRecord, MetadataImport scope, Assembly& lastAptcaOkAssembly, Module decoratedModule, MetadataToken decoratedToken, RuntimeType attributeFilterType, Boolean mustBeInheritable, Object[] attributes, IList derivedAttributes, RuntimeType& attributeType, RuntimeMethodHandle& ctor, Boolean& ctorHasParameters, Boolean& isVarArg) +133
       System.Reflection.CustomAttribute.IsCustomAttributeDefined(Module decoratedModule, Int32 decoratedMetadataToken, RuntimeType attributeFilterType, Boolean mustBeInheritable) +183
       System.Reflection.CustomAttribute.IsDefined(Assembly assembly, RuntimeType caType) +100
       System.Reflection.Assembly.IsDefined(Type attributeType, Boolean inherit) +53
       System.Data.Metadata.Edm.ObjectItemCollection.IsSchemaAttributePresent(Assembly assembly) +29
       System.Data.Metadata.Edm.ObjectItemCollection.LoadAssemblyFromCache(ObjectItemCollection objectItemCollection, Assembly assembly, Boolean loadReferencedAssemblies) +132
       System.Data.Metadata.Edm.ObjectItemCollection.LoadFromAssembly(Assembly assembly) +61
       System.Data.Metadata.Edm.MetadataWorkspace.LoadFromAssembly(Assembly assembly) +77
       System.Web.UI.WebControls.EntityDataSourceView.ConstructContext() +708
       System.Web.UI.WebControls.EntityDataSourceView.ExecuteSelect(DataSourceSelectArguments arguments, Creator qbConstructor) +97
       System.Web.UI.WebControls.EntityDataSourceView.ExecuteSelect(DataSourceSelectArguments arguments) +102
       System.Web.UI.WebControls.ListControl.OnDataBinding(EventArgs e) +95
       System.Web.UI.WebControls.ListControl.PerformSelect() +34
       System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +73
       System.Web.UI.WebControls.BaseDataBoundControl.EnsureDataBound() +82
       System.Web.UI.WebControls.BaseDataBoundControl.OnPreRender(EventArgs e) +22
       System.Web.UI.WebControls.ListControl.OnPreRender(EventArgs e) +18
       System.Web.UI.Control.PreRenderRecursiveInternal() +80
       System.Web.UI.Control.PreRenderRecursiveInternal() +171
       System.Web.UI.Control.PreRenderRecursiveInternal() +171
       System.Web.UI.Control.PreRenderRecursiveInternal() +171
       System.Web.UI.Control.PreRenderRecursiveInternal() +171
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +842



    Other informations that could help:
    -> The server has 3.5,2.0 framework installed
    -> The site works in dev computer, using the F5 of Visual Studio
    -> I contact the telerik team and they said the problem inst theirs

    Anyone have any idea what's going on ? 
    Thanks a lot

    Rui Santos
    Tuesday, December 22, 2009 1:30 PM

Answers

  • hi,
    Well i resolved my problem, this way:


    1) Go to dev machine (where everything work well)
    2) Go to C:\Program Files\Microsoft SDKs\Silverlight\v2.0\Reference Assemblies
    3) Copy the System.Core.dll and Syste,Core.xml to bin of web site in the server

    Everything works fine now, i don't know why i need this, but i guess there is somewhere any reference to this assembly (my project don't have any silverligth app).

    Rui Santos

    • Marked as answer by rsantos Tuesday, December 22, 2009 7:41 PM
    Tuesday, December 22, 2009 7:41 PM

All replies

  • hi,
    Well i resolved my problem, this way:


    1) Go to dev machine (where everything work well)
    2) Go to C:\Program Files\Microsoft SDKs\Silverlight\v2.0\Reference Assemblies
    3) Copy the System.Core.dll and Syste,Core.xml to bin of web site in the server

    Everything works fine now, i don't know why i need this, but i guess there is somewhere any reference to this assembly (my project don't have any silverligth app).

    Rui Santos

    • Marked as answer by rsantos Tuesday, December 22, 2009 7:41 PM
    Tuesday, December 22, 2009 7:41 PM
  • Hello Rui,

    Glad to hear you found a workaround. The cause of the issue is not obvious. Would it be possible for you to send a project that reproduces the issue?

    Thanks,
    Diego
    This posting is provided "AS IS" with no warranties, and confers no rights.
    Thursday, December 24, 2009 11:11 AM
    Moderator