开发者

Any kind of way of detecting case-sensitve filename errors?

开发者 https://www.devze.com 2022-12-16 22:53 出处:网络
we are making a project to run in ASP.Net on Mono/*nix Our problem is that w开发者_高级运维e develop on Windows, and we just build and test it every so often on Mono. So we have been having a lot of

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

Our problem is that w开发者_高级运维e 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?


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


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

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号