• error MSB3552: Resource file "**/*.resx" cannot be found. [/ConsoleApp1.csproj]


    问题场景:

    练习在docker下操作netcore,镜像为centos7,安装完netcore sdk 2.2后,执行操作:

    dotnet new console
    dotnet run

    出现报错:

    /usr/share/dotnet/sdk/2.2.104/Microsoft.Common.CurrentVersion.targets(3049,5): error MSB3552: Resource file "**/*.resx" cannot be found. [/ConsoleApp1.csproj]
    
    The build failed. Please fix the build errors and run again.

    当时的目录为:

    total 24
    -rw-r--r--.   1 root root   178 Feb 27 06:35 ConsoleApp1.csproj
    -rw-r--r--.   1 root root   193 Feb 27 06:35 Program.cs
    -rw-r--r--.   1 root root 12076 Dec  5 01:37 anaconda-post.log
    lrwxrwxrwx.   1 root root     7 Dec  5 01:36 bin -> usr/bin
    drwxr-xr-x.   5 root root   360 Feb 27 06:30 dev
    drwxr-xr-x.   1 root root  4096 Feb 26 14:46 etc
    drwxr-xr-x.   2 root root     6 Apr 11  2018 home
    lrwxrwxrwx.   1 root root     7 Dec  5 01:36 lib -> usr/lib
    lrwxrwxrwx.   1 root root     9 Dec  5 01:36 lib64 -> usr/lib64
    drwxr-xr-x.   2 root root     6 Apr 11  2018 media
    drwxr-xr-x.   2 root root     6 Apr 11  2018 mnt
    drwxr-xr-x.   3 root root   166 Feb 27 06:36 obj
    drwxr-xr-x.   2 root root     6 Apr 11  2018 opt
    dr-xr-xr-x. 109 root root     0 Feb 27 06:30 proc
    dr-xr-x---.   1 root root    91 Feb 27 06:36 root
    drwxr-xr-x.   1 root root     6 Feb 26 14:47 run
    lrwxrwxrwx.   1 root root     8 Dec  5 01:36 sbin -> usr/sbin
    drwxr-xr-x.   2 root root     6 Apr 11  2018 srv
    dr-xr-xr-x.  13 root root     0 Feb 27 06:25 sys
    drwxrwxrwt.   1 root root    65 Feb 27 06:36 tmp
    drwxr-xr-x.   1 root root    81 Dec  5 01:36 usr
    drwxr-xr-x.   1 root root    78 Dec  5 01:36 var

    然后新建了一个文件夹:

    mkdir testASPNETCORE
    chmod 777 testASPNETCORE
    cd testASPNETCORE/
    dotnet new console
    The template "Console Application" was created successfully.
    
    Processing post-creation actions...
    Running 'dotnet restore' on /testASPNETCORE/testASPNETCORE.csproj...
      Restoring packages for /testASPNETCORE/testASPNETCORE.csproj...
      Generating MSBuild file /testASPNETCORE/obj/testASPNETCORE.csproj.nuget.g.props.
      Generating MSBuild file /testASPNETCORE/obj/testASPNETCORE.csproj.nuget.g.targets.
      Restore completed in 155.46 ms for /testASPNETCORE/testASPNETCORE.csproj.
    
    Restore succeeded.
    [root@359ed069320e testASPNETCORE]# ll
    total 8
    -rw-r--r--. 1 root root 196 Feb 27 06:55 Program.cs
    drwxr-xr-x. 2 root root 162 Feb 27 06:55 obj
    -rw-r--r--. 1 root root 178 Feb 27 06:55 testASPNETCORE.csproj
    [root@359ed069320e testASPNETCORE]# dotnet run
    Hello World!

    看来好像是路径和权限问题

    继续测试

    mkdir testAspNetCore2
    cd testAspNetCore2/
    dotnet new console
    The template "Console Application" was created successfully.
    
    Processing post-creation actions...
    Running 'dotnet restore' on /testAspNetCore2/testAspNetCore2.csproj...
      Restoring packages for /testAspNetCore2/testAspNetCore2.csproj...
      Generating MSBuild file /testAspNetCore2/obj/testAspNetCore2.csproj.nuget.g.props.
      Generating MSBuild file /testAspNetCore2/obj/testAspNetCore2.csproj.nuget.g.targets.
      Restore completed in 158.03 ms for /testAspNetCore2/testAspNetCore2.csproj.
    
    Restore succeeded.
    
    [root@359ed069320e testAspNetCore2]# dotnet run 
    Hello World!

    看来确定是路径问题,权限不设置777也可以.

  • 相关阅读:
    注册时按钮上的时间倒计时
    不能修改/删除/添加数据.(NTFS问题)
    站在2009年的门槛上
    超强PHP分页类(转自PHPCHINA)
    System.Web.Caching.Cache类 缓存 各种缓存依赖
    Wxpython快速构建GUI窗口程序
    Python2 和 Python3 有哪些差别
    12306数据库遭泄露,请尽快修改密码
    王欣复出后的第一款产品
    在命令行打开安卓UI界面
  • 原文地址:https://www.cnblogs.com/25miao/p/10443790.html
Copyright © 2020-2023  润新知