gpt4 book ai didi

c# - Visual Studio ASP.NET Core 1.0 项目无法编译

转载 作者:太空宇宙 更新时间:2023-11-03 15:17:00 24 4
gpt4 key购买 nike

帮助。我无法从 VS 2015 编译我的项目,显然在使用 NuGET 安装/卸载项目包时出了点问题。

每次我想构建时,我都会收到以下错误:

Unexpected end of content while loading JObject. Path 'dependencies', line 60, position 0. AutorizarCreditoApp C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\DotNet\Microsoft.DotNet.Common.Targets 262

Unexpected end of content while loading JObject. Path 'dependencies', line 60, position 0. AutorizarCreditoApp C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\DotNet\Microsoft.DotNet.Common.Targets 262

NuGET 包无法恢复任何东西,所以我卡住了,项目搞砸了。我只是在当前行查看文件,但这对我没有任何意义,例如 Microsoft.Dot.Net.Common.Targets 在开头提示:

<Dnx
RuntimeExe="$(SDKToolingExe)"
Condition="'$(_DesignTimeHostBuild)' != 'true'"
ProjectFolder="$(MSBuildProjectDirectory)"
Arguments="$(_BuildArguments)"
/>

并且,project.json:

{
"dependencies": {
"Microsoft.NETCore.App": {
"version": "1.0.0",
"type": "platform"
},
"Microsoft.AspNetCore.Mvc": "1.0.0",
"Microsoft.AspNetCore.Server.IISIntegration": "1.0.0",
"Microsoft.AspNetCore.Server.Kestrel": "1.0.0",
"Microsoft.Extensions.Configuration.EnvironmentVariables": "1.0.0",
"Microsoft.Extensions.Configuration.FileExtensions": "1.0.0",
"Microsoft.Extensions.Configuration.Json": "1.0.0",
"Microsoft.Extensions.Logging": "1.0.0",
"Microsoft.Extensions.Logging.Console": "1.0.0",
"Microsoft.Extensions.Logging.Debug": "1.0.0",
"Microsoft.Extensions.Options.ConfigurationExtensions": "1.0.0",
"Microsoft.AspNetCore.Owin": "1.0.0",
"Microsoft.AspNetCore.Authentication.OAuth": "1.0.0",
"Dapper": "1.50.2",

"tools": {
"Microsoft.AspNetCore.Server.IISIntegration.Tools": "1.0.0-preview2-final"
},

"frameworks": {
"netcoreapp1.0": {
"imports": [
"dotnet5.6",
"portable-net45+win8"
]
}
},

"buildOptions": {
"emitEntryPoint": true,
"preserveCompilationContext": true
},

"runtimeOptions": {
"configProperties": {
"System.GC.Server": true
}
},

"publishOptions": {
"include": [
"wwwroot",
"Views",
"Areas/**/Views",
"appsettings.json",
"web.config"
]
},

"scripts": {
"postpublish": [ "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%" ]
}
}

更新:向 project.json 字符添加 } 字符后,我尝试再次编译它。

现在错误如下:

Unable to find project.json in 'C:_Fuentes\AutorizarCreditoApp\src\AutorizarCreditoApp'

'C:_Fuentes\AutorizarCreditoApp\src\AutorizarCreditoApp\project.json' does not have any frameworks listed in the 'frameworks' section. AutorizarCreditoApp C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\DotNet\Microsoft.DotNet.Common.Targets 262

最佳答案

检查你在项目中的引用是否存在依赖关系,如果引用正常则在卸载后从 nuget 重新安装包>关闭 VS>打开 VS

关于c# - Visual Studio ASP.NET Core 1.0 项目无法编译,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38731864/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com