was successfully added to your cart.

Category Archives: Ask Tim

Why can’t I add a dependency to my UI in my class library?

By | Ask Tim | No Comments

Avoiding Circular Dependencies in C# When you are adding references in your project, it may seem natural to add a dependency both ways. That way the UI can know about the class library and the class library can know about the UI. However, this does not work (no, it is not a bug) as you can see in this demo: Let’s first look at the practical reason for this. When you compile a Class Library project, it builds a dll file. It brings in all of the dll files it depends on and puts everything in the bin\Debug or bin\Release…

Read More

What If I Want to Create the Tables Myself for ASP.NET Authentication?

By | Ask Tim | No Comments

Alternatives to Code First Database Scripting I totally get this. So the way ASP.NET authentication is set up (which you can see in this video: https://youtu.be/kpSwmLlMu9E), when you run the application for the first time and you actually access the database, it checks to be sure the database and tables are all there. If not, it builds the tables just in time and then runs the code. That is convenient for development but absolutely scary for production. Fortunately, you have options. First, you can take a copy of the database created in development and use it in production. When your…

Read More