Base solution for your next web application
Open Closed

Update from 0.7.8 to 0.9.7.0 problem #1387


User avatar
0
omital created

I recently update packages in my project. When I run project I got this error

Server Error in '/Azma.Web' Application.

Method not found: 'AutoMapper.IMappingExpression AutoMapper.Mapper.CreateMap(System.Type, System.Type)'. 
  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.MissingMethodException: Method not found: 'AutoMapper.IMappingExpression AutoMapper.Mapper.CreateMap(System.Type, System.Type)'.

Source Error:

How I can solve this problem?!


8 Answer(s)
  • User Avatar
    0
    hikalkan created
    Support Team

    It seems AutoMapper.Mapper.CreateMap method is removed from latest AutoMapper version. For a workaround, do not upgrade AutoMapper for now or don't use Abp.AutoMapper library. We will work to adapt Abp.AutoMapper to AutoMapper 5.x: <a class="postlink" href="https://github.com/aspnetboilerplate/aspnetboilerplate/issues/1166">https://github.com/aspnetboilerplate/as ... ssues/1166</a>

  • User Avatar
    0
    omital created

    Thank you man. I solve this problem with these steps: 1- execute command " Uninstall-package AutoMapper -Force" in project Application & web 2- execute command "Install-Package AutoMapper -Version 4.2.1" in project Application & web but faced with another problem. When I run the project this error raised:

  • User Avatar
    0
    hikalkan created
    Support Team

    Please share the stacktrace and inner exception if exists.

  • User Avatar
    0
    omital created

    Inner exception is null but stack trace

    ERROR 2016-07-10 13:48:35,706 [7    ] Web.Mvc.Controllers.AbpAppViewController - An item with the same key has already been added.
    System.ArgumentException: An item with the same key has already been added.
       at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)
       at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
       at System.Linq.Enumerable.ToDictionary[TSource,TKey,TElement](IEnumerable`1 source, Func`2 keySelector, Func`2 elementSelector, IEqualityComparer`1 comparer)
       at Abp.Localization.ApplicationLanguageManager.&lt;GetLanguagesFromDatabaseAsync&gt;d__17.MoveNext() in D:\Halil\GitHub\module-zero\src\Abp.Zero\Localization\ApplicationLanguageManager.cs:line 204
    --- End of stack trace from previous location where exception was thrown ---
       at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
       at Abp.Threading.InternalAsyncHelper.&lt;AwaitTaskWithPostActionAndFinallyAndGetResult&gt;d__5`1.MoveNext() in D:\Halil\GitHub\aspnetboilerplate\src\Abp\Threading\InternalAsyncHelper.cs:line 120
    --- End of stack trace from previous location where exception was thrown ---
       at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
       at Abp.Runtime.Caching.CacheExtensions.<>c__DisplayClass5_0`2.&lt;&lt;GetAsync&gt;b__0>d.MoveNext() in D:\Halil\GitHub\aspnetboilerplate\src\Abp\Runtime\Caching\CacheExtensions.cs:line 0
    --- End of stack trace from previous location where exception was thrown ---
       at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
       at Abp.Runtime.Caching.CacheBase.&lt;GetAsync&gt;d__12.MoveNext() in D:\Halil\GitHub\aspnetboilerplate\src\Abp\Runtime\Caching\CacheBase.cs:line 67
    --- End of stack trace from previous location where exception was thrown ---
       at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
       at Abp.Runtime.Caching.CacheExtensions.&lt;GetAsync&gt;d__5`2.MoveNext() in D:\Halil\GitHub\aspnetboilerplate\src\Abp\Runtime\Caching\CacheExtensions.cs:line 38
    --- End of stack trace from previous location where exception was thrown ---
       at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
       at Abp.Localization.ApplicationLanguageManager.<GetLanguageDictionary>d__15.MoveNext() in D:\Halil\GitHub\module-zero\src\Abp.Zero\Localization\ApplicationLanguageManager.cs:line 178
    --- End of stack trace from previous location where exception was thrown ---
       at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
       at Abp.Localization.ApplicationLanguageManager.<GetLanguagesAsync>d__8.MoveNext() in D:\Halil\GitHub\module-zero\src\Abp.Zero\Localization\ApplicationLanguageManager.cs:line 60
    --- End of stack trace from previous location where exception was thrown ---
       at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
       at Nito.AsyncEx.Synchronous.TaskExtensions.WaitAndUnwrapException[TResult](Task`1 task)
       at System.Threading.Tasks.ContinuationResultTaskFromResultTask`2.InnerInvoke()
       at System.Threading.Tasks.Task.Execute()
    --- End of stack trace from previous location where exception was thrown ---
       at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
       at Nito.AsyncEx.Synchronous.TaskExtensions.WaitAndUnwrapException[TResult](Task`1 task)
       at Nito.AsyncEx.AsyncContext.Run[TResult](Func`1 action)
       at Abp.Localization.ApplicationLanguageProvider.GetLanguages() in D:\Halil\GitHub\module-zero\src\Abp.Zero\Localization\ApplicationLanguageProvider.cs:line 35
       at Abp.Localization.MultiTenantLocalizationDictionaryProvider.GetDictionaries() in D:\Halil\GitHub\module-zero\src\Abp.Zero\Localization\MultiTenantLocalizationDictionaryProvider.cs:line 56
       at Abp.Localization.Dictionaries.DictionaryBasedLocalizationSource.GetStringOrNull(String name, CultureInfo culture, Boolean tryDefaults) in D:\Halil\GitHub\aspnetboilerplate\src\Abp\Localization\Dictionaries\DictionaryBasedLocalizationSource.cs:line 84
       at Abp.Localization.Dictionaries.DictionaryBasedLocalizationSource.GetString(String name) in D:\Halil\GitHub\aspnetboilerplate\src\Abp\Localization\Dictionaries\DictionaryBasedLocalizationSource.cs:line 61
       at ASP._Page_App_Main_views_home_home_cshtml.Execute() in d:\Projects\Web\Azma\Azma.Web\App\Main\views\home\home.cshtml:line 2
       at System.Web.WebPages.WebPageBase.ExecutePageHierarchy()
       at System.Web.Mvc.WebViewPage.ExecutePageHierarchy()
       at System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage)
       at System.Web.Mvc.ViewResultBase.ExecuteResult(ControllerContext context)
       at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult)
       at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult)
       at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultWithFilters(ControllerContext controllerContext, IList`1 filters, ActionResult actionResult)
       at System.Web.Mvc.Async.AsyncControllerActionInvoker.&lt;&gt;c__DisplayClass21.&lt;BeginInvokeAction&gt;b__1e(IAsyncResult asyncResult)
    
  • User Avatar
    0
    omital created

    I think fund the problem. in "AbpLanguages" table so many duplicate entity inserted (I don't know how?!) I fix this bby change in DefaultLanguagesBuilder class. but new problem :shock:

    JavaScript runtime error: Unable to get property 'unspecifiedClockProvider' of undefined or null reference
    

    Any help?!

  • User Avatar
    0
    hikalkan created
    Support Team

    It's defined here: <a class="postlink" href="https://github.com/aspnetboilerplate/aspnetboilerplate/blob/dev/src/Abp.Web.Resources/Abp/Framework/scripts/abp.js#L654">https://github.com/aspnetboilerplate/as ... bp.js#L654</a>

    Maybe your browser cached the old script.

  • User Avatar
    0
    omital created

    I clear cash and it solved. but another and another problem. I think I have to download new template and replace my project file on it :( :( :( :( :( :( :(

  • User Avatar
    0
    hikalkan created
    Support Team

    Did you follow our release notes since there maybe some breaking changes: <a class="postlink" href="https://github.com/aspnetboilerplate/aspnetboilerplate/releases">https://github.com/aspnetboilerplate/as ... e/releases</a> Especially, there were important notes on v0.8 and v0.9 releases and we published two blog post for them.