views:

58

answers:

2

Hello, we are making a project to run in ASP.Net on Mono/*nix

Our problem is that we develop on Windows, and we just build and test it every so often on Mono. So we have been having a lot of trouble recently with case sensitive filenames. Everything seems to work good in Windows and then we move to Mono and it's silently broken.(as in, it builds but won't run or parts of it don't work)

How would you recommend that I detect this while we are developing on Windows? Basically, how do we make the case-sensitive filenames look wrong in our code where the code works on Windows but not *nix?

A: 

You could use a compiler directive which would indicate when you are building for *nix systems which would validate the file paths.

James
+7  A: 

One thing you can do is use MONO_IOMAP so that Mono silently corrects the errors and emulates a case-insensitive file system:

http://www.mono-project.com/IOMap

Another thing you can use to actually find the issues is a new "profiler module" that logs every time a string triggers MONO_IOMAP and tells you where in your code it was created:

http://twistedcode.net/blog/post/2009/12/21/A-utility-to-help-porting-Windows-NET-applications-to-MonoUnix.aspx

jpobst
I wouldn't want MONO_IOMAP in production, but that profiler thing is awesome! Only problem is this won't help with things like stylesheets and images that come from using a case-sensitive webserver
Earlz