Author Archives: Ashiq Alibhai, PMP

About Ashiq Alibhai, PMP

Ashiq has been coding C# since 2005. A desktop, web, and RIA application developer, he's touched ASP.NET MVC, ActiveRecord, Silverlight, NUnit, and all kinds of exciting .NET technologies. He started C# City in order to accelerate his .NET learning.

Building C# (not .NET Core) Apps in VSCode on Linux

You can use mono and xcode to build, run, and debug your C# applications natively on Linux (Ubuntu), through Visual Studio Code (VSCode) — without using the .NET Core Continue reading

Posted in Tools | Tagged , , | Leave a comment

Consuming RabbitMQ Messages in ASP.NET MVC

You can create an ASP.NET MVC site that consumes RabbitMQ messages with a persistent connection; here’s how (static variables, no using statements). Continue reading

Posted in Libraries, Web | Tagged , | Leave a comment

How to Subclass .NET Classes from IronPython

To subclass .NET classes in IronPythion, tell the Python engine instance runtime to load the assembly; then, use the fully qualified namespace in your Python code. Continue reading

Posted in Libraries, Wndows Forms | Tagged | Leave a comment

Changing the Login URL from login.aspx on ASP.NET MVC with Forms Authentication

When you enable forms authentication in an ASP.NET MVC5 web application, by default, it redirects unauthenticated requests to ~/login.aspx. You can specify web.config configuration (authentication tag, forms sub-tag, loginUrl property) to change this. Continue reading

Posted in Libraries, Web | Tagged | Leave a comment

Authenticating Against Web API from ASP.NET MVC

In a previous post, we talked about setting up ASP.NET MVC and Web API to accept forms authentication. With this structure in place, your MVC front-end can make Web API calls. The question is, how do you authenticate? What cookies … Continue reading

Posted in Libraries, Web | Tagged , | Leave a comment

Running FluentMigrator Migrations at Runtime

You can run FluentMigrator migrations at runtime, through code. You need to reference the `FluentMigrator.Runner` package, and with some sample code, you can easily check the current/latest version and update to the latest (or to a specific) version. Continue reading

Posted in Libraries, Web, Wndows Forms | Tagged , | Leave a comment

Adding Forms Authentication to Web API

Web API projects don’t ship with external (forms) authentication, but it’s not hard to graft them on. Using the MVC project code, we can easily add forms authentication to the Web API. Continue reading

Posted in Core .NET, Web | Tagged , | Leave a comment

Creating Cross-Platform MonoGame projects

As of MonoGame 3.5, you can create a single project which generates executables for Windows, Linux, and Mac, together. Just create a “MonoGame Cross Platform Desktop Project” solution and you’re ready to go. Continue reading

Posted in Libraries | Tagged , | Leave a comment

Defeating Memory Editors with Moving Values

Want to prevent memory editing in your .NET games? I present a MovingValue class which you can use to store a value whose memory address changes on each write operation. Continue reading

Posted in Core .NET | Tagged | Leave a comment

Generating a Random DateTime in a Range in SQL Server

You can generate a random datetime (date and time) in SQL Server; you just need to use DATEADD a few times (once per component). The result is a truly random date and time. Continue reading

Posted in Tools | Tagged | Leave a comment