.net core Bitbucket管道:找不到类型或命名空间名称

.net core Bitbucket管道:找不到类型或命名空间名称,.net-core,bitbucket,bitbucket-pipelines,.net Core,Bitbucket,Bitbucket Pipelines,我希望有人能帮我。谢谢 我正在尝试部署我的DotnetCore2.0API 当我尝试使用bitbucket管道构建项目时,在查找引用时会出现多个错误。它确实成功地恢复了项目 然而,这个项目成功地建立在我的笔记本电脑上 文件夹结构: /API /Controllers /Migrations /Models /Services API.csproj Program.cs Startup.cs bitbucket-pipelines.yml pipelines: d

我希望有人能帮我。谢谢

我正在尝试部署我的DotnetCore2.0API

当我尝试使用bitbucket管道构建项目时,在查找引用时会出现多个错误。它确实成功地恢复了项目

然而,这个项目成功地建立在我的笔记本电脑上

文件夹结构:

/API
  /Controllers
  /Migrations
  /Models
  /Services
  API.csproj
  Program.cs
  Startup.cs
bitbucket-pipelines.yml

pipelines:
  default:
    - step:
        image: microsoft/dotnet
        name: Check if it builds
        script:
          - cd API
          - dotnet build
示例错误:

Services/MyService.cs(18,29): error CS0246: The type or namespace name 'IRepository<>' could not be found (are you missing a using directive or an assembly reference?) [/opt/atlassian/pipelines/agent/build/API/API.csproj]
Services/MyService.cs(18,29):错误CS0246:找不到类型或命名空间名称“IRepository”(是否缺少using指令或程序集引用?[/opt/atlassian/pipelines/agent/build/API/API.csproj]


注意我有最新版本的dotnet,与我在bitbucket管道中使用的相同。我已经通过运行
dotnet--info

进行了检查,最后我找到了这个问题的原因。我觉得自己很傻,没能早点弄明白

我的git存储库以某种方式设置为ignorecase=true。 我已将其切换为false(这将防止将来出现此问题)

这意味着我可以有两个相同的文件或文件夹

我已将文件夹重命名为另一个案例。 我的回购协议失败了

API/
  API.csproj

我的Mac电脑不能同时支持这两个功能,所以我在本地机器上只看到一个文件夹和一个项目

为了解决这个问题,我必须
gitrm-r--cachedapi

这删除了重复的文件夹

我将项目文件作为副本,因此使用
git rm-f api.csproj
从存储库中删除该文件

然后,
git pull
将这些更改引入本地主分支

api/
  api.csproj