在 monodevelop 中部署 monorail Web 应用程序
我认为这个问题是 MonoDevelop 特有的。
我有一个测试单轨解决方案,当我从 monodevelop 运行它时工作正常,但当我使用“部署到网络”时遇到问题。
我认为问题是我的所有 NVelocity 视图文件(在“View/”目录内)都被嵌入到程序集中,并且 xsp4 期望它们实际上被复制到部署目录?
我可以告诉 Monorail/NVelocity 查找该程序集中的视图,还是有更简单的方法告诉 Monodevelop 将顶级目录(如视图)下的所有文件复制到部署目录?
我发现我可以显式设置每个文件的部署属性,但我无法使其正常工作。当我将其设置为“包含在部署中”和“使用项目相对路径”时,它将它们放入“/bin/Views/”中。然后,当我从 '' 运行 xsp4 时,它期望视图相对于该目录。
This question is specific to MonoDevelop I think.
I've got a test monorail solution that works fine when I run it from monodevelop but I'm having a problem when I use 'Deploy to web'.
I think the issue is that all of my NVelocity view files (inside a 'View/' directory) are being embedded into the assembly and xsp4 is expecting them to actually be copied to the deployment directory?
Can I either tell Monorail/NVelocity to find the views inside of this assembly or is there an easier way to tell Monodevelop to copy all files under a top level directory (like Views) to the deployment directory?
I see that I can explicitly set deployment properties for each file but I haven't been able to get that to work. When I set it to 'Include in deploy' and to 'Use project relative path' it puts them inside of "/bin/Views/". Then when I run xsp4 from '' it is expecting Views to be relative to that directory.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
最简单的方法是右键单击视图文件夹中的文件并选择构建操作“内容”,然后在执行“部署到 Web”时将它们复制到部署目录中的相同文件夹结构。但是,如果它们位于引用的项目中,这可能会有点棘手,但是您可以在单轨视图引擎配置中调整 viewPathRoot 以指向正确的位置。
The easiest way is to right click the files in your view folder and select Build Action "Content" then they are copied to the same folder structure in your deployment directory when you do "Deploy to Web". However this might be a little tricky if they are in a referenced project, but then you can adjust your viewPathRoot in your monorail view engine configuration to point to the right place.