#C .NET Core, JsonConvert fails to convert null to bool
#C .NET Core, JsonConvert fails to convert null to bool

Newtonsoft.Json.JsonSerializationException: ‘Error converting value {null} to type “System.Boolean”. Code like this can generate the error: This happens when the bool field in your source is null, and the model you’re converting into’s matching field does not allow nulls. If you don’t mind this field being null in your destination model item, then you can just... » read more

The remote server returned an error: (500) when pinging Zapier in a .NET Core app
The remote server returned an error: (500) when pinging Zapier in a .NET Core app

Getting this error in a .NET Core web app? In this case we were trying to ping Zapier. Server Error in ‘/’ Application.The remote server returned an error: (500) Internal Server Error.Exception Details: System.Net.WebException: The remote server returned an error: (500) Internal Server Error.Stack Trace:[WebException: The remote server returned an error: (500) Internal Server Error.]System.Net.WebClient.OpenRead(Uri... » read more

Azure .NET Core Web App DirectoryNotFoundException: Could not find a part of the path
Azure .NET Core Web App DirectoryNotFoundException: Could not find a part of the path

Getting this error in an Azure .NET Core Web App deployed via GitHub? An unhandled exception occurred while processing the request. DirectoryNotFoundException: Could not find a part of the path ‘D:\home\site\wwwroot\Templates\my_file.html’. System.IO.FileStream.ValidateFileHandle(SafeFileHandle fileHandle) DirectoryNotFoundException: Could not find a part of the path ‘D:\home\site\wwwroot\Templates\my_file.html’. System.IO.FileStream.ValidateFileHandle(SafeFileHandle fileHandle) System.IO.FileStream.CreateFileOpenHandle(FileMode mode, FileShare share, FileOptions options) System.IO.FileStream..ctor(string path, FileMode mode,... » read more

Login failed for user ‘NT AUTHORITY\NETWORK SERVICE’
Login failed for user ‘NT AUTHORITY\NETWORK SERVICE’

After our server people did some MS SQL database restores from some old backups to find some data, some .NET websites we had on the server started showing an error. (note I couldn’t see the error and had to disable custom errors from remote only, see here http://tech.ralpharama.co.uk/1/viewing-errors-remote-machine-after-sql-restores-broke-sites Server Error in '/' Application. Cannot open database... » read more

Getting MSBuild Error MSB3021 in Visual Studio

For no reason a rebuild of a .NET MVC project created these errors that wouldn’t go away with restarts, cleans, running as administrator, etc: Error 383 Unable to copy file “..\root\foo\bar\thing\test.thing.xml” to “bar\thing\test.thing.xml”. Access to the path ‘bar\thing\test.thing.xml’ is denied As detailed here: https://stackoverflow.com/questions/2895898/visual-studio-build-fails-unable-to-copy-exe-file-from-obj-debug-to-bin-debug The only thing that worked for me was the answer by https://stackoverflow.com/users/2435679/adrian-booth When... » read more

ASP.NET Core Web Forms App: A namespace cannot directly contain members such as fields

After creating a new Razor web forms app I scaffolded in an existing database: Scaffold-DbContext "Server=<server>;Database=<db-name>;User ID=<username>;Password=<password>;" Microsoft.EntityFrameworkCore.SqlServer -OutputDir Models And kept getting an error on the newly created entries: A namespace cannot directly contain members such as fields After ensuring I had added Entity Framework to the project using NuGet, I still got the... » read more