// I found a way to fix my problem.. it took me a week of research
// So here it is:
// How to generate WCF Service (.Net Framework 4.8) proxy in client (.Net 6.0):
// If using a callback I need duplex communication
[ServiceContract(CallbackContract = typeof(IEventsService))]
// Just do as explain here but dont expect it to work for Client .Net 6.0 it will only work for client .net Framework 4.8 as Wcf service is .Net Framework 4.8
//https://www.codeproject.com/articles/663333/understanding-events-in-wcf#:~:text=Background%20While%20events%20in%20WCF%20are%20nothing%20more,typical%20relationship%20between%20a%20client%20and%20a%20service.
// so here is what I need to do:
// Use netHttpBinding for duplex
// Put this on web.config of your Wcf service
<service name="HomeManagerWcfService.HomeManagerService" behaviorConfiguration="HomeManagerServiceBehavior">
<host>
<baseAddresses>
<add baseAddress="http://localhost:53318/HomeManagerService"/>
</baseAddresses>
</host>
<endpoint address="" binding="netHttpBinding" contract="HomeManagerWcfService.IHomeManagerService"/>
<!--<endpoint address="" binding="wsDualHttpBinding" contract="HomeManagerWcfService.IHomeManagerService"/>-->
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
</service>
</services>
<behaviors>
<serviceBehaviors>
<!-- HomeManagerService Behavior -->
<behavior name="HomeManagerServiceBehavior">
<serviceMetadata httpGetEnabled="true"/>
<serviceDebug includeExceptionDetailInFaults="true "/>
</behavior>
</serviceBehaviors>
</behaviors>
// Generate files for your client proxy on VisualStudio.Tools.Command line.Developer command prompt
svcutil http://localhost:53318/HomeManagerService.svc
//copy both files generated in your client project.
// if using the VS UI generator (Managed connected service) it won't work, there is a bug in it.
// I also need System.ServiceModel.Http
// & I need System.ServiceModel.Duplex
// in the client
// use NetHttpBinding for duplex communication
// Use IHomeManagerServiceCallback to implement the callback function where you want it to run the callback
InstanceContext iCntxt = new InstanceContext(this); // "this" is where i implement the callback for my case
var endpointAddress = new EndpointAddress("http://localhost:53318/HomeManagerService.svc");
var binding = new NetHttpBinding();
var factory = new DuplexChannelFactory<IHomeManagerService>(iCntxt, binding, endpointAddress);
var clientWCF = factory.CreateChannel();
EmailMessage emailMessage = new EmailMessage();
emailMessage.Name = "ww23";
emailMessage.Body = "SSWDDW223";
emailMessage.EmailAddress = "EMAIL AD dsf2223";
clientWCF.SubscribeCalculatedEvent(); // where we register to the event on the server
clientWCF.AddEmail(emailMessage); // the callback event call is in this function on the server