.deps.json could not be found

前端 未结 4 2073
别跟我提以往
别跟我提以往 2021-02-12 14:14

Follow this menu sequence:

File -> New -> Project -> ASP>NET Core Web Application (.Net Framework)

Build -> Build Solution

Get this error:

Error

相关标签:
4条回答
  • 2021-02-12 14:38

    In my case, the problem was that I tried to run unit tests using a dll from the ref folder.

    As described by Pavol Kovalik in https://developercommunity.visualstudio.com/solutions/1270375/view.html:

    Mine was caused by having 2 Project.Tests.dll files in build artifact directory

    ...\Debug
      net5.0
        ref
          Project.Tests.dll
        Project.Tests.dll
        Project.Tests.deps.json 
    

    As such the vstest was discovering 2 test files. First without deps.json file and another with it. My fix was to enforce that test file is in net* directory (could be net5.0 or net48 in my case) like this

    - script: |
        dotnet vstest $(Build.BinariesDirectory)/bin/**/net*/*.Tests.dll --logger:trx
      displayName: Execute unit tests
    
    0 讨论(0)
  • 2021-02-12 14:47

    I have the same issue, but I created a project with name "MyprojectWithoutSpaces" and the issue is gone. I suppose is a problem in the RC version

    0 讨论(0)
  • 2021-02-12 14:50

    Most likely you have an underscore in your project's name or its parent directory/directories. Remove that underscore if you find, and rebuild the project.

    0 讨论(0)
  • 2021-02-12 14:55

    I've just created an empty file ex: MyProject.deps.json and now it's working fine.

    I'm using VS2015 update 3

    0 讨论(0)
提交回复
热议问题