ramirezdu06 0 Posted August 27, 2019 hi, i want to create an extension.dll in c# but it doesn't work. I use only the c# code on : https://community.bistudio.com/wiki/Extensions screen of my code thx Share this post Link to post Share on other sites
Dedmen 2716 Posted August 28, 2019 If you want help you gotta give more details, what doesn't work, what does the RPT say? Share this post Link to post Share on other sites
ramirezdu06 0 Posted August 28, 2019 yes sorry i have see the rpt and he say that : 0:39:21 Call extension 'MyExtension' could not be loaded: Ressources systeme insuffisantes pour terminer le service demande | in english : 0:39:21 Call extension 'MyExtension' could not be loaded: insufficient system resources to complete the requested service edit : i have removed battleye and when i call i don't have any error in rpt but it doesn't work too. Share this post Link to post Share on other sites
Dedmen 2716 Posted August 28, 2019 3 hours ago, ramirezdu06 said: Ressources systeme insuffisantes pour terminer le service demande battleye. 3 hours ago, ramirezdu06 said: i don't have any error in rpt but it doesn't work too what does it return? empty string? have you tried attaching a debugger and seeing what happens? Share this post Link to post Share on other sites
ramirezdu06 0 Posted August 28, 2019 yes he return an empty string "" and debugger ? i have change the output.Append(function) to output.Append("Teste") but he return the same value an empty string Share this post Link to post Share on other sites
killzone_kid 1332 Posted August 28, 2019 Does it write in .rpt "Test-Extension v1.0"? Share this post Link to post Share on other sites
ramirezdu06 0 Posted August 28, 2019 59 minutes ago, killzone_kid said: Does it write in .rpt "Test-Extension v1.0"? No i don't have "Test-Extension v1.0" in .rpt Share this post Link to post Share on other sites
killzone_kid 1332 Posted August 29, 2019 Have you renamed your 64 bit compiled dll into xxxx_x64.dll? Share this post Link to post Share on other sites
ramirezdu06 0 Posted August 29, 2019 33 minutes ago, killzone_kid said: Have you renamed your 64 bit compiled dll into xxxx_x64.dll? yes, i have changed the build in visual studio to x64 but when the file is compiled i don't see the "_x64" so i rename it but it doesn't work Share this post Link to post Share on other sites
killzone_kid 1332 Posted August 29, 2019 What can I say, try following one of the c# tutorials to the letter, you obviously doing something wrong. Sorry can’t help you more, more of a c++ guy myself Share this post Link to post Share on other sites
ramirezdu06 0 Posted August 29, 2019 thx but wich tutorials ? because this tutorial : http://maca134.co.uk/tutorial/write-an-arma-extension-in-c-sharp-dot-net/ is outdated and i need a "namespace" ? or not ? because the class "MyExtension" is not in a namespace edit : i have do that with your code : "http://killzonekid.com/arma-scripting-tutorials-how-to-make-arma-extension-part-1/" and it work perfecly but in c# nope Share this post Link to post Share on other sites
Dedmen 2716 Posted August 29, 2019 The RPT will say something about your extension, either that it was loaded, or that it wasn't found, or that there was an error loading it. It will say something. Find it, it will help you find out what's wrong. Share this post Link to post Share on other sites
ramirezdu06 0 Posted August 29, 2019 yes, i will make a test and send a new message with information Share this post Link to post Share on other sites
ramirezdu06 0 Posted August 29, 2019 i have found the bug and it worked | you need to remove the if,else,endif | my code : https://pastebin.com/PK44pg4q and for the people who like visual basic i have convert the c# to visual basic and i have test it and it work so the code is : https://pastebin.com/aua8QsyD Share this post Link to post Share on other sites
killzone_kid 1332 Posted August 30, 2019 14 hours ago, ramirezdu06 said: you need to remove the if,else,endif What? Where? There is none in the code you claim didnt work Share this post Link to post Share on other sites
Larrow 2822 Posted August 30, 2019 2 hours ago, killzone_kid said: What? Where? There is none in the code you claim didnt work Erm its right there in the picture of his code in the first post. #if #else #endIf 16 hours ago, ramirezdu06 said: i have found the bug and it worked | you need to remove the if,else,endif Are you sure you setup your build configurations and set the symbol WIN64 in your projects build properties? Share this post Link to post Share on other sites
ramirezdu06 0 Posted August 30, 2019 i don't add the symbol WIN64 but i have change the build property to x64 | the project if you want to see the code : https://mega.nz/#!4RdGAQDA!QO-brdBBQXZwfgT5s1yTro0Lngx_wpy_m0BdUP8D80E and when arma crash because the .dll have a bug or an error the .rpt say nothing and i have disable battleye because he say "'MyExtension' could not be loaded: insufficient system resources to complete the requested service" and when the .dll is compiled i rename it with _x64 example : "ClassLibrary1_x64.dll" Share this post Link to post Share on other sites
killzone_kid 1332 Posted August 30, 2019 1 hour ago, Larrow said: Erm its right there in the picture of his code in the first post. #if #else #endIf Ha! I was looking for if else not #if #else 🙀 Share this post Link to post Share on other sites
ramirezdu06 0 Posted August 30, 2019 if you have a question tell me Share this post Link to post Share on other sites
tyger249 0 Posted August 31, 2019 What kind of project would you start in Visual Studio 2019? Neither Class Library (Universal Windows) nor Class Library (.Net Framework) seem to work for me for creating a working .dll. Share this post Link to post Share on other sites
Larrow 2822 Posted September 1, 2019 21 hours ago, tyger249 said: Class Library (.Net Framework) ^^this. Application framework needs to be NET 4.5.2 for unmanagedExports v1.2.7. A3_test_extension_C# - Includes both A3 addon and C# solution. Solution includes... build symbols WIN64 and WIN86( which will define the correct DLLExport attribute for each entry point Ver, Func and Args based on build configuration and platform ) also set the correct assembly name for each build in .csproj Solution configuration R_86 platform x86 will build A3_test.dll Solution configuration R_64 platform x64 will build A3_test_x64.dll 2 1 Share this post Link to post Share on other sites
tyger249 0 Posted September 1, 2019 8 hours ago, Larrow said: ^^this. Application framework needs to be NET 4.5.2 for unmanagedExports v1.2.7. A3_test_extension_C# - Includes both A3 addon and C# solution. Solution includes... build symbols WIN64 and WIN86( which will define the correct DLLExport attribute for each entry point Ver, Func and Args based on build configuration and platform ) also set the correct assembly name for each build in .csproj Solution configuration R_86 platform x86 will build A3_test.dll Solution configuration R_64 platform x64 will build A3_test_x64.dll Yeah, that works. Thanks for the reply. I must've missed something the first time I tried it out. Now my next quest is in figuring out why accessing a database and reading/modifying data from it crashes my game in the editor debug console and my dedicated server but runs fine in KillzoneKid's extension tester. Right now I'm probably going to test out if running the database query on a thread and accessing it later will work. Share this post Link to post Share on other sites
Dedmen 2716 Posted September 3, 2019 On 9/1/2019 at 9:40 PM, tyger249 said: crashes my game Probably your extension crashing, have you tried attaching a debugger and seeing what happens? Share this post Link to post Share on other sites
tyger249 0 Posted September 10, 2019 I feel like my issue arises from my dll using another dll (StackExchange.Redis.StrongName) to perform it's work. The dll works correctly when it doesn't use another dll. It seems like KillzoneKid's extension tester might correctly load all the available dlls into the tester but Arma fails to load another dll even if mine requires it. I wonder how could I fix that. Share this post Link to post Share on other sites
Dedmen 2716 Posted September 11, 2019 13 hours ago, tyger249 said: It seems like KillzoneKid's extension tester might correctly load all the available dlls into the tester but Arma fails to load another dll even if mine requires it. I wonder how could I fix that. Where did you place your dll? It should probably go into Arma root directory. and not next to your dll in your @mod folder Share this post Link to post Share on other sites