Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
"Unable to load DLL 'Tilengine'
#1
Ok I've run "install", seems to copy some DLLs to some x64 folders.

Opening "Platformer.csproj" caused Visual Studio Community 2017 to upgrade the project, shouldn't be a problem.

Running it gives the error in the screenshot, in Tilengine.cs, line 374.

Got to be honest, I'm a bit new to setting up a C# project from scratch, most of what I've done with C# is in Unity and console projects that didn't need any external libraries.  I tried adding "Tilengine.dll" as a reference to the project, but it gave an error; "A reference to Tilengine.dll could not be added. Please make sure the file is accessible, and that it is a valid assembly or COM component." so no luck there.


Attached Files Thumbnail(s)
   
Reply
#2
This one is easy Smile

The Tilengine.dll and SDL2.dll files must be in the same folder than the main executable, and must match your windows architecture. So:
  • iif you are using Windows 32-bit, copy the files located in win32 folder where the executable is
  • if it's Windows 64-bit, copy the files from x64 instead.
Let me know if it's ok now!
Reply
#3
Progress... of a kind!  At least I'm getting a new error.

Got a "File not found" exception in Tilemap.FromFile, went up through the call stack to see it's loading a map, but the map does indeed seem to be there!  What could be the problem?

Screenshot attached, shows the asset folder is correctly set, and the filename to be loaded, and windows explorer showing the file does exist in the expected location.


Attached Files Thumbnail(s)
   
Reply
#4
Oh I see, it's related to the project configuration... I'll have to fix it Sad

  1. The Tilengine.dll and SDL2.dll files should be inside the "samples\csharp" directory where the "platformer.csproj" project file resides, not inside the "bin\Debug" temporary folder.
  2. You have to go to Project properties / Debug, and in the "Working directory" field put the full path to your "samples\csharp" folder. For example in my case it's "D:\Tilengine\samples\csharp".
I use Visual C# Express 2010 in spanish so I can't attach a proper screen capture, but I think these options are in the same place in newer releases.

I apologize, please let me know if it works now...
Reply
#5
That did it! Thanks Smile I see the Sonic stage with the CRT filter and can scroll around with the arrow keys.

So is there an update coming from you that will mean we don't have to do that "working directory" setup? If so, I'll hold off before making a tutorial but I need to make some sort of playable prototype anyway first.
Reply
#6
Congratulations! I'm glad you have it working :-)

Yes, I'll rearrange a bit the C# samples setup so it works out of the box just as the C and Python samples already do. In that commit I'll put the documentation sources too. I'll write a post here when it's done
Reply
#7
Hi,

I updated the C# sample project some days ago, both in GitHub and itch.io downloads, and started publishing documentation. I posted a thread about it. Did you see the changes?
Reply
#8
This works out of the box now Smile csharp Platformer example project builds and runs just fine in Visual Studio 2017.
Reply


Forum Jump:


Users browsing this thread: 5 Guest(s)