Macos 找不到project.assets.json

Macos 找不到project.assets.json,macos,asp.net-core,.net-core,Macos,Asp.net Core,.net Core,我正在尝试在MacOS上运行asp.net core 1.1 web应用程序。我已经下载了所有最新版本的.NET,包括SDK(目前为1.0.3) 当我运行dotnet restore时,事情进展顺利,但当我尝试构建或运行应用程序时,我收到以下错误消息: JSON:EC json$ dotnet run /usr/local/share/dotnet/sdk/1.0.3/Sdks/Microsoft.NET.Sdk/build/Microsoft.PackageDependencyResoluti

我正在尝试在MacOS上运行asp.net core 1.1 web应用程序。我已经下载了所有最新版本的.NET,包括SDK(目前为1.0.3) 当我运行
dotnet restore
时,事情进展顺利,但当我尝试构建或运行应用程序时,我收到以下错误消息:

JSON:EC json$ dotnet run
/usr/local/share/dotnet/sdk/1.0.3/Sdks/Microsoft.NET.Sdk/build/Microsoft.PackageDependencyResolution.targets(154,5): error : Assets file ‘/Users/jasonfenwick/Documents/Account Creation and Dashboard/EmptyCubicle/EmptyCubicle/obj/project.assets.json’ not found. Run a NuGet package restore to generate this file. [/Users/jasonfenwick/Documents/Account%20Creation%20and%20Dashboard/EmptyCubicle/EmptyCubicle/EmptyCubicle.csproj]
obj/Debug/netcoreapp1.1/EmptyCubicle.AssemblyInfo.cs(6,12): error CS0246: The type or namespace name ‘System’ could not be found (are you missing a using directive or an assembly reference?) [/Users/jasonfenwick/Documents/Account%20Creation%20and%20Dashboard/EmptyCubicle/EmptyCubicle/EmptyCubicle.csproj]
obj/Debug/netcoreapp1.1/EmptyCubicle.AssemblyInfo.cs(7,12): error CS0246: The type or namespace name ‘System’ could not be found (are you missing a using directive or an assembly reference?) [/Users/jasonfenwick/Documents/Account%20Creation%20and%20Dashboard/EmptyCubicle/EmptyCubicle/EmptyCubicle.csproj]
obj/Debug/netcoreapp1.1/EmptyCubicle.AssemblyInfo.cs(8,12): error CS0246: The type or namespace name ‘System’ could not be found (are you missing a using directive or an assembly reference?) [/Users/jasonfenwick/Documents/Account%20Creation%20and%20Dashboard/EmptyCubicle/EmptyCubicle/EmptyCubicle.csproj]
obj/Debug/netcoreapp1.1/EmptyCubicle.AssemblyInfo.cs(9,12): error CS0246: The type or namespace name ‘System’ could not be found (are you missing a using directive or an assembly reference?) [/Users/jasonfenwick/Documents/Account%20Creation%20and%20Dashboard/EmptyCubicle/EmptyCubicle/EmptyCubicle.csproj]
obj/Debug/netcoreapp1.1/EmptyCubicle.AssemblyInfo.cs(10,12): error CS0246: The type or namespace name ‘System’ could not be found (are you missing a using directive or an assembly reference?) [/Users/jasonfenwick/Documents/Account%20Creation%20and%20Dashboard/EmptyCubicle/EmptyCubicle/EmptyCubicle.csproj]
obj/Debug/netcoreapp1.1/EmptyCubicle.AssemblyInfo.cs(11,12): error CS0246: The type or namespace name ‘System’ could not be found (are you missing a using directive or an assembly reference?) [/Users/jasonfenwick/Documents/Account%20Creation%20and%20Dashboard/EmptyCubicle/EmptyCubicle/EmptyCubicle.csproj]
obj/Debug/netcoreapp1.1/EmptyCubicle.AssemblyInfo.cs(12,12): error CS0246: The type or namespace name ‘System’ could not be found (are you missing a using directive or an assembly reference?) [/Users/jasonfenwick/Documents/Account%20Creation%20and%20Dashboard/EmptyCubicle/EmptyCubicle/EmptyCubicle.csproj]
obj/Debug/netcoreapp1.1/EmptyCubicle.AssemblyInfo.cs(13,12): error CS0246: The type or namespace name ‘System’ could not be found (are you missing a using directive or an assembly reference?) [/Users/jasonfenwick/Documents/Account%20Creation%20and%20Dashboard/EmptyCubicle/EmptyCubicle/EmptyCubicle.csproj]
obj/Debug/netcoreapp1.1/EmptyCubicle.AssemblyInfo.cs(6,55): error CS0518: Predefined type ‘System.String’ is not defined or imported [/Users/jasonfenwick/Documents/Account%20Creation%20and%20Dashboard/EmptyCubicle/EmptyCubicle/EmptyCubicle.csproj]
obj/Debug/netcoreapp1.1/EmptyCubicle.AssemblyInfo.cs(7,61): error CS0518: Predefined type ‘System.String’ is not defined or imported [/Users/jasonfenwick/Documents/Account%20Creation%20and%20Dashboard/EmptyCubicle/EmptyCubicle/EmptyCubicle.csproj]
obj/Debug/netcoreapp1.1/EmptyCubicle.AssemblyInfo.cs(8,59): error CS0518: Predefined type ‘System.String’ is not defined or imported [/Users/jasonfenwick/Documents/Account%20Creation%20and%20Dashboard/EmptyCubicle/EmptyCubicle/EmptyCubicle.csproj]
obj/Debug/netcoreapp1.1/EmptyCubicle.AssemblyInfo.cs(9,59): error CS0518: Predefined type ‘System.String’ is not defined or imported [/Users/jasonfenwick/Documents/Account%20Creation%20and%20Dashboard/EmptyCubicle/EmptyCubicle/EmptyCubicle.csproj]
obj/Debug/netcoreapp1.1/EmptyCubicle.AssemblyInfo.cs(10,68): error CS0518: Predefined type ‘System.String’ is not defined or imported [/Users/jasonfenwick/Documents/Account%20Creation%20and%20Dashboard/EmptyCubicle/EmptyCubicle/EmptyCubicle.csproj]
obj/Debug/netcoreapp1.1/EmptyCubicle.AssemblyInfo.cs(11,55): error CS0518: Predefined type ‘System.String’ is not defined or imported [/Users/jasonfenwick/Documents/Account%20Creation%20and%20Dashboard/EmptyCubicle/EmptyCubicle/EmptyCubicle.csproj]
obj/Debug/netcoreapp1.1/EmptyCubicle.AssemblyInfo.cs(12,53): error CS0518: Predefined type ‘System.String’ is not defined or imported [/Users/jasonfenwick/Documents/Account%20Creation%20and%20Dashboard/EmptyCubicle/EmptyCubicle/EmptyCubicle.csproj]
obj/Debug/netcoreapp1.1/EmptyCubicle.AssemblyInfo.cs(13,55): error CS0518: Predefined type ‘System.String’ is not defined or imported [/Users/jasonfenwick/Documents/Account%20Creation%20and%20Dashboard/EmptyCubicle/EmptyCubicle/EmptyCubicle.csproj]
obj/Debug/netcoreapp1.1/EmptyCubicle.AssemblyInfo.cs(3,7): error CS0246: The type or namespace name ‘System’ could not be found (are you missing a using directive or an assembly reference?) [/Users/jasonfenwick/Documents/Account%20Creation%20and%20Dashboard/EmptyCubicle/EmptyCubicle/EmptyCubicle.csproj]
obj/Debug/netcoreapp1.1/EmptyCubicle.AssemblyInfo.cs(4,7): error CS0246: The type or namespace name ‘System’ could not be found (are you missing a using directive or an assembly reference?) [/Users/jasonfenwick/Documents/Account%20Creation%20and%20Dashboard/EmptyCubicle/EmptyCubicle/EmptyCubicle.csproj]
/usr/local/share/dotnet/sdk/1.0.3/Sdks/Microsoft.NET.Sdk/build/Microsoft.NET.Sdk.targets(92,5): error : Assets file ‘/Users/jasonfenwick/Documents/Account Creation and Dashboard/EmptyCubicle/EmptyCubicle/obj/project.assets.json’ not found. Run a NuGet package restore to generate this file. [/Users/jasonfenwick/Documents/Account%20Creation%20and%20Dashboard/EmptyCubicle/EmptyCubicle/EmptyCubicle.csproj]

The build failed. Please fix the build errors and run again.
我推测该程序正在寻找一个project.assets.json文件,该文件是在运行“dotnet restore”时创建的。并且在正确的文件夹中


我已尝试删除此文件并重新运行
dotnet restore
,从而重新创建该文件。但是错误仍然存在。

尝试升级到Nuget 4.x,这将生成缺少的project.assets.json。

建议使用Nuget 4.x(在VSTS的Nuget安装程序任务中提供)来恢复VS 2017项目的包。Reference

尝试删除项目中的bin/和obj/文件夹,然后执行另一个dotnet还原。这为我解决了类似的问题,文件似乎没有被正确还原。你也可以发布你的
.csproj
文件吗?并发布运行
dotnet restore
的输出。有时在还原过程中会出现容易出错的错误。我在部署到VSTS的Windows 2017主机版本上也遇到了此问题。