Hi @gterdem,
yes indeed "app.UseCors();" was missing in the NewServiceHttpApiHostModule in OnApplicationInitialization. Seems to be an error in generation through abp-cli. but this did resolve it..
I thank you. I needed that fix. When will that be fixed in cli ?
I have the same error, please look here: https://support.abp.io/QA/Questions/3310/Howto-integrate-a-standard-template-pro-solution-as-new-service-in-a-microservice-solution
I did try to add my newservice to all appsettings, without success. i also did replace the port number of product-service with my new service in ocelot.json without success. so from my point liangshiwei advise didn't work for me
Hi,
till now i dont got any solution for this. Cors gives the error for the new service but i didn't any differerence to product service. The cors setting is exactly the same in appsettings.
I hope the support team will solve this for us. I need this fixed.
your document "https://docs.abp.io/en/commercial/latest/startup-templates/microservice/add-microservice" contain infos about the internal gateway and project reference which doesn't exist anymore, this one needs an update
if i try to follow you document how to change to mongodb. i receive a lot of errors in vs
The Port 44325 is port of the WebGateway, The Port 44472 is the port of my new microservice. I also receive this error on the PublicWebGateway which runs at Port 44353. Both Gateways are added to the new microservice appsettings Cors configuration per default. Also if i open the new microservice page in tye directly (https://localhost:44472) . it works fine but not if try to access it over an gateway. I did follow also the section about the gateways in your microservcice document any didn't find any difference.
I did reproduce it with these steps:
Yes here is one issue. I did follow your document "Add a new microservice to solution". I can reach my added new Service per Swagger on localhost port 44472. Thats site works.
But i get an error on both gateways if i try to select my new service, that it failed to fetch due Cors Origin:
Fetch error Failed to fetch https://localhost:44472/swagger/v1/swagger.json
Fetch error Possible cross-origin (CORS) issue? The URL origin (https://localhost:44472) does not match the page (https://localhost:44325). Check the server returns the correct 'Access-Control-Allow-*' headers.
I did double check the product service and compared with my new services. But i didn't find any differences so far.
Your document doesn't seem to be updated to 5.3.. There is no internal gateway, and the other gateways do not rely anymore on a project reference for the HttpApi Projects. I did update ocelot.json, the specific Module.cs, but still get the error.
Your document "Change Microservice project to use MongoDB Provider" changes everything to mongo. But i would only add one additional service with mongo. There is a difference , that both Migrations and Checker must work at same time.. and the document doesn't describe that clearly. I did look at eshoponabp and it a looks a bit different.
What can i do for the gateways to acceppt my new service `??
Maybe you could share a complete microservice-template-pro example based on mongdb with me.?
I was able to fix it my own by follwing these steps:
I am not sure what was the right step.. but now it works. please refund that credit
If you're creating a bug/problem report, please include followings:
AppMicro.PublicWeb terminated unexpectedly! System.TypeLoadException: Could not load type 'Volo.Abp.IAsyncInitialize' from assembly 'Volo.Abp.Core, Version=6.0.0.0, Culture=neutral, PublicKeyToken=null'. at System.Signature.GetSignature(Void* pCorSig, Int32 cCorSig, RuntimeFieldHandleInternal fieldHandle, IRuntimeMethodInfo methodHandle, RuntimeType declaringType) at System.Reflection.RuntimeConstructorInfo.<get_Signature>g__LazyCreateSignature|19_0() at System.Reflection.RuntimeConstructorInfo.GetParametersNoCopy() at System.Reflection.RuntimeConstructorInfo.GetParameters() at Autofac.Core.Activators.Reflection.ConstructorBinder..ctor(ConstructorInfo constructorInfo) at Autofac.Core.Activators.Reflection.ReflectionActivator.ConfigurePipeline(IComponentRegistryServices componentRegistryServices, IResolvePipelineBuilder pipelineBuilder) at Autofac.Core.Registration.ComponentRegistration.BuildResolvePipeline(IComponentRegistryServices registryServices, IResolvePipelineBuilder pipelineBuilder) at Autofac.Core.Registration.ComponentRegistration.BuildResolvePipeline(IComponentRegistryServices registryServices) at Autofac.Core.Registration.ComponentRegistryBuilder.Build() at Autofac.ContainerBuilder.Build(ContainerBuildOptions options) at Volo.Abp.Autofac.AbpAutofacServiceProviderFactory.CreateServiceProvider(ContainerBuilder containerBuilder) at Microsoft.Extensions.Hosting.Internal.ServiceFactoryAdapter`1.CreateServiceProvider(Object containerBuilder) at Microsoft.Extensions.Hosting.HostBuilder.CreateServiceProvider() at Microsoft.Extensions.Hosting.HostBuilder.Build() at Microsoft.AspNetCore.Builder.WebApplicationBuilder.Build() at AppMicro.PublicWeb.Program.Main(String[] args) in D:\repos\AppMicro\apps\public-web\src\AppMicro.PublicWeb\Program.cs:line 28
Generate a new microservice solution with: abp new AppMicro -t microservice-pro -u blazor-server
start infrastructure with powershell ./up.ps1
tye run and check logs for Blazor and Public-web. Both contain same error :
Could not load type 'Volo.Abp.IAsyncInitialize' from assembly 'Volo.Abp.Core, Version=6.0.0.0, Culture=neutral, PublicKeyToken=null'.
Was it removed in 5.3 without updating the microservice template. or where is my mistake ?
I know that a pro template is not a microservice. But i want to move the relevant parts from pro template solution to a new microservice .. Thats why asked for a guide.. I think its a valid option for moving towards a microservice solution
I have built up a microservice solution and would like to add an other project based on the standard template pro as service to it. At the end my solution will look similiar to you eshoponabp project, where you use postgres and mongo as db.
i did follow the doc from here: https://docs.abp.io/en/commercial/latest/startup-templates/microservice/add-microservice to generate a service with the same name. It seems that the parameter for the database provider is ignored (-d mongo) . It always creates a service based on EF. Is this a bug ?
I did also compare the generated files from the new service with the files from the standard template pro and found differences in the module files and structure. I would like to know howto modify the files from the standard template to be able to use it as service in the microservice solution.
As far as i can see, i need to edit all csproj files and *module.cs files to remove unneeded things and add at least something like "typeof(AbpDddDomainModule)," etc., remove Identity Project, move some files to other projects and so on.
I would like to have a detailed step by step guide for a demo project like eventhub /boookstore to see howto integrate it in a microservice solution, Any help would be great