VS 2017 Metadata file '.dll could not be found

后端 未结 28 1560
日久生厌
日久生厌 2021-01-31 07:06

I know there is another question with exact the same problem, but I went trough all those answers, and none helped me. :( (This was the question.)

I just created a new A

28条回答
  •  没有蜡笔的小新
    2021-01-31 07:30

    In my case the issue was, I was referencing a project where I commented out all the .cs files.

    For example ProjectApp references ProjectUtility. In ProjectUtility I only had 1 .cs file. I wasn't using it anymore so I commented out the whole file. In ProjectApp I wasn't calling any of the code from ProjectUtility, but I had using ProjectUtility; in one of the ProjectApp .cs files. The only error I got from the compiler was the CS0006 error.

    I uncommented the .cs file in ProjectUtility and the error went away. So I'm not sure if having no code in a project causes the compiler to create an invalid assembly or not generate the DLL at all. The fix for me was to just remove the reference to ProjectUtility rather than commenting all the code.

    In case you were wondering why I commented all the code from the referenced project instead of removing the reference, I did it because I was testing something and didn't want to modify the ProjectApp.csproj file.

提交回复
热议问题