# csbridge4j **Repository Path**: JavaCorp/csbridge4j ## Basic Information - **Project Name**: csbridge4j - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2024-03-20 - **Last Updated**: 2024-05-11 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # CSBridge4J ## hostfxr api版本 ### 差异 - C#增加了一个Program.cs 名字和内容不能改, 不然取不到delegate - 依赖工作目录的[libhostfxr.so](http://libhostfxr.so), 如果在系统PATH能找到也行 - dotnet目录传递.net sdk根目录就行 - dotnet战斗库工程proj里配置"生成运行时配置", 参考CSharpLib.csproj ``` true ``` - createAppDomain不传递dll路径, 传4里面生成的CSharpLib.runtimeconfig.json文件的路径 - 调用initMessageHandler使用的参数assemblyName, 必须使用平台相关的路径分割符号, 在windows下使用\\, linux下使用/ ```java // windows正确 String dotnetDllPath = ".\\dll\\BattleService.dll" // linux正确 String dotnetDllPath = "./dll/BattleService.dll" appDomain.initMessageHandler(dotnetDllPath, "CSharpLib.Program, CSharpLib", "Initialize", handler); ```