Could use a little help here. C# scripts won't run at all now

Hi,

Earlier today I rewrote an entire app for a client, in C#, instead of C# and Unityscript, which is what it originally was in. I did this because at the time (see other messages in the Windows 8 section), Unityscript wasn’t working. Plus, I have a plug-in I need to call that works fine in a test project, in C#. The client needs this TODAY, I used Unity successfully for the rest of it, so the Win 8 Phone failure is particularly aggravating.

This was a mind melting hate filled kind of day, but now it’s done. I rewrote some 3000 lines in C#, and it’s all wrapped up. It works flawlessly on Android, iOS, Mac, PC, and Web still.

BUT NOW IT DOES NOT WORK AT ALL on Windows 8 Phone.

I get no error messages. Nada. Just nothing works.

Where can I look on a Windows Phone to get any clues about what’s going on??

Thank you,
-Chilton

What happens? Does it crash? Blank screen? Unity logo stays up?

Try checking the log file - see http://docs.unity3d.com/Documentation/Manual/wp8-debugging.html for more details on how to do that.

-Kyle

Hi,

It throws the same error that the Javascript was throwing in this thread. There is a sample project is in this thread as well. I would REALLY like to know what’s going on, so if you can reproduce it (or can’t!) please let me know!

http://forum.unity3d.com/threads/202522-JS-vs-C-Only-one-or-the-other

-Chilton

Could you stop creating multiple threads, and post the error in the same thread?

It’s the same error. Different circumstances are creating it, from what I can tell. In this thread, C# scripts won’t run at all. That’s a different problem, but it’s the same serialization error. I’ll see if I can copy it again.

The error…

“A script behaviour has a different serialization layout when loading.
(Read 24 bytes but expected 32 bytes)
Did you #ifdef UNITY_EDITOR a section of your serialized
properties in any of your scripts?”

And no, I did not do that. That string does not exist anywhere in any of my scripts.

Also, this link http://forum.unity3d.com/threads/202522-JS-vs-C-Only-one-or-the-other contains a unitypackage that has one of the failing projects in it. I’m hoping that someone can shed some light on what is happening. I’ll take ANY solution right now, as I spent yesterday rewriting the entire app in C# hoping that would solve it. It did not.

Thank you,
-Chilton

Full dump of the UnityPlayer.log file…

Build from ‘’ branch, version is ‘4.2.1f4 (4d30acc925c2)’ (Release build).
Physical memory: 395 MB, commited memory limit: 180 MB.
PlayerConnection initialized from C:/Data/Programs/{A26B05AC-827C-6B49-8395-14156E154E10}/Install/Data (debug = 0)
PlayerConnection initialized network socket : 0.0.0.0 55206
Multi-casting “[IP] 30.162.49.44 [Port] 55206 [Flags] 2 [Guid] 2887934401 [EditorId] 3909670582 [Version] 1048832 [Id] WP8Player(10.0.1.23) [Debug] 0” to [225.0.0.222:54997]…
Direct3D:
Version: Direct3D 11.0 [level 9.3]
Renderer: Qualcomm Adreno 305 (WDDM v1.2) (ID=0x30303330)
Vendor: Qualcomm
VRAM: 96 MB
Initialize engine version: 4.2.1f4 (4d30acc925c2)
The class defined in script file named ‘CSTest’ does not match the file name!

(Filename: C:/BuildAgent/work/cac08d8a5e25d4cb/Runtime/Mono/MonoBehaviour.cpp Line: 1564)

A script behaviour has a different serialization layout when loading. (Read 24 bytes but expected 32 bytes)
Did you #ifdef UNITY_EDITOR a section of your serialized properties in any of your scripts?

(Filename: C:/BuildAgent/work/cac08d8a5e25d4cb/Runtime/Serialize/SerializedFile.cpp Line: 1163)

I checked, the class name and the file name are identical. No idea why it’s throwing that error. The other one is the one I see in the debugger on screen. And there’s no usage of UNITY_EDITOR anywhere in my project.

What about this error?

“The class defined in script file named ‘CSTest’ does not match the file name!”

As I said, “the class name and the file name are identical”. I have triple checked it.

Is it possible there’s a cached copy of some of these files somewhere, and they’re being used instead of the current copy during the build process?

I WANT to be wrong here somewhere.
I WANT this to be something stupid I’m doing, so I can fix it, and get this product shipped.

So please tell me, does this look wrong? Did I miss a spelling error somewhere? This is about as simple of a script as it gets.

1370569--68951--$Screen Shot 2013-09-27 at 7.52.26 AM.png

-Chilton

This works fine in the editor, of course. It also works fine on Android, iPhone, Mac, PC, and Web builds. It only goes crazy on Win 8 Phone.

Might be old files indeed. Did you try deleting the resulting visual studio project and rebuilding it?

Hey, it was worth a shot!

I changed it to build into a new folder. Even quit and restarted the machine.

But it didn’t affect the output. Same result. Same bug.

-Chilton

I’m sending in the entire project with my bug report. I sure hope this helps someone.

-Chilton

The package you had attached in the other thread missed a textMesh assigned to javascript script. After doing that, it works perfectly on my machine.

You should submit a bug report about that “Did you #ifdef…” error, though.