In this part of the vNext tale, I am gonna tell you about dependency injection in ASP.NET 5 (vNext) stack. Default Dependency Injection container First, let's see what is shipped with ASP.NET 5 by default. There is already simple DI container. It gives you a possibility to register service with three different lifetimes: scope, singleton and transient. For now it supports only constructor injection. Let's see how to use it and what is the difference between these lifetimes. Create empty ASP.NET...
[Fixed] Cannot update Windows 10. Error 0x80246017
When I have tried to update Windows 10 (build 9926) to the latest build, I got following error: "There were some problems installing updates, but we'll try again later. If you keep seeing this and want to search the web or contact support for information, this may help - (0x80246017)" Solution Open regedit (ctrl + r -> regedit.exe) Go to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\WindowsSelfHost\Applicability Delete ThresholdInternal value Delete ThresholdOptedIn value Set ThresholdRiskLevel to l...
[Unity3d] ReadOnly InputField
New UI system was introduced in Unity3d 4.6, it includes InputField control, but this field could not be read only. You can make it non interactable by disabling "Interactable" property in the editor, but then you will not be able to select and copy text from InputField. To have proper ReadOnly input field you should do small modification to the original control: using UnityEngine; using UnityEngine.EventSystems; using UnityEngine.UI; [AddComponentMenu("UI/Read Only Input Field", 32)]...
Блогомарафон v2.0
Всем привет, Полтора года назад я провел блогомарафон, постил по одной записи каждый день в течении 30 дней, к сожалению, довести его до конца не получилось, на 24-й день я "забил". По окончанию марафона я сделал кое какие выводы. И как оказалось сделал я их довольно рано, ведь только спустя год я смог оценить результат по настоящему. На тот момент посещаемость была около 150 посетителей в день. Через год я имел 1500, и 80% посещений были на статьи написанные в тот, первый, блогомарафон. Ну а се...
[Unity3d] WaitForFrames in Coroutine
If you are using Coroutines in Unity3d, you probably know about WaitForSeconds, WaitForEndOfFrame and WaitForFixedUpdate classes. Here is an example: public IEnumerator CoroutineAction() { // do some actions here yield return new WaitForSeconds(2); // wait for 2 seconds // do some actions after 2 seconds } But sometimes you need to wait for some amount of frames before executing some action. I have created simple class to help you with that: public static class WaitFor { public static IEnumerato...
[Решение] Ошибка "The ‘Microsoft.ACE.OLEDB.12.0′ provider is not registered on the local machine"
Причины проблемы: Microsoft.ACE.OLEDB.12.0 драйвер имеет две версии: x86 и x64. Эти две версии не могут быть установленные одновременно, соответственно если ваше .net приложение собирается под AnyCPU то в случае 64 битной системы оно будет пытаться использовать 64 драйвер, и наоборот. Решение: - В Configuration Manager установите сборку приложения под x86 платформу (BUILD > Configuration > Active > Solution > Platform > x86) - Установите x86 драйвер Microsoft.ACE.OLEDB.12.0 Альтер...
[vNext] Use PostgreSQL + Fluent NHibernate from ASP.NET 5 (DNX) on Ubuntu
In the previous part we have installed APS.NET 5 application on Ubuntu, now we are gonna install and configure PostgreSQL on Ubuntu and access database from our application through NHibernate. Install and configure PostgreSQL First, install PostgreSQL: sudo apt-get install postgresql postgresql-contrib Next, set root password: sudo -u postgres psql postgres \password postgres And then create test database: sudo -u postgres createdb mydb Add Fluent NHibernate to the application Open project.json...
How-to Restore WordPress Site
In conclusion of "How-to Backup WordPress Site" article, here is small instruction to restore your backup: Upload files to VPS Upload you www.tar.gz and database.sql to the new VPS. You can use WinSCP (as described here) Extract www file structure Extract files: tar -xvf www.tar.gz And copy files: cp -a www/oldsite.com/www/* /var/yoursite.com/www Change permissions: cd /var/yoursite.com/www chown www-data:www-data -R * find . -type d -exec chmod 755 {} \; find . -type f -exec chmod 644 {} \; Cre...
[vNext] Install ASP.NET 5 (DNX) on Ubuntu
ASP.NET MVC application on Linux? Easy! As you may know, Microsoft recently released a lot of their products under MIT license. .NET Core runtime, .NET CoreFX, ASP.NET 5, MVC 6, Entity Framework 7, MSBuild, everything is now available on GitHub. Our goal is: run Asp.Net MVC application with postgresql database on ubuntu server Today we are gonna start with setting up .NET environment. In the new asp.net stack you can choose between full .NET runtime and .NET Core. For now .NET Core has a lot of...
[Fix] VT-x is not available. (VERR_VMX_NO_VMX)
I got this error after installing Visual Studio 2015 CTP 6 with Windows Phone 8.1 emulator. Sometimes you can get this error if you turned off VTx or AMDv in bios. So, first things to do is: make sure that Virtualization is enabled in bios. Next - turn off Hyper-V. After installing Visual Studio with emulator it automatically turn Hyper-V on. And, apparently, Virtual Box cannot work together with Hyper-V. Run cmd.exe as administrator Execute command dism /online /disable-feature /featurename:Mi...