Comments (4)
Using "LoadLibrary" suggested solved the issue.
from cswin32.
Would specifying System32 | ApplicationDirectory | AssemblyDirectory
be sufficient here? If not, what would be required?
from cswin32.
FabricCreateLocalClient
function comes from FabricClient.dll
. This dll lives inside directory C:\Program Files\Microsoft Service Fabric\bin\Fabric\Fabric.Code
and is in the system env:PATH variable.
So to make this work the code needs to find FabricClient.dll in the right directory.
I am not familiar with the dll searching in cs. But given the generated code, I think
[DefaultDllImportSearchPaths("C:\Program Files\Microsoft Service Fabric\bin\Fabric\Fabric.Code")]
might work?
Is it possible to look up dll in the system PATH like native application?
from cswin32.
You can't specify a path like that. The attribute only takes a flags enum. You can see the options here.
I'm not aware of any setting that will simply search all the directories in PATH for dependencies, even in native applications. I think native apps have the same set of options that is exposed to .NET applications through that enum.
Note that, per the docs in the enum, an AddDllDirectory
win32 function exists whereby you can explicitly add a directory to the dll search path. Then you'd need to set the UserDirectories
flag on the enum so that .NET would honor that.
Frankly though, I think the simplest path for you may be to find the file yourself and load it using LoadLibrary
. Once loaded, these p/invokes will work regardless of this enum.
from cswin32.
Related Issues (20)
- Generate overload that sets `dwLength`? HOT 2
- Missing compiler required member HOT 2
- CA1416: is only supported on: 'windows' 5.1.2600 and later HOT 3
- Can't import Windows.Win32.System.Threading HOT 1
- Regression with `ReadFile` and `WriteFile` for `SafeHandle` HOT 1
- when wideCharOnly is true (default) specifying explicit ascii prefixed functions in NativeMethods.txt will result in it silently ignored
- IncludeAssets=all advice causes problems with NuGet packages HOT 7
- Why is `SHGetStockIconInfo` function is not supported by generator? HOT 1
- PROCESS_MITIGATION_REDIRECTION_TRUST_POLICY (I assume most PROCESS_MITIGATION_*) structs not fully generated HOT 2
- Using cswin32 projected types in class libraries results in CS0051 Inconsistent accessibility HOT 3
- CS8785 due to missing `System.Text.Encodings.Web` assembly in Dev16.11 HOT 4
- Size calculation with VariableLengthInlineArrays / More docs HOT 4
- GetModuleHandle with null parameter. HOT 2
- `FindFirstFileExFromApp` generate `void*` at `lpFindFileData` HOT 1
- How to create instance for `IDesktopWallpaper` COM interface HOT 3
- Add EntryPoint #865 IsElevationRequired HOT 1
- CS8785 when adding a locally built copy of Windows.Win32.winmd HOT 4
- structs with VariableLengthInlineArray and SizeOf(0) HOT 4
- CsWin32 generates `SafeHandle` parameter for `LPPROC_THREAD_ATTRIBUTE_LIST` in `CreateRemoteThreadEx` HOT 6
- SafeHandle overload should be generated for functions with `out` parameters HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cswin32.