.net - dotnet build 无法管理嵌入式资源

标签 .net build resources resx

>dotnet --info

 Runtime Environment:
  OS Name:     Windows
  OS Version:  10.0.14393
  OS Platform: Windows
  RID:         win10-x64
  Base Path:   C:\Program Files\dotnet\sdk\1.0.0 (tested with 1.0.1 as well)

重现步骤:
  • 新建一个类库项目(VS2017下,上次更新)
  • 添加 Foo.resx 文件(带设计器)
  • 添加 Foo.fr.resx 文件
  • 进入项目目录
  • 执行 dotnet build

  • 结果 :

    C:\Program Files\dotnet\sdk\1.0.0\Microsoft.Common.CurrentVersion.targets(4072,5): error MSB3030: Could not copy the file "obj\Debug\fr\ProjectName.resources.dll" because it was not found. [C:\Projects\SolutionName\ProjectName\ProjectName.csproj]



    我在这上面浪费了太多时间(黑客/研究/git 问题挖掘)。
    这是一个错误吗?

    请注意,使用单个文件 Foo.resx 没有问题。 (但我需要多种文化)

    最佳答案

    我有类似的问题,我能够解决它。我在此链接上找到了有用的信息:https://github.com/dotnet/cli/issues/6032

    由于 Visual Studio 构建工作正常,因此 Visual Studio 使用与 dotnet 构建不同的构建过程。
    首先,为您的解决方案执行 msbuild,例如:msbuild ConsoleApp.sln然后运行 ​​dotnet build .

    关于.net - dotnet build 无法管理嵌入式资源,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42931144/

    相关文章:

    android untrue resource not found 异常

    c++ - 生成IDE工程文件

    c++ - Visual Studio 发布版本

    java - 重写 findResource

    c# - 你应该在 C# 中使用指针(不安全代码)吗?

    android - 如何更改构建目标(2.2 到 2.3.3)?或尝试后恢复

    asp.net - 在javascript中设置资源字符串

    c# - 从 Adob​​e Acrobat Reader 和 DejaVu Reader 进程中提取当前页面?

    c# - 协助对测试进行分类

    c# - 检查网络连接