复制剃刀意见为自托管NancyFx? [英] Copy Razor-Views for Self-hosting NancyFx?

查看:170
本文介绍了复制剃刀意见为自托管NancyFx?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开始了使用NancyFx用剃刀视图的简单MVC-网站( .cshtml )和 Nancy.Hosting.Aspnet ,使用IIS防爆preSS。现在,我使用适应该项目自托管服务 Nancy.Hosting.Self (和TopShelf)。

I started out with a simple MVC-site using NancyFx with Razor-views (.cshtml) and Nancy.Hosting.Aspnet, using IIS Express. Now I adapted the project to a self-hosting service using Nancy.Hosting.Self (and TopShelf).

不过,提供的意见,看来我需要从无更改其属性&安培; 不要复制内容&安培; 复制如果新,所以他们将被复制到 \\ BIN \\调试\\

However, to provide the Views, it seems I need to change their properties from None & Do not copy to Content & Copy if newer, so they are copied to .\bin\Debug\.

一个结果是,到Views变化将不会显示/更新,直到重新启动。即使在调试模式,缓存,默认情况下禁用的工作时。我知道这只是一个小麻烦,但仍然是一个烦恼,这是好的,能够尝试(CS)HTML的改变的时候了。所以我想知道有没有办法解决这个问题,例如具有将文件设置为 prevent副本,如果新的

One consequence is that changes to the Views will not be shown/updated until a restart. Even when working in debug-mode, where caching is disabled by default. I know this is just a minor annoyance, but still an annoyance, and it is nice to be able to try (cs)HTML-changes right away. So I was wondering is there a way to fix this, e.g. to prevent having to set the files to Copy if newer?

推荐答案

您可以提供自定义的根路径直接看的意见,你的项目文件夹。

You can provide a custom root path that looks directly at the views folder in your project.

这篇关于复制剃刀意见为自托管NancyFx?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆