Build error after upgrading MimeKit to .NET 4.7.2: Your project does not reference “.NETFramework,Version=v4.7.2” framework

[亡魂溺海] 提交于 2019-12-11 18:07:11

问题


First, this is not a duplicate of:

Build error while transitioning between branches: Your project is not referencing the ".NETFramework,Version=v4.7.2" framework

I downloaded MimeKit and opened it in VS2019. I attempted to update the project from .NET 4.5 to .NET 4.7.2. After doing this, it won't compile. I get the following error:

Your project does not reference ".NETFramework,Version=v4.7.2" framework.

After finding the SO post above, I was very hopeful, but it didn't work. I followed the steps described in the accepted answer. Specifically, I did the following:

  1. I deleted the bin/obj folders from the project root down.
  2. I cleaned the project. (multiple times)
  3. I rebuilt the project. (multiple times)
  4. I right-clicked on the solution in VS2019 and chose Restore Nuget Packages.
  5. I opened the .csproj file and looked for references to .json files but found none.
  6. I tried all of the above in VS2017 also.

I don't know what else to try. Thanks in advance for any advice.


回答1:


This is a horrible bug in VS2017 and VS2019 that I was never able to solve per se. My workaround was to add the NuGet package for MailKit and MimeKit to my custom solution and simply grab the DLLs I needed. I wish MS would fix this.



来源:https://stackoverflow.com/questions/57149360/build-error-after-upgrading-mimekit-to-net-4-7-2-your-project-does-not-referen

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!