Forum C# Building a DLL for Server Code?

Building a DLL for Server Code?

Postby DesmondWeindorf » August 25th, 2011, 8:36 am

I'm just starting out with Player.IO and I successfully got the entire dev environment to work, but I was using a modified dll from newGame. I've been trying to create my own server-side visual studio project to make the same dll but no luck. I copied over all the code, added the references, forced a build with .net 3.5 and have the Project's Output Type set to "Class Library".

I'm not familiar with building dlls, but there was one of the project name, i.e. ProjectName.dll, in the release folder after each build. So I tried loading that into the dev server but the following error pops up in a message box:

"Sorry, that is not a valid game dll. Valid game dlls must have a class that inherits from PlayerIO.GameLibrary.Game<Player> having a [RoomType(...)] attribute and must follow the rules for valid gamecode."

Also the following error is printed to the main status box:

Changing dll to user picked dll
- error: is not a valid Win32 application. (Exception from HRESULT: 0x800700C1)


I looked over all the tutorials, and did several google and forum searches and couldn't find anything similar to this issue.
I'm sure I'm doing something wrong in configuring Visual Studio for the build but I don't know what.
fyi: I'm using Visual Studio 2010 Ultimate on Win7 x64
DesmondWeindorf
 
Posts: 1
Joined: August 25th, 2011, 3:50 am

Re: Building a DLL for Server Code?

Postby Oliver » August 29th, 2011, 10:05 pm

I can´t tell you what your error is without getting much more detail about your setup. However, the idea with the development package is that you just copy out the NewGame folder and rename it to your project name. You can also rename the dll from inside visual studio, just hit project settings and change the name from in there.

Oliver
User avatar
Oliver
.IO
 
Posts: 1159
Joined: January 12th, 2010, 8:29 am

Re: Building a DLL for Server Code?

Postby GameHatcher » November 19th, 2013, 10:19 pm

Had a similar problem:

Changing dll to user picked dll
- error: Could not load file or assembly 'tempgame-a108d873fc274e5292af63bc9784c5b2.dll' or one of its dependencies. is not a valid Win32 application. (Exception from HRESULT: 0x800700C1)

Make sure to include your code in a namespace, IE
Code: Select all
namespace Game
{
    public class Player : BasePlayer {}

    [RoomType("SomeRoom")]
    public class GameRoom : Game<Player>
    {
        ...
    }
}
GameHatcher
Paid Member
 
Posts: 4
Joined: January 14th, 2013, 4:35 pm


Return to C#



cron