Modifying decade-old ASP.NET application

If you are planning to maintain an application for more than a decade then be careful.

I'm in middle of a case of modifying an ASP.NET WebForm application back to 2006 so 10 years old from now. This application is live for now and it is running for no problem. One month ago we migrated its hosting from Windows Server 2003 to Windows Server 2012 R2 successfully. I can imagine if no modification is needed it would be live for another more decade despite vast changing world of web development and .Net.

But our current problem is different than relocating it from a 2003 windows to a 2012 one. We want to modify it so change or add behaviors to it. Some modifications are easy to apply. For example if an HTML/CSS change is wanted it can be done by modifying ASPX/ASCX files easily. But modifications in code behind ASPX.CS and ASCX.CS file are not easy. Because our application is compiled and no CS file exists in hosting IIS. So changes must be applied in source code then published and converted to DLL files then deployed on the hosting IIS. Our application has dependencies to other assemblies like AjaxControlToolkit 2006 and we have not exact version of them currently. So our application simply wont build and wont publish easily.

At first glance I thought the only choice that we have is to upgrade all dependencies to current version that is impossible. From ten years ago til now many of third party libraries have been discontinued or have many breaking changes. Even ASP.NET itself has been changed very much. Fortunately I got a good solution. That was simple and trivial but I didn't noticed it before. We had published version of the application that means we currently have needed assemblies that are referenced from application. No matters if they are very old or we have not access to their source code. They are valid and executable .Net assemblies that can be referenced from any .Net application.

Iranian developers seeking clients and job positions globally and the sanctions

Time to time I see people get surprised when I tell them Iranian software developers have not access to international job market and can not have global clients easily.

It's a long time that Iran is under US and international sanctions due to political issues. As a result foreign employers especially US based companies are not legally allowed to employ Iranian developers because paying them and having business relations is forbidden.

Some web sites like (An online market for HTML themes and other materials) does not allow browsing their websites inside Iran. They explicitly stated that their site is not available in countries like Iran.


Some other marketplaces does not have Iran in their registration forms fields. You are forced to select another country instead of Iran. An example is


Some other websites have no problem until payments. They need a copy of Passport or a proof of address that obviously would cause problems if you are from Iran. Another problems raises when you want to use PayPal to transfer money. PayPal is based in US.

One of my friend that was working in a freelancing website told me that he had trouble transferring money to Iran. He used a bureau de change via Dubai, UAE to transfer his own money to Iran. A noticeable commission applied to this transfer.

One another friend that wanted to be employed as a remote member of western software development company said everything went OK with the interview. They were satisfied with his skills but when they realized he is Iranian, process stopped.

There also problems getting service from none job websites like Google Developers (formerly Google Code) or Oracle. They do not allow Iranians to use their services.


developersUnfortunately some web sites are censored from inside Iran by government. Twitter is a sample.



EF Migration History not working

In our team we have developers working on same base code that uses EF Code First. All base codes are connected to same database and automatic migration is enabled. Time by time we get errors while running the application. Because some developer may be in past or forward in Model histories. In the other hand developer A may have been added Field AA to table T and developer B may have been added Field BB to table T. This may cause automatic migration to get in trouble. With some errors like table “ABC” exists before.


Today we get a similar error titled:

There is already an object named 'AspNetRoles' in the database.


My first guess was that is is caused by simultaneous but incompatible changes by developers. So checked source control history to see if anything strange has been happened or not. Found nothing unusual. As I had no clue I tried to understand values stored in __MigrationHistory table. It seemed that filed Model is data related to application model changes. It is a long data stored as binary. Googling showed me that my guess is true. I found a good article about it. It showed how to decode this data and extract human readable information from it. That was interesting. This data is in EDMX xml format. Yes EF Code First uses EDMX too but just hides it from scenes. BTW nothing in EDMX was unusual too.


I noticed that format of data in __MigrationHistory has been changed. All digits have been converted to Unicode Persian digits. Consequently I recalled that a colleague had run a T-SQL script on the database so all Arabic characters be converted to Persian characters. This is necessary specially when regarding Persian YEH and KEH characters. We rolled back this process in table __MigrationHistory and run the application once again. It worked again and there is no sign of EF migration problems. All the problem was caused by modifications in the __MigrationHistory table.

Entire family goes Ubuntu

We have a dual boot PC in our home. It has Ubuntu 15.10 and Windows 10 on it. My occasional usage of this PC is done with Ubuntu. Our 5 years old son uses Ubuntu to play online games, watch movies and listen to music. I guess when he go to school we may be forced to use Windows because many educational software forced by schools run only in Windows. But this is for 2 or 3 years later and no fear yet.


Our main reason to still have Windows on our home PC is needs of my wife. She is getting her master degree from university. Needs to prepare documents for her professors so must use same office suite even with same version and same series of fonts with them, otherwise they will not accept the work. As MS Office is widely adopted in Iran, almost all hear classmates also use MS Word and MS Excel file formats to share with them. Tragedy does not ends here. Her university portal just work with specific versions of Internet Explorer. If she want to track her student information from that portal, she must use Internet Explorer. Their university e-learning program runs on Chrome after installing some stuff from Adobe, didn't try it on Ubuntu but it may not work correctly on Ubuntu too.


Windows in not legally sold in Iran and almost all installations are cracked versions. So we love to switch completely to Ubuntu. It also need lower hardware requirements. Now what we can do to switch to Ubuntu and not using Windows? Can we wait under graduation of my wife and hoping my future school of my son does not force to use Windows only educational software?


Honestly I have no definite solution. My wife is no tech savvy and is not very comfortable switch form Windows and MS Office to Ubuntu and LibreOffice. She occasionally searches the web and produces documents based on this searches.


But something has happened and is changing the stations. During last few months I released our home ADSL internet volume is consumed very fast. A 5GB limit is reached during a couple of days while in past this was lasted for couple of weeks. I started thinking what causes this. We have 3 android devices in the home. All automatic updates were on. Changed status of auto update of all to off. Checked 2 Ubuntu devices, home PC and my laptop. They were in ask before mode. All of this made situation better but still one place remained to get inspected. You guessed correct, this was Windows 10 on home PC. I checked its auto-update settings. Surprisingly find out that there is no settings for that. I was unable to make it off. Searching the internet showed that Windows 10 Home edition does not allow disabling automatic update. The only work-around is making network connection as metered so Windows does not use it for getting updates. This work-around does not work for me because our home PC is connected through Ethernet not Wi-Fi and making an Ethernet port as metered is not possible.


As we are not going to get unlimited ADSL internet account for out home, we tried to make a hard decision. Yes we decided to move all remaining activities from Windows to Ubuntu at least for a while. I hope she can read and basic modify of MS Word file in Ubuntu/LibreOffice. Hopefully she can get friendship relationship with Ubuntu, LibreOffice, Firefox and VLC media player. This morning I created a user account in Ubuntu for her. Take time to teach her how to see her emails, how to create LibreOffice Writer documents and how to add Persian characters into it. Recently I have made home PC to a media sharing machine so our son can play movies via his Android tablet device. If no bad problem occurs all of this may lead us to have a Windows free home.