I was getting this error when I had a web project and a class library project in the same solution.
System.IO.FileNotFoundException Could not load file or assembly System.Security.Principal.Windows
I wasn't able to build the class library project.
This was because the NuGet package Microsoft.Net.Compilers was not installed on both projects.
It was installed on the web project but not on the class library project.
So to fix this, go to Tools > NuGet Package Manager > Manage NuGet Packages for Solution
Then as the image shows, in the Installed tab:
Once you have installed it. You should be able to do a clean and then a rebuild without the error now.
This post tells you how to solve the error assets file project.assets.json not found in Visual Studi…Read Post
This post gives you some razor code to help you see the values of the IPublishedContent item's prope…Read Post
In this post I share with you what Ronald Barendse taught us about setting the pageBaseType in Umbra…Read Post