Country Tag Helper–part 5

Now the Country Tag Helper supports .NET Standard 2.0 . This means that support .NET Core 2.0 .

Also, I have made a NuGET package in order to install on every .NET Core 2.0 application with explanations: 

The only trouble here was to add references and make documentation in VS2017 about package ( see )

As I said , the source is at GitHub and demo at

What remains to be done:

add select2 with image flags   

provider / dependency injection for FromIP / wiki on github

Country Tag Helper–part 4


Now I want to see somewhere in order to prove it Ii s right. I choose because it is free – and can not beat free for free source.

I made github integration and modify the .csproj file accordingly to 

The result is at 

Also , I have to modify the code source to get the ip of the user :

string GetUserIP(ViewContext vc)
            StringValues headerFwd;
            if (ViewContext.HttpContext?.Request?.Headers?.TryGetValue("X-Forwarded-For", out headerFwd) ?? false)
                string rawValues = headerFwd.ToString();
                if (!string.IsNullOrWhiteSpace(rawValues))
                    return rawValues.Split(',')[0];

            return ViewContext.HttpContext?.Connection?.RemoteIpAddress?.ToString();


where ViewContext is

        public ViewContext ViewContext { get; set; }

Friday links 229

  1. Building a Great Hosted Web App | Building Apps for Windows 
  2.   Expecting Failures In Microservices and Working Around Them
  3. Samsung Galaxy Note Edge vs Samsung Galaxy Note 5 – Phone specs comparison
  4. Compare Samsung Galaxy Note 5 vs Samsung Galaxy Note Edge Size, Specs, Camera
  5. NReco.VideoConverter: C# FFMpeg wrapper .NET library (FREE)
  6. OfficeDev/Open-Xml-PowerTools
  7.  NuGetPackageExplorer/NuGetPackageExplorer: The new home for NuGetPackageExplorer (moved from
  8. Async OOP 1: Inheritance and Interfaces
  9. Using-blocks and asynchronous operations
  10. Async disposal
  11. How to Encrypt and Protect your Email | Comparitech
  12. The Role of an Enterprise Architect in a Lean Enterprise
  13. New: ASP.NET Session State Provider for SQL Server In-Memory OLTP | SQL Server Blog
  14. Microsoft/BotBuilder: The Microsoft Bot Builder SDK is one of three main components of the Microsoft Bot Framework. The Microsoft Bot Framework provides just what you need to build and connect intelligent bots that interact naturally wherever your users a
  15. How to program using PostSharp in C# | InfoWorld
  16. The Zen of Code Reviews: Review As If You Own the Code
  17. lukebuehler/CShell: A simple, yet powerful, C# scripting IDE and REPL
  18. 12 years, 12 lessons working at ThoughtWorks |
  19. How to destroy Programmer Productivity | George Stocker
  20. ed2428f803e5cff6f1f48d89b1e602c5.jpg (720×629)
  21. Why “Agile” and especially Scrum are terrible – Michael O. Church
  22. A Gamer’s Blog: 05/01/2007 – 06/01/2007
  23. How to call WinRT APIs in Windows 8 from C# Desktop Applications – WinRT Diagram – Scott Hanselman
  24. Stop ‘innovating’: Aim higher | VentureBeat | Entrepreneur | by Iliya Rybchin, Highnote Foundry
  25. MyDriving | Microsoft Azure
  26. IConfiguration in .NetCore
  27. itext/itextpdf: Core Java Library + PDF/A, xtra and XML Worker
  28. Create Responsive AMP Pages
  29. C# 7 Features Previewed
  30. SSubjectivity : Naming Standards – SQL Sentry Team Blog
  31. The Codist: My Biggest Regret As A Programmer
  32.  jacobslusser/ScintillaNET: A Windows Forms control, wrapper, and bindings for the Scintilla text editor.
  33. Jolt.NET : Productivity Libraries for the .NET Framework – Documentation

Country Tag Helper – part 3

Adding empty item – easy peasy. Just append "<option selected style=’display: none’ value=”></option>";


if (ASPCountryEmpty)
                    string empty = "<option selected style='display: none' value=''></option>";

For getting the IP, I was trying to balance the 2 variants: downloading GeoIP database ( or calling .

I do call – and the next point is to use Dependency Injection … or a provider to do that.

For the moment, the code is:

 private async Task<string> GetCountryCodeFromIP(string ip)
            //ip= "";
            var url = ""+ip;
            var request = WebRequest.Create(url);
            request.Method = "GET";
            using (var wr = await request.GetResponseAsync())
                using (var receiveStream = wr.GetResponseStream())
                    using (var reader = new StreamReader(receiveStream, Encoding.UTF8))
                        string content = reader.ReadToEnd();
                        return content.Split(',')[1];