Hi,
I just updated all of the nuget references and project no longer complies :o Getting the following errors , any advice on what to change?
I also changed the Clock.SupportsMultipleTimezone from a method ? Is this correct?
Error CS0246 The type or namespace name 'IdentityFrameworkClaimsAbpSession' could not be found (are you missing a using directive or an assembly reference?) Core\Runtime\Session\AspNetZeroAbpSession.cs 10 Active
Error CS0115 'AspNetZeroAbpSession.TenantId': no suitable method found to override Core\Runtime\Session\AspNetZeroAbpSession.cs 14 Active
Error CS1729 'IdentityFrameworkClaimsAbpSession' does not contain a constructor that takes 1 arguments Core\Runtime\Session\AspNetZeroAbpSession.cs 29 Active
Error CS0117 'Mapper' does not contain a definition for 'CreateMap' Application\CustomDtoMapper.cs 29 Active
Thanks
4 Answer(s)
-
0
I have found that I should have changed the IdentityFrameworkClaimsAbpSession to ClaimsAbpSession and this now complies. Looking to understand the change for the mapper method.
private static void CreateMappingsInternal() { Mapper.CreateMap<User, UserEditDto>() .ForMember(dto => dto.Password, options => options.Ignore()) .ReverseMap() .ForMember(user => user.Password, options => options.Ignore()); }
Mapper.CreateMap<User, UserEditDto>()
-
0
Hi,
Clock.SupportsMultipleTimezone is converted to a property from a method. It's used in some vies as well. You can search it in your *.cshtml files.
Do you still have problem with Mappings ?
-
0
Yes, if you could please provide the change to replace the Mapper.CreateMap function as this no longer exists. I assume it will use the map method that exists on the class? Commenting this out and the issue below allows the application to run but getting anti forgery error on login.
Also getting an error on the usage of the clock provider?
protected override void Application_Start(object sender, EventArgs e) { //Use UTC clock. Remove this to use local time for your application. Clock.Provider = new UtcClockProvider();
Error CS1729 'UtcClockProvider' does not contain a constructor that takes 0 arguments Web\Global.asax.cs 15 Active
Look forward to your reply :)
-
0
Hi,
- For mapping issue, you should use it like this in your application module's PreInitialize method,
Configuration.Modules.AbpAutoMapper().Configurators.Add(mapper => { CustomDtoMapper.CreateMappings(mapper); });
and change your CreateMappings method in custom dto mapper to
public static void CreateMappings(IMapperConfigurationExpression mapper) { ... }
- set clock provider like this
Clock.Provider = ClockProviders.Utc;
- For antiforgery issue in login page, did you put this line to _Layout.cshtml under Views/Account ?
SetAntiForgeryCookie();
It just be after "Layout = null;" line.