[英]Package 'Faker.Net 1.0.3' was restored using '.NETFramework,Version=v4.6.1' instead of the project target framework '.NETCoreApp,Version=v2.0'
I'm new to .NET core tools and just ran into an issue while running the following command; 我是.NET核心工具的新手,在运行以下命令时遇到一个问题; I can see that it's just a warning but it's not creating the "publish" folder even with "
sudo dotnet publish -o /publish
" 我可以看到这只是一个警告,但即使使用“
sudo dotnet publish -o /publish
”,它也不会创建“ publish”文件夹
dotnet publish -o /publish
dotnet发布-o / publish
As you can see there's no publish folders 如您所见,没有发布文件夹
/home/joel/workspace/asp (copy)/api/api.csproj :
warning NU1701: Package 'Faker.Net 1.0.3' was restored using '.NETFramework,
Version=v4.6.1'
instead of the project target framework '.NETCoreApp,Version=v2.0'.
This package may not be fully compatible with your project.
Microsoft (R) Build Engine version 15.4.8.50001 for .NET Core
Copyright (C) Microsoft Corporation. All rights reserved.
/home/joel/workspace/asp (copy)/api/api.csproj :
warning NU1701: Package 'Faker.Net 1.0.3' was restored using '.NETFramework,
Version=v4.6.1'
instead of the project target framework '.NETCoreApp,Version=v2.0'.
This package may not be fully compatible with your project.
api -> /home/joel/workspace/asp (copy)/api/bin/Debug/netcoreapp2.0/api.dll
/usr/share/dotnet/sdk/2.0.2/Sdks/Microsoft.NET.Sdk/build/Microsoft.NET
.Publish.targets(67,5):
error MSB3191: Unable to create directory "/publish2/".
Access to the path '/publish2/' is denied. [/home/joel/workspace/asp (copy)/api/api.csproj]
The warning shown has nothing to do with the publish problem. 显示的警告与发布问题无关。 It just states that
Faker.Net 1.0.3
targets .NET Framework and have been resolved for that target runtime despite the application will be running on .NET Core. 它仅说明
Faker.Net 1.0.3
以.NET Framework为目标,并且已为该目标运行时解决,尽管该应用程序将在.NET Core上运行。 That is possible due to .NET Standard shim, however that library might be not fully compatible with .NET Core, so you'd rather check its compatibility with .NET Portable Analizer 由于.NET Standard垫片的缘故,这是可能的,但是该库可能与.NET Core并不完全兼容,因此您宁愿检查其与.NET Portable Analizer的兼容性。
Now the actual problem is the directory you are writing the output to is restricted for access. 现在,实际的问题是您将输出写入到的目录被限制访问。 Thus to make it work you should get the privilege first.
因此,要使其正常工作,您应该首先获得特权。
try dotnet publish -o ./publish2
(note the dot before the path) 尝试
dotnet publish -o ./publish2
(注意路径前面的点)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.