简体   繁体   中英

Could not load file or assembly 'netstandard, Version=2.1.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies

When I debug my MVC app everything is OK, but when I run my published app, I get this error:

System.IO.FileNotFoundException Message: Could not load file or assembly .netstandard, Version=2.1.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. The system cannot find the file specified. StackTrace: at System.Reflection.CustomAttribute._CreateCaObject(RuntimeModule pModule, IRuntimeMethodInfo pCtor, Byte** ppBlob, Byte* pEndBlob, Int32* pcNamedArgs) at System.Reflection.CustomAttribute.CreateCaObject(RuntimeModule module, IRuntimeMethodInfo ctor, IntPtr& blob, IntPtr blobEnd, Int32& namedArgs) at System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeModule decoratedModule, Int32 decoratedMetadataToken, Int32 pcaCount, RuntimeType attributeFilterType, Boolean mustBeInheritable, IList derivedAttributes, Boolean isDecoratedTargetSecurityTransparent) at System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeMethodInfo method, RuntimeType caType, Boolean inherit) at DevExpress.DataAccess.ObjectBinding.ObjectMember..ctor(MemberInfo memberInfo) at DevExpress.DataAccess.Native.ObjectBinding.ObjectDataSourceFillHelper.<>c.b__24_5(MemberInfo info) at System.Linq.Enumerable.WhereSelectEnumerableIterator 2.MoveNext() at System.Linq.Enumerable.WhereEnumerableIterator 2.MoveNext() at System.Linq.Enumerable.WhereEnumerableIterator 1.MoveNext() at System.Collections.Generic.List 1..ctor(IEnumerable 1 collection)
at System.Linq.Enumerable.ToList[TSource](IEnumerable 1 source) at DevExpress.DataAccess.Native.Web.ObjectDataSourceWizardService.GetMemberInfo(Type type, IObjectDataSourceMemberFilterService filterMemberService) at DevExpress.DataAccess.Native.Web.ObjectDataSourceWizardService.GetAvailableObjectDescriptions(String context) at lambda_method(Closure, IQueryBuilderRequestController, String ) at DevExpress.XtraReports.Web.Native.ClientControls.Services.RequestManagerBase 2.WrapWithTryCatchAction(String controllerTypeName, String methodName, String webActionName, ControllerFunc invoker, TController controller, String json)

I have MVC app with target framework: .NET Framework 4.5.2. I have seen this post , but didn't help me. What could I do to solve this error?

If you are using Visual Studio 2019 and.Net core then at the time of publishing, it should be giving you a file called [solution-name].deps.json. Replace this file as well when you are publishing it on server. This file contains the address of all the dll files. Find your problematic file here and check if the file does exist at the mentioned location.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM