我想在ASP.NET 5项目中使用的库使用对象System.Web.Mvc.HtmlHelper
,但ASP.NET 5有新对象Microsoft.AspNet.Mvc.Rendering.IHtmlHelper
,我无法将其传递给该库:< / p>
错误CS1503参数1:无法转换 &#39; Microsoft.AspNet.Mvc.Rendering.IHtmlHelper&#39; 到&#39; System.Web.Mvc.HtmlHelper&#39; WebApplication8.DNX 4.5.1
我还有什么方法可以在ASP.NET 5中使用这个库吗?
查看(Index.cshtml):
@using ThinkGeo.MapSuite.MvcEdition
@using ThinkGeo.MapSuite.Core
@model ThinkGeo.MapSuite.MvcEdition.Map
@{
ThinkGeo.MapSuite.MvcEdition.HtmlHelperExtension.ThinkGeo(Html).Map(Model).Render();
}
解决方案资源管理器:
project.json:
{
"webroot": "wwwroot",
"userSecretsId": "aspnet5-WebApplication8-17759285-bc76-4a7f-9c31-af58fff1a1c9",
"version": "1.0.0-*",
"dependencies": {
"EntityFramework.SqlServer": "7.0.0-beta4",
"EntityFramework.Commands": "7.0.0-beta4",
"Microsoft.AspNet.Mvc": "6.0.0-beta4",
"Microsoft.AspNet.Mvc.TagHelpers": "6.0.0-beta4",
"Microsoft.AspNet.Authentication.Cookies": "1.0.0-beta4",
"Microsoft.AspNet.Authentication.Facebook": "1.0.0-beta4",
"Microsoft.AspNet.Authentication.Google": "1.0.0-beta4",
"Microsoft.AspNet.Authentication.MicrosoftAccount": "1.0.0-beta4",
"Microsoft.AspNet.Authentication.Twitter": "1.0.0-beta4",
"Microsoft.AspNet.Diagnostics": "1.0.0-beta4",
"Microsoft.AspNet.Diagnostics.Entity": "7.0.0-beta4",
"Microsoft.AspNet.Identity.EntityFramework": "3.0.0-beta4",
"Microsoft.AspNet.Server.IIS": "1.0.0-beta4",
"Microsoft.AspNet.Server.WebListener": "1.0.0-beta4",
"Microsoft.AspNet.StaticFiles": "1.0.0-beta4",
"Microsoft.AspNet.Tooling.Razor": "1.0.0-beta4",
"Microsoft.Framework.ConfigurationModel.Json": "1.0.0-beta4",
"Microsoft.Framework.ConfigurationModel.UserSecrets": "1.0.0-beta4",
"Microsoft.Framework.CodeGenerators.Mvc": "1.0.0-beta4",
"Microsoft.Framework.Logging": "1.0.0-beta4",
"Microsoft.Framework.Logging.Console": "1.0.0-beta4",
"Microsoft.VisualStudio.Web.BrowserLink.Loader": "14.0.0-beta4",
"MapSuiteCore": "",
"MvcEdition": ""
},
"commands": {
"web": "Microsoft.AspNet.Hosting --server Microsoft.AspNet.Server.WebListener --server.urls http://localhost:5000",
"gen": "Microsoft.Framework.CodeGeneration",
"ef": "EntityFramework.Commands"
},
"frameworks": {
"dnx451": {
"frameworkAssemblies": {
"System.Web": "4.0.0.0"
}
}
},
"exclude": [
"wwwroot",
"node_modules",
"bower_components"
],
"publishExclude": [
"node_modules",
"bower_components",
"**.xproj",
"**.user",
"**.vspscc"
],
"scripts": {
"postrestore": [ "npm install", "bower install" ],
"prepare": [ "gulp copy" ]
}
}