Activities of "cangunaydin"

  • ABP Framework version: v8.0.0
  • UI Type: Angular
  • Database System: EF Core (PostgreSQL)
  • Tiered (for MVC) or Auth Server Separated (for Angular): yes

Hello, The question is related with Abp Client Proxies. I have a web server which uses abp and abp endpoints. Now i want to share the httpclient module of the web server and use it in avalonia ui project. I created an abp module and do necessary configurations for avalonia project. Added HttpClient project reference. Now when i run the project on android environment it works fine. But when i run it on ios, it throws an exception "platform not supported exception". here is the full exception

 System.PlatformNotSupportedException: Dynamic code generation is not supported on this platform.
   at System.Reflection.Emit.AssemblyBuilder.ThrowDynamicCodeNotSupported()
   at System.Reflection.Emit.AssemblyBuilder.EnsureDynamicCodeSupported()
   at System.Reflection.Emit.RuntimeAssemblyBuilder..ctor(AssemblyName n, AssemblyBuilderAccess access)
   at System.Reflection.Emit.AssemblyBuilder.DefineDynamicAssembly(AssemblyName name, AssemblyBuilderAccess access)
   at Castle.DynamicProxy.ModuleScope.CreateModule(Boolean signStrongName)
   at Castle.DynamicProxy.ModuleScope.ObtainDynamicModuleWithWeakName()
   at Castle.DynamicProxy.ModuleScope.ObtainDynamicModule(Boolean isStrongNamed)
   at Castle.DynamicProxy.ModuleScope.DefineType(Boolean inSignedModulePreferably, String name, TypeAttributes flags)
   at Castle.DynamicProxy.Generators.Emitters.ClassEmitter.CreateTypeBuilder(ModuleScope moduleScope, String name, Type baseType, IEnumerable`1 interfaces, TypeAttributes flags, Boolean forceUnsigned)
   at Castle.DynamicProxy.Generators.Emitters.ClassEmitter..ctor(ModuleScope moduleScope, String name, Type baseType, IEnumerable`1 interfaces, TypeAttributes flags, Boolean forceUnsigned)
   at Castle.DynamicProxy.Generators.Emitters.ClassEmitter..ctor(ModuleScope moduleScope, String name, Type baseType, IEnumerable`1 interfaces)
   at Castle.DynamicProxy.Generators.BaseProxyGenerator.BuildClassEmitter(String typeName, Type parentType, IEnumerable`1 interfaces)
   at Castle.DynamicProxy.Generators.BaseInterfaceProxyGenerator.Init(String typeName, ClassEmitter& emitter, Type proxyTargetType, FieldReference& interceptorsField, IEnumerable`1 allInterfaces)
   at Castle.DynamicProxy.Generators.BaseInterfaceProxyGenerator.GenerateType(String typeName, INamingScope namingScope)
   at Castle.DynamicProxy.Generators.BaseProxyGenerator.<>c__DisplayClass13_0.<GetProxyType>b__0(CacheKey cacheKey)
   at Castle.Core.Internal.SynchronizedDictionary`2[[Castle.DynamicProxy.Generators.CacheKey, Castle.Core, Version=5.0.0.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc],[System.Type, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].GetOrAdd(CacheKey key, Func`2 valueFactory)
   at Castle.DynamicProxy.Generators.BaseProxyGenerator.GetProxyType()
   at Castle.DynamicProxy.DefaultProxyBuilder.CreateInterfaceProxyTypeWithoutTarget(Type interfaceToProxy, Type[] additionalInterfacesToProxy, ProxyGenerationOptions options)
   at Castle.DynamicProxy.ProxyGenerator.CreateInterfaceProxyTypeWithoutTarget(Type interfaceToProxy, Type[] additionalInterfacesToProxy, ProxyGenerationOptions options)
   at Castle.DynamicProxy.ProxyGenerator.CreateInterfaceProxyWithoutTarget(Type interfaceToProxy, Type[] additionalInterfacesToProxy, ProxyGenerationOptions options, IInterceptor[] interceptors)
   at Castle.DynamicProxy.ProxyGenerator.CreateInterfaceProxyWithoutTarget(Type interfaceToProxy, IInterceptor[] interceptors)
   at Microsoft.Extensions.DependencyInjection.ServiceCollectionHttpClientProxyExtensions.<>c__DisplayClass4_0.<AddHttpClientProxy>b__1(IServiceProvider serviceProvider)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitFactory(FactoryCallSite factoryCallSite, RuntimeResolverContext context)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2[[Microsoft.Extensions.DependencyInjection.ServiceLookup.RuntimeResolverContext, Microsoft.Extensions.DependencyInjection, Version=8.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60],[System.Object, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].VisitCallSiteMain(ServiceCallSite callSite, RuntimeResolverContext argument)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitDisposeCache(ServiceCallSite transientCallSite, RuntimeResolverContext context)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2[[Microsoft.Extensions.DependencyInjection.ServiceLookup.RuntimeResolverContext, Microsoft.Extensions.DependencyInjection, Version=8.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60],[System.Object, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].VisitCallSite(ServiceCallSite callSite, RuntimeResolverContext argument)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.Resolve(ServiceCallSite callSite, ServiceProviderEngineScope scope)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.RuntimeServiceProviderEngine.<>c__DisplayClass4_0.<RealizeService>b__0(ServiceProviderEngineScope scope)
   at Microsoft.Extensions.DependencyInjection.ServiceProvider.GetService(ServiceIdentifier serviceIdentifier, ServiceProviderEngineScope serviceProviderEngineScope)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngineScope.GetService(Type serviceType)
   at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(IServiceProvider provider, Type serviceType)
   at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService[IScreenAppService](IServiceProvider provider)
   at Microsoft.Extensions.DependencyInjection.ServiceCollectionCommonExtensions.GetRequiredService[IScreenAppService](IServiceCollection services)
   at Adzup.Player.AbpBootstrapper.GetRequiredService[IScreenAppService]()
   at Adzup.Player.ViewModels.ConfigurationViewModel..ctor() in /Users/cangunaydin/projects/Adzup.Player/Adzup.Player/Adzup.Player/ViewModels/ConfigurationViewModel.cs:line 36

so the reason is obvious from the stacktrace. According to microsoft docs for ios, it says:

Since the iOS kernel prevents an application from generating code dynamically, Xamarin.iOS does not support any form of dynamic code generation. These include:

The System.Reflection.Emit is not available.
No support for System.Runtime.Remoting.
No support for creating types dynamically (no Type.GetType ("MyType`1")), although looking up existing types (Type.GetType ("System.String") for example, works just fine).
Reverse callbacks must be registered with the runtime at compile time.

I also find a previous post related with this https://support.abp.io/QA/Questions/2752/SystemPlatformNotSupportedException-when-running-Xamarin-Forms-on-iOS-using-ABP-Module-with-Autofac

so the question is, is it possible to make this work so i can use the httpclient module for my avalonia ios project? And I wonder how does this work for Maui App if it does not support System.Reflection.Emit. It seems like Castle.DynamicProxy class calls System.Reflection.Emit. Is Maui project bypassing this by replacing the service with sth else?

Hello, Thanks for the solution. I wonder two things.

  • Is the bug related to backend or is it because assigning a xsrf token to header while sending from the maui client? Probably the latter. Cause i replace the AbpAutoValidateAntiforgeryTokenAuthorizationFilter class it always come with xsrf token when i do a post from maui client.
  • How can i see the source code of Volo.Abp.Maui.Client package?

Also if i want to intercept the http requests, what is the correct way to do it in Maui Project? Let's say i want to add extra header for specific request. I tried sth like this but this doesn't work.

[Volo.Abp.DependencyInjection.Dependency(ReplaceServices = true)]
[ExposeServices(typeof(DynamicHttpProxyInterceptorClientProxy<IIdentityUserAppService>))]
public class IdentityUserAppServiceHttpProxyInterceptorClientProxy : DynamicHttpProxyInterceptorClientProxy<IIdentityUserAppService>
{
    protected override void AddHeaders(IReadOnlyDictionary<string, object> argumentsDictionary, ActionApiDescriptionModel action,
        HttpRequestMessage requestMessage, ApiVersionInfo apiVersion)
    {
        base.AddHeaders(argumentsDictionary, action, requestMessage, apiVersion);
        
    }

    protected override Task<HttpContent> RequestAsync(ClientProxyRequestContext requestContext)
    {
        return base.RequestAsync(requestContext);
    }
}
  • ABP Framework version: v8.0.0 rc2
  • UI Type: Maui
  • Database System: EF Core (PostgreSQL)
  • Tiered (for MVC) or Auth Server Separated (for Angular): yes

Hello I am having problem with maui application when i do posts to the api. HttpStatusCode:400 returns every time, is sth changed on antiforgery token middleware on version 8? I didn't have this problem on v7.4. To reproduce the problem just create a new project from scratch with v8 rc2. abp new BookStore -t app-pro -u angular -dbms PostgreSQL --separate-auth-server -m maui -csf --preview then try to run maui app and **create a new user **(or try to do any post or put). you will get an error. Bad Request with status code 400

is there a way to ignore antiforgery token check for mobile app calls only.

Hello again, I understand why now. i switch to mac, that's why it appears in my solution. Cause $(UserProfile) env variable not exists on mac. env variable is $(HOME) instead. I think you should use this instead on common.props file. $([System.Environment]::GetFolderPath(SpecialFolder.UserProfile))

so you can support for each operating system. check this issue. https://github.com/dotnet/msbuild/issues/3908

Hello again, new updates from me. Now i fixed everything that i wanted. It was little struggle though. I will write here what I have done.

  • As you mentioned on the previous post. you have added remove borders classes from all platforms for entry,picker and datepicker. On the top of that (cause what i want is to have a bottom border) i have added some styles to Styles.xaml.

<Style TargetType="BoxView" x:Key="InputSeparator"> <Setter Property="Margin" Value="{OnPlatform Android='0,0,0,0',iOS='0,10,0,0',MacCatalyst='0,10,0,0'}"></Setter> <Setter Property="HeightRequest" Value="1"> </Setter> <Setter Property="HorizontalOptions" Value="Fill"></Setter> </Style>

&lt;Style TargetType=&quot;Label&quot; x:Key=&quot;InputLabel&quot;&gt;
   &lt;Setter Property=&quot;Margin&quot; Value=&quot;{OnPlatform iOS=&#39;0,0,0,5&#39;,MacCatalyst=&#39;0,0,0,5&#39;}&quot;&gt;&lt;/Setter&gt;
&lt;/Style&gt;

Then i have added those styles to label and entries for form elements. As an example:

as a result i got some border at the end for both android and ios.

  • Second issue was with checkbox on ios. there was no margin, so i added this style on the checkbox.
  • Third issue as i have mentioned before it was getting black textcolor when the edit page is requested on dark theme. This was an issue related with async void. For ex: on TenantEditModal, this was the method that has been called when edit has been clicked.
async partial void OnIdChanged(string? value)

This was causing threading problems i guess. So probably changing color was not invoked. so what i did instead is use AsyncHelper and leave the method as sync. Here is the code.

partial void OnIdChanged(string? value)
    {
        IsBusy = true;
        AsyncHelper.RunSync(GetTenant);
        AsyncHelper.RunSync(GetEditions);
        IsBusy = false;
    }

i have seen some people are using async void but according to me it is not the best practice.From my experience, it always bring some problems with it. The same problem exists on WeakReferenceMessenger. I have changed the code over there also. So i have been able to get the user interface that i wanted. here is how it looks at the end. Thanks for the code that has been provided by the way, it helped me a lot. On the other hand what i think is, on the long run adding RemovingHandlers to the project can be problematic in some cases. But for now it is good to go.

Hello, I have done manually, everything works fine now. one question though on rider there are some shorcuts appeared because of abp cli i suppose. And since update failed it still persists i guess. is there any sideeffect to delete those files ends with abppkg.analyze.json

Hello thanks for the feedback, I have also started to fix the things one by one.

  • problem with empty image on ios comes from refreshview. there was an open issue for it. https://github.com/dotnet/maui/issues/7315 i think they fix that with .net 8. to overcome the problem you can wrap the collectionview with grid sth like this. then you don't need to change the width request. everything works fine.
  • for the borders on entry i think your code is removing all the borders, however i like the android style with border bottom. IOS doesn't support that though as i understand. Maybe i need to remove the frames i am not so sure about it. I will find sth for it.
  • I couldn't find the radiobutton fix while i was trying different variations, so i was planning to switch to another component so it is nice that you share it with me i can use it.

I have also upgraded my app to .net 8 yesterday, some things have been fixed however still some problems persist and some new problems arrived.

I will write over here if i can fix those things that i mention

Also worth to mention, I tried this .net 7, on list pages, maybe it has been fixed on .net 8 i didn't try

<RefreshView Grid.Row="1" IsRefreshing="{Binding IsBusy}" Command="{Binding RefreshCommand}">

this code makes the RefreshCommand triggers on the page load. since page appearing is also triggering the same code you call the endpoint twice. There was a discussion about it also in .net maui github issues. To overcome the situation, what i did was to bind RefreshCommand.IsRunning property instead of IsBusy. The reason behind this issue is when you call RefreshCommand it also sets the IsBusy property to true then it triggers the RefreshCommand again. new code is sth similar like this in my case.

<RefreshView Grid.Row="1" IsRefreshing="{Binding RefreshCommand.IsRunning}" Command="{Binding RefreshCommand}">

  • ABP Framework version: v7.4.0
  • UI Type: Angular
  • Database System: EF Core (PostgreSQL)
  • Tiered (for MVC) or Auth Server Separated (for Angular): yes
  • Exception message and full stack trace:

Package: "Volo.Abp.TextTemplateManagement.Application.Contracts-v8.0.0-rc.2" is up to date. Package: "Volo.Abp.Gdpr.Application.Contracts-v8.0.0-rc.2" is up to date. Package: "Volo.Abp.AspNetCore.Mvc.UI.Theme.LeptonX-v3.0.0-rc.1" is up to date. Package: "Volo.Abp.AspNetCore.Mvc.UI.Theme.LeptonX-v3.0.0-rc.1" is up to date. Checking installed npm global packages... Checking installed npm global packages... Updated @abp/ng.components to ~8.0.0-rc.2 in /angular/package.json. Updated @abp/ng.core to ~8.0.0-rc.2 in /angular/package.json. Updated @abp/ng.oauth to ~8.0.0-rc.2 in /angular/package.json. One or more errors occurred. (startIndex ('-1') must be a non-negative value. (Parameter 'startIndex') Actual value was -1.) System.AggregateException: One or more errors occurred. (startIndex ('-1') must be a non-negative value. (Parameter 'startIndex') Actual value was -1.) ---> System.ArgumentOutOfRangeException: startIndex ('-1') must be a non-negative value. (Parameter 'startIndex') Actual value was -1. at System.ArgumentOutOfRangeException.ThrowNegative[T](T value, String paramName) at System.String.ThrowSubstringArgumentOutOfRange(Int32 startIndex, Int32 length) at System.String.Substring(Int32 startIndex, Int32 length) at Volo.Abp.Cli.ProjectModification.NpmPackagesUpdater.ExtractVersions(String output) in D:\ci\Jenkins\workspace\abp-volo-release\abp\framework\src\Volo.Abp.Cli.Core\Volo\Abp\Cli\ProjectModification\NpmPackagesUpdater.cs:line 357 at Volo.Abp.Cli.ProjectModification.NpmPackagesUpdater.GetPackageVersionList(JProperty package, String workingDirectory) in D:\ci\Jenkins\workspace\abp-volo-release\abp\framework\src\Volo.Abp.Cli.Core\Volo\Abp\Cli\ProjectModification\NpmPackagesUpdater.cs:line 348 at Volo.Abp.Cli.ProjectModification.NpmPackagesUpdater.GetLatestVersion(JProperty package, Boolean includeReleaseCandidates, Boolean includePreviews, String workingDirectory) in D:\ci\Jenkins\workspace\abp-volo-release\abp\framework\src\Volo.Abp.Cli.Core\Volo\Abp\Cli\ProjectModification\NpmPackagesUpdater.cs:line 274 at Volo.Abp.Cli.ProjectModification.NpmPackagesUpdater.TryUpdatingPackage(String filePath, JProperty package, Boolean includePreviews, Boolean includeReleaseCandidates, Boolean switchToStable, String specifiedVersion) in D:\ci\Jenkins\workspace\abp-volo-release\abp\framework\src\Volo.Abp.Cli.Core\Volo\Abp\Cli\ProjectModification\NpmPackagesUpdater.cs:line 238 at Volo.Abp.Cli.ProjectModification.NpmPackagesUpdater.UpdatePackagesInFile(String filePath, Boolean includePreviews, Boolean includeReleaseCandidates, Boolean switchToStable, String specifiedVersion) in D:\ci\Jenkins\workspace\abp-volo-release\abp\framework\src\Volo.Abp.Cli.Core\Volo\Abp\Cli\ProjectModification\NpmPackagesUpdater.cs:line 179 at Volo.Abp.Cli.ProjectModification.NpmPackagesUpdater.<>c__DisplayClass18_0.<<Update>g__UpdateAsync|0>d.MoveNext() in D:\ci\Jenkins\workspace\abp-volo-release\abp\framework\src\Volo.Abp.Cli.Core\Volo\Abp\Cli\ProjectModification\NpmPackagesUpdater.cs:line 83 --- End of inner exception stack trace --- at System.Threading.Tasks.Task.WaitAllCore(Task[] tasks, Int32 millisecondsTimeout, CancellationToken cancellationToken) at System.Threading.Tasks.Task.WaitAll(Task[] tasks) at Volo.Abp.Cli.ProjectModification.NpmPackagesUpdater.Update(String rootDirectory, Boolean includePreviews, Boolean includeReleaseCandidates, Boolean switchToStable, String version) in D:\ci\Jenkins\workspace\abp-volo-release\abp\framework\src\Volo.Abp.Cli.Core\Volo\Abp\Cli\ProjectModification\NpmPackagesUpdater.cs:line 89 at Volo.Abp.Cli.ProjectModification.PackagePreviewSwitcher.SwitchSolutionsToPreview(List`1 solutionPaths) in D:\ci\Jenkins\workspace\abp-volo-release\abp\framework\src\Volo.Abp.Cli.Core\Volo\Abp\Cli\ProjectModification\PackagePreviewSwitcher.cs:line 83 at Volo.Abp.Cli.ProjectModification.PackagePreviewSwitcher.SwitchToPreview(CommandLineArgs commandLineArgs) in D:\ci\Jenkins\workspace\abp-volo-release\abp\framework\src\Volo.Abp.Cli.Core\Volo\Abp\Cli\ProjectModification\PackagePreviewSwitcher.cs:line 38 at Volo.Abp.Cli.Commands.SwitchToPreviewCommand.ExecuteAsync(CommandLineArgs commandLineArgs) in D:\ci\Jenkins\workspace\abp-volo-release\abp\framework\src\Volo.Abp.Cli.Core\Volo\Abp\Cli\Commands\SwitchToPreviewCommand.cs:line 22 at Volo.Abp.Cli.CliService.RunInternalAsync(CommandLineArgs commandLineArgs) in D:\ci\Jenkins\workspace\abp-volo-release\abp\framework\src\Volo.Abp.Cli.Core\Volo\Abp\Cli\CliService.cs:line 169 at Volo.Abp.Cli.CliService.RunAsync(String[] args) in D:\ci\Jenkins\workspace\abp-volo-release\abp\framework\src\Volo.Abp.Cli.Core\Volo\Abp\Cli\CliService.cs:line 77

  • Steps to reproduce the issue:

when I try to switch from 7.4.0 to 8.0 preview with abp cli i got this error. Any fix I can do?

  • ABP Framework version: v7.40
  • UI Type: Angular with maui
  • Database System: EF Core PostgreSql
  • Tiered (for MVC) or Auth Server Separated (for Angular): yes

Hello when you create a new template with maui. Android app looks ok and working fine. Still some problems on the shell menu with visibility but overall it is okay. But when i try to run the app on ios with physical device or simulator. it looks very bad. here are some screen shots so you can understand what i mean.

dark theme menu: avatar is not displayed good paddings and margins are weird.

dark theme tenants list: when it is empty empty image is overflowing.

dark theme user list: action list not working, empty image problem list is not looking ok.

settings page profile pictures. everything is looking weird.

light theme: search box is black

light theme menu: avatar problem

light theme: all the inputs are looking weird.

the question here is, is this related with maui or theming problem?

Also i realized that when you try to run the app on windows, shell flyout menu have some problems, sometimes menu items are not showing when you sign in and out. Sometimes their order has been mixed. So signout is coming before tenants. I think list is not refreshed so it keeps the buttons as it is.

What can be done to solve these problems? With v8 are the problems gonna be fixed or should i fix everything manually one by one for my project?

I have already replaced it, the thing was i didn't want to change whole gateway since i use some parts of the class. I override StartAsync method in that class, i was wondering can i do that for the webhook method, it seems for that i need to replace whole payment gateway. But i got the answer thank you. It would be helpful, if methods can be virtual on the next version.

Showing 51 to 60 of 111 entries
Made with ❤️ on ABP v9.0.0-preview Updated on September 20, 2024, 05:21