我们正在制作一个在 Mono/*nix 上的 ASP.Net 中运行的项目
我们的问题是我们在 Windows 上开发,并且我们只是在 Mono 上经常构建和测试它。因此,我们最近在区分大小写的文件名方面遇到了很多麻烦。在 Windows 中,一切似乎都运行良好,然后我们转向 Mono,它却悄无声息地损坏了。(例如,它可以构建,但无法运行,或者部分无法工作)
您建议我如何在我们开发时检测到这一点在 Windows 上?基本上,我们如何使代码中区分大小写的文件名看起来错误,而该代码在 Windows 上运行但在 *nix 上运行却不行?
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?
发布评论
评论(2)
您可以做的一件事是使用 MONO_IOMAP,以便 Mono 默默地更正错误并模拟不区分大小写的文件系统:
http://www.mono-project.com/IOMap
您可以用来实际查找问题的另一件事是一个新的“分析器模块”,它会在每次字符串触发 MONO_IOMAP 时进行记录,并告诉您代码中的位置创建:
http://twistedcode.net/blog/post/2009/12/21/A-utility-to-help-porting-Windows-NET-applications-to-MonoUnix.aspx
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
您可以使用编译器指令来指示您何时构建 *nix 系统以验证文件路径。
You could use a compiler directive which would indicate when you are building for *nix systems which would validate the file paths.