You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
One can use the second (raw types) function like this (not sure if it is correct):
unsafe {
var guid = typeof(IFabricQueryClient).GUID;
var clientRaw = IntPtr.Zero;
HRESULT hr = PInvoke.FabricCreateLocalClient(&guid, (void**)&clientRaw);
Debug.Assert(hr.Succeeded);
var cc = Marshal.PtrToStructure<IFabricQueryClient>(clientRaw);
Debug.Assert(cc != null);
};
But it is unclear how to use the first with out void*.
The other problem is that the dll cannot be loaded:
> dotnet run --project .\src\examples\examples.csproj
Unhandled exception. System.DllNotFoundException: Unable to load DLL 'FabricClient' or one of its dependencies: The specified module could not be found. (0x8007007E)
at Microsoft.ServiceFabric.PInvoke.FabricCreateLocalClient(Guid* iid, Void** fabricClient)
at Program.<Main>$(String[] args) in D:\code\cs\service-fabric-cs\src\examples\Program.cs:line 29
Service Fabric dlls are in system path, but in directory C:\Program Files\Microsoft Service Fabric\bin\Fabric\Fabric.Code. Maybe the DefaultDllImportSearchPaths should be customized.
Maybe related to microsoft/CsWin32#968
The text was updated successfully, but these errors were encountered:
Interesting. We touched close to this in microsoft/CsWin32#617, but it was a different use case and the fix won't help here. Can you file a new issue against CsWin32?
In idl file, the entry point function is declared like this:
The generated code is:
One can use the second (raw types) function like this (not sure if it is correct):
But it is unclear how to use the first with
out void*
.The other problem is that the dll cannot be loaded:
Service Fabric dlls are in system path, but in directory
C:\Program Files\Microsoft Service Fabric\bin\Fabric\Fabric.Code
. Maybe the DefaultDllImportSearchPaths should be customized.Maybe related to microsoft/CsWin32#968
The text was updated successfully, but these errors were encountered: