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
When loading module by name, module and its dependencies must be placed in garrysmod/lua/bin/Modules/ModuleName where ModuleName is exactly module's main assembly name. Any typo in folder name will make module load process impossible. We can override default publish folder name from publish to publish/$(AssemblyName). For example, for a module with name TestModule, the output of dotnet publish TestModule.csproj -c Release will be located at bin\Debug\net5.0\publish\TestModule and one can simply copy folder to Modules or ship to another machine or user without fear of typos.
Technical implementation
We can add GmodNET.API.props file to a GmodNET.API NuGet package, so any project referencing API will have its publish dir name overridden. Since .props files are imported before the main body of the project file, developers can override publish dir name themself one more time.
The text was updated successfully, but these errors were encountered:
What about having json file that specifies what assembly should be loaded?
Do you mean to have the user add an additional configuration .json?
E.g: mymodule.json
{
"startup": "MyDllName.dll"
}
?
If that is what you mean I'd be against that since it adds a layer of complexity. I agree with @Stat1cV01D that elimination of confusion is something to go for. I believe adding another json is just something else you can forget as a new developer.
It seems like implementing this with only NuGet .props and .targets is not possible due to the properties evaluation order. We can fix achieve desired behavior by writing our own SDK, but this can wait for future releases.
Description
When loading module by name, module and its dependencies must be placed in
garrysmod/lua/bin/Modules/ModuleName
whereModuleName
is exactly module's main assembly name. Any typo in folder name will make module load process impossible. We can override default publish folder name frompublish
topublish/$(AssemblyName)
. For example, for a module with name TestModule, the output ofdotnet publish TestModule.csproj -c Release
will be located atbin\Debug\net5.0\publish\TestModule
and one can simply copy folder toModules
or ship to another machine or user without fear of typos.Technical implementation
We can add
GmodNET.API.props
file to aGmodNET.API
NuGet package, so any project referencing API will have its publish dir name overridden. Since.props
files are imported before the main body of the project file, developers can override publish dir name themself one more time.The text was updated successfully, but these errors were encountered: