【发布时间】:2016-07-14 20:01:28
【问题描述】:
我是 .net 核心应用程序的新手。我正在开发一个针对“net461”(完整框架)的 asp.net 核心(1.0 -> MVC6)。以下是project.json:
{
"dependencies": {
"KendoUICore": "2016.2.607",
"Microsoft.AspNetCore.Razor.Tools": {
"version": "1.0.0-preview1-final",
"type": "build"
},
"Microsoft.Dnx.Compilation.CSharp.Abstractions": "1.0.0-rc1-final",
"Microsoft.Extensions.CompilationAbstractions": "0.0.1-alpha",
"System.Linq.Queryable": "4.0.0",
"Telerik.DataAccess.Core": "2016.1.224.1",
"Microsoft.AspNetCore.Diagnostics": "1.0.0",
"Microsoft.AspNetCore.Mvc": "1.0.0",
"Microsoft.AspNetCore.Mvc.Formatters.Xml": "1.0.0",
"Microsoft.AspNetCore.Server.IISIntegration": "1.0.0",
"Microsoft.VisualStudio.Web.BrowserLink.Loader": "14.0.0",
"Microsoft.AspNetCore.StaticFiles": "1.0.0",
"Microsoft.Extensions.Configuration.EnvironmentVariables": "1.0.0",
"Microsoft.Extensions.Configuration.Json": "1.0.0",
"Microsoft.Extensions.Configuration.UserSecrets": "1.0.0",
"Microsoft.Extensions.Logging": "1.0.0",
"Microsoft.Extensions.Logging.Console": "1.0.0",
"Microsoft.Extensions.Logging.Debug": "1.0.0",
"Microsoft.AspNetCore.Server.Kestrel": "1.0.0",
"Microsoft.ApplicationInsights.AspNetCore": "1.0.0",
"Microsoft.AspNet.Identity.Owin": "2.2.1",
"Microsoft.Owin.Host.SystemWeb": "3.0.1",
"Microsoft.AspNetCore.Session": "1.0.0",
"jQuery": "3.0.0.1"
},
"tools": {
"Microsoft.AspNetCore.Razor.Tools": {
"version": "1.0.0-preview1-final",
"imports": "portable-net45+win8+dnxcore50"
},
"Microsoft.AspNetCore.Server.IISIntegration.Tools": {
"version": "1.0.0-preview1-final",
"imports": "portable-net45+win8+dnxcore50"
},
"Microsoft.Extensions.SecretManager.Tools": {
"version": "1.0.0-preview1-final",
"imports": "portable-net45+win8+dnxcore50"
}
},
"frameworks": {
"net461": {
"dependencies": {
"OmniPayDataModel": {
"target": "project"
}
}
}
},
"buildOptions": {
"emitEntryPoint": true,
"preserveCompilationContext": true
},
"publishOptions": {
"include": [
"wwwroot",
"Views",
"appsettings.json",
"web.config"
]
},
"scripts": {
"prepublish": [ "npm install", "bower install", "gulp clean", "gulp min" ],
"postpublish": [ "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%" ]
},
"userSecretsId": "aspnet-OmniAdminConcept-Mvc6CoreWin-20160622113707"
}
我需要添加一个名为 OmniPayDataModel(使用 telerik.DataAccess.Core)的类库定位框架 4.6.1:
我的问题是我无法从我的 asp.net mvc 项目中引用 OmniPayDataModel.dll 并引发以下错误:
但是,可以将 csproj 添加为引用(以 project.json 显示的项目为目标),但由于某些原因,当我构建/重建 OmniPayDataModel.dll 时,运行解决方案时没有反映任何更改(例如:我把 Dataannotations 像displayname 到我的班级模型,但是<label asp-for="..." /> 不显示要显示的文本)。在一个 sn-p 代码之后:
namespace DataModel
{
[MetadataType(typeof(Directory.DirectoryMetadata))]
public partial class Directory
{
internal sealed class DirectoryMetadata
{
public DirectoryMetadata()
{
}
[Display(Name = "Id Directorio")]
[Required()]
public string DirectoryId
{ get; set; }
[Display(Name = "Nombre Completo")]
[Required()]
public string DirectoryFullName
{ get; set; }
对不起,如果我错了,但为什么我不能将 dll 引用添加到我的主项目?为什么主项目添加了 csproj 作为参考,但更改没有反映?
【问题讨论】:
标签: c# visual-studio asp.net-core-mvc asp.net-core-1.0