在Visual Studio 2012中,我创建了一个ASP.NET MVC 4项目,其中目标框架是.NET Framework 4.5.当我将项目部署到Web服务器时,它给出了以下错误:
Could not load file or assembly 'System.Web.Http.WebHost, Version=4.0.0.0, Culture=neutral,
PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file
specified.
Description: An unhandled exception occurred during the execution of the current web request.
Please review the stack trace for more information about the error and where
it originated in the code.
Exception Details: System.IO.FileNotFoundException: Could not load file or
assembly 'System.Web.Http.WebHost, Version=4.0.0.0, Culture=neutral,
PublicKeyToken=31bf3856ad364e35' or one of its dependencies.
The system …
Run Code Online (Sandbox Code Playgroud) 有谁知道已经实现的支持i18n(货币,格式等)的.NET框架的资金类型?我一直在寻找一个很好实现的类型,似乎找不到一个.
这是场景.我想将CKEditor用于表单上的富文本字段,但无论出于何种原因,我无法将内容从textarea获取到服务器并返回到页面而不会出现编码问题.这是我编写的小样本程序,试图弄清楚发生了什么.首先,我的视图模型:
HomeViewModel.cs
namespace CkEditorTest.Models
{
public class HomeViewModel
{
[Required]
[DataType(DataType.Html)]
[Display(Name = "Note")]
public string Note { get; set; }
}
}
Run Code Online (Sandbox Code Playgroud)
现在我的控制器:
HomeController.cs
using System.Web.Mvc;
using CkEditorTest.Models;
namespace CkEditorTest.Controllers
{
public class HomeController : Controller
{
public ActionResult Index()
{
return View(new HomeViewModel());
}
[HttpPost]
[ValidateInput(false)]
public ActionResult Index(HomeViewModel model)
{
return View(model);
}
}
}
Run Code Online (Sandbox Code Playgroud)
最后,我的观点是:
Index.cshtml
@model CkEditorTest.Models.HomeViewModel
@{
ViewBag.Title = "CKEditor Test";
}
@section head
{
<script type="text/javascript" src="@Url.Content("~/Scripts/ckeditor/ckeditor.js")"></script>
<script type="text/javascript" src="@Url.Content("~/Scripts/ckeditor/adapters/jquery.js")"></script>
<script …
Run Code Online (Sandbox Code Playgroud) 我一直无法找到这个问题的答案.我之前使用过Nu,并且有能力识别"宝石"的安装位置.例如,我喜欢保持我的项目结构:
MyProject |-MyProject.build |-MyProject.sln |-doc |-lib | |- ... my packages/gems ... |-sql |-src | |-app | |-test |-tools
正如您所看到的,我希望为我的解决方案中使用的第三方库保留一个"lib"文件夹.使用Nu,在我的项目的根目录中,我可以简单地使用命令:
nu install log4net --location=lib
这样做会获取所请求的包并将其放在我的"lib"文件夹中以便稍后进行引用.
那么,这可能是使用VS.NET中的"包管理器控制台"吗?我还需要使用其他方法吗?谢谢您的帮助!
我试图在我的一个项目中使用twitter bootstrap,我真正想要的是一个带有链接和页面中间HTML画布的标题.参考:
当我添加一个html canvas标签并给它一个宽度和高度时,我得到两个不良效果:
我希望画布留在页面的中心.