M B V R K
Cache response time issue
Hi friends,
I really don't know where to start :(
I'm working on a project that implemented using
Microservices
, one of those services called ElectionService
, this service is composed from 3 main projects ( ElectionService.Infrastructure, ElectionService.CQRS and ElectionService.API)
The ElectionService.CQRS is the Application layer for this service, the ElectionService.API is an ASP.Net core 8
web api that represents the entry point for this service.
As you will noticed the ElectionService.CQRS (Application layer) project is implemented using CQRS
pattern.
Recently I tried to add the caching mechanism to this service, so I used Distributed SqlServer Cache
and this is the first time I deal with it.31 replies
Why the shortcut of my App in the Startup Folder not starts??
Hi guys, hope you're doing well,
I have a
Console App
, in the program.cs
I have the following code:
Question:
Please, why my App don't start when windows starts ???
Massive thanks in advance <31 replies
Why Console App don't Auto Run at Windows Startup ?
Hi guys, hope you're doing well,
My question is very simple, I have a
Console App
, in the program.cs
, in the Main
method I have wrote this code :
The issue is in the part where I add the application to the auto run programs when Windows
startup using Registry
But it doesn't work and the app don't run when windows statup.
I go to this Registry
path Computer\HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run
and I found that the app registred itself as the code written but windows
don't auto start it up.
Please any fix for this issue?
Massive thanks in advance <38 replies
System.ComponentModel.Win32Exception: 'Access is denied'
Hi guys, hope you're all doing well
I'm working on a project, which needs to
start
and kill
some proccesses,
the issue is an excception
always thrown when try to kill processes, and the exception always said :
System.ComponentModel.Win32Exception: 'Access is denied'This is the file I have issue in : https://github.com/MbarkT3STO/OfficeDRPC/blob/main/OfficeDRPCCommander/Worker.cs The exception always happens in this part : All the apps including the app which contains the issue are
Console
targetting .NET Framework 4.7.2
Please any help or solution for this issue ?
Massive thanks in advance, with all love and respect <315 replies
Marshal.GetActiveObject("Word.Application") fall in exception
I'm working on a
.NET Framework
console application,
I have added the Microsoft.Office.Interop.Word
as a reference
I have wrote a line of code that get an object from the opening instance of Microsoft Word
as following :
The issue:
When I run the application, it always throw an exception for that line as shown in the attached video
Please does anyone has any idea or solution for this issue ?
Massive thanks in advance <33 replies
How to redirect Angular requests to ASP.NET Core backend host
Hi guys,
I'm working on a project using
Microservices
.
One of the services called FrontEndService.WEB
, it is a ASP.NET Core Angular
project.
The general idea about the project it is that the project is a URL Shortener
.
In that service, exactly in the Angular
part, I have a page which the user enter then write the URL
then the app shorten the url perfectly, at this point everything working fine.
The issue :
The Asp.net core
backend working on this host https://localhost:7166/
and the Angular
frontend working on the https://localhost:44482/
host (they're both on the same project)
The real-issue here is I want for example after shorten an url for example https://github.com/MbarkT3STO
to be https://localhost:44482/udRMtM2o
, now I want every request to that shortened url to redirect the user to https://localhost:7166/udRMtM2o
where localhost:7166
is the host of the ASP.NET Core backend.
I hope that I well cleared my idea and issue.
So, please is there any way to configure the Angular
part to automatically redirect any localhost:44482/shortCode
to localhost:7166/shortCode
??? of course except the home shortening page on localhost:44482/Shorten
Please if you have any idea to solve this issue share it with me and massive thanks in advance <334 replies
Github Copilot won't sign in on VS Codde
Please I'm using
VS Code
,
While I want to sign into my GitHub Copilot
account I see the option from the chat
panel. but even if I click nothing happening (supposed to show me a web page for login)
Please watch the attached video to understand.
I hope someone to provide any help about this issue,
Massive thanks in advance <33 replies
Why GRPC proto services generated classes not recognizable at compile-time ?
Hi friends,
I'm working on a project using
Microservices
architecture,
I have a shared project between services called Shared.Protos
, thais project contains the shared Protos
files between services.
I have a service called DatabaseService
, it is a GRpc
service project, who depends on the Shared.Protos
project.
As you know to make a proto grpc service you need to create a .proto
file for that service which contains some definitions, then building the project and then the Grpc.Tools
lib will automatically generate the classes.
The problem:
Everything is fine, when I build the project everything fine and good, but VS Code
shows some Compile-time
errors that indicate that VS Code
not found the new generated files/classes related to a new created proto service, and then VS Code
don't show them in the Intellisense
and this annoy me.
Please take a look on the attached video to understand.
Note :
The attached video I provided is shows the issue, but after the project built in the video the errors disappeared, but in most cases they didn't disappear till some period of time passed mostly 5 to 10 mins.
Please any help to fix this issue ? <33 replies
Is Okay to Extend the Domain Services by Application Services while implementing DDD
Hi friends,
I'm implementing a project using various advanced concepts, one of these concepts is
DDD (Domain Driven Design)
.
I have these layers Domain
, Infrastructure
and Application
layers.
In the Domain
layer I have some Domain Services
,
In the Infrastructure
as everyone knows I implemented the Repositories
In the Application
layer I have Application Services
, but here the confusing point for me, beacuse I let the Application Services
to extend the Domain Services
( by the inheritance ).
Example:
Domain Service:
Application Service:
Additional info:
In the Application
layer I have imlemented the CQRS
( Commands and Queries )
Question:
I'm confusing about letting the implementation as I showed you, or do a better approach.
I asked Github Copilot
and it told me that the Application layer
should not directly depend on Repositories
instead it should depend on Domain Services
and the Domain Services
should depend on Repositories
.
Please share with me your experience about this topic.
Massive thanks in advance <315 replies
Why Events Inserted Twice by EF Core?
Hi guys hope you're doing well,
I'm working on the following project : https://github.com/MbarkT3STO/ExpenovaApp
This project implemented using
Microservices Architecture
I have a service called Event-Sourcerer Service
, this service is responsible about applying event-sourcing
for others services databases records, of course this services communicate with others using RabbitMQ
and MassTransit
.
You can take a look on that service here : https://github.com/MbarkT3STO/ExpenovaApp/tree/main/Source/EventSourcererService
This service contains some Message Consumers
( classes where each one responsible to consume/handle a specific Queue
's messages ).
This service uses EF Core
with PostgreSQL
as data persistence.
After a Servie X
published an Event
that happened in it, and the Event Handler
from that Service X
will publish a copy of that event as a Message
to RabbitMQ
then the Consumers
from the Event-Sourcerer Service
will do their job by adding the message they are responsible for into the Event-Sources
database.
The issue: Is my consumers adding the event to database twice
To fix this issue I have created a service to handle the Deduplication mechanism
as separated class called DatabaseMessageDeduplicationService
you could take a look at it here : https://github.com/MbarkT3STO/ExpenovaApp/blob/main/Source/EventSourcererService/Services/DatabaseMessageDeduplicationService.cs
That class DatabaseMessageDeduplicationService
is responsible about processing messages too.
So, for proccessing messages this class contains a method called ProccessMessage
as following:
This method take a func
/method from a consumer
, that method consumer will contains the code to process the message and this DatabaseMessageDeduplicationService
only invoking it.8 replies
Ocelot json Help needed
Hi guys,
I'm working on a project using
Microservices architecture
, as you know with Microservices mostly we need an Api Gateway
,
I use Ocelot
for that purpose.
I have the following ocelot.json
:
The issue:
The issue is the categories controller will contains many actions, so I think that maybe the Ocelot
has a feature to tell it to automatically re-route /ExpenseService/api/Categories/{verb}
to /api/Categories/{verb}
.
I have tried /ExpenseService/api/Categories/{everything}
to /api/Categories/{everything}
, but not working.
Please is there any feature or a way to achieve that ??
Massive thanks in advance <34 replies
Is this DDD Specification a good practice or not?
Hi friends, hope you're all doig well,
I'm working on a project by implementing the
DDD
(Domain Driven Design
),
As you know that one of the core concepts of DDD
is the Specification Pattern
(Specifications),
I have written the following Specification
:
Please could you tell me if this is a good implementation for a specification, or this just wrong manner, because this is the first time I write a specification that needs to deal with database?
Please share with me your experience guys, and massive thanks in advance <3
For more info and definition of the Specification<T>
class take a look here :
https://github.com/MbarkT3STO/ExpenovaApp/blob/main/Source/ExpenseService/ExpenseService.Domain/Specifications/Specification.cs6 replies
✅ Is this a correct way or I just mad things wrong?
Hi friends, hope you're doing well,
I'm working on a project which using
CQRS
with MediatR
,
I have a PipelineBehavior
for handling exception happened in the Commands
and Queries
,
Lets talk in a brief manner about Commands
, most of Commands in this project are returning a result ( type ) inherited from CommandResult<TValue, TCommandResult
class, that class used to implement the Result Pattern
,
How should this work usually?
Before, every Command
if executed successfully it should return a result ( its type inherited from CommandResult<TValue, TCommandResult
) that represents a succeeded operation, but in an Exception
situation the command should return a result ( its type inherited from CommandResult<TValue, TCommandResult
) that represents a failed operation, and both Faild
and Succeeeded
are the same type.
What I did?
I removed the exception handling from commands, and moved itt to that PiplineBehavior
,
So that behavior should execute the command, if it executed successfully, then its fine, but if an exception happened it will check which TResponse
related to the request and create a Failed result then return iit.
Please take a look on that behavior here :
https://github.com/MbarkT3STO/ExpenovaApp/blob/20c83b6076e197af5097c6c862db6ad9e7d0d42e/Source/ExpenseService/ExpenseService.Application/Behaviors/ExceptionHandlingBehavior.cs
Where is the issue here?
The issue is a method called CreateFailedResult
iit checks and returns the correct result, and the issue is that method checks all the commands
and also queries
, nd as you will notice that at this moment there are many if
s there, and in the future handreds of commands and queries will be added.
The question:
Is this technique I used here has a value or I just did things wrong ?
Is there any other way to do the same ?
Do you have any suggestion about this situation ?
Massive thanks in advance, with love <35 replies
✅ Why Serilog don't log errors???
Hi guys,
I'm trying to logging using
Serilog
, the logging targeting File
,
Everything works fine, but when I log error it not logged,
In my program.cs
the registration of Serilog
I did as the following:
Please any help to fix this issue, and massive thanks in advance <37 replies
Is this a correct way or I just mad things wrong?
Hi friends, hope you're doing well,
I'm working on a project which using
CQRS
with MediatR
,
I have a PipelineBehavior
for handling exception happened in the Commands
and Queries
,
Lets talk in a brief manner about Commands
, most of Commands in this project are returning a result ( type ) inherited from CommandResult<TValue, TCommandResult
class, that class used to implement the Result Pattern
,
How should this work usually?
Before, every Command
if executed successfully it should return a result ( its type inherited from CommandResult<TValue, TCommandResult
) that represents a succeeded operation, but in an Exception
situation the command should return a result ( its type inherited from CommandResult<TValue, TCommandResult
) that represents a failed operation, and both Faild
and Succeeeded
are the same type.
What I did?
I removed the exception handling from commands, and moved itt to that PiplineBehavior
,
So that behavior should execute the command, if it executed successfully, then its fine, but if an exception happened it will check which TResponse
related to the request and create a Failed result then return iit.
Please take a look on that behavior here :
https://github.com/MbarkT3STO/ExpenovaApp/blob/20c83b6076e197af5097c6c862db6ad9e7d0d42e/Source/ExpenseService/ExpenseService.Application/Behaviors/ExceptionHandlingBehavior.cs
Where is the issue here?
The issue is a method called CreateFailedResult
iit checks and returns the correct result, and the issue is that method checks all the commands
and also queries
, nd as you will notice that at this moment there are many if
s there, and in the future handreds of commands and queries will be added.
The question:
Is this technique I used here has a value or I just did things wrong ?
Is there any other way to do the same ?
Do you have any suggestion about this situation ?
Massive thanks in advance, with love <35 replies
Logging code make my code a bit ugly
Hi friends,
Hope you're doing well,
I'm working on complex project, I use
CQRS
with MediatR
, in the Application
layer, also I'm using Serilog
( Console, and File) for logging, and here the issue, the lines of code I wrote to achieve a logging it makes my code a bit a ugly ( in my opinion), because in the Commands
and Queries
I wrote a logging at the beginning and a logging at the end .
The following is a Handle
method of a Command
:
Please I want you to share with me your experience about this,
<318 replies