Microsoft’s Chromium Edge browser is now officially available to test

Microsoft is making its Chromium-powered Edge browser available to developers today. The software giant is releasing its Canary and Developer builds, offering daily or weekly updates to the changes that are coming to Edge. Both downloads are available on Microsoft’s new Edge insider site, and they are designed for developers to get an early look at how Edge is changing.

Microsoft has focused on the fundamentals of browsing, reliability, and extension support for this early version of Edge built on Chromium, and the company is looking for feedback about the basics to start. Encouragingly, this new Edge browser runs surprisingly well, with full support for existing Chrome extensions. Microsoft is even building in sync support for things like favorites, browsing history, and extensions to sync across Edge. Favorites is only supported in this early version today, but sync support will be gradually improved before this new version of Edge is more broadly available in a beta version.

Both Microsoft and Google engineers have been working together to improve the underlying Chromium project so that Chrome and Edge run better on Windows. Microsoft has had around 150 commits accepted into Chromium, paving the way for improvements to Edge and Chromium on Windows 10. That includes improving accessibility, smooth scrolling support, Windows Hello integration, and things like ensuring the touch keyboard shows up reliably.

image

image

Using dependency injection in a .Net Core console application

One of the key features of ASP.NET Core is baked in dependency injection.

Whether you choose to use the built in container or a third party container will likely come down to whether the built in container is powerful enough for your given project. For small projects it may be fine, but if you need convention based registration, logging/debugging tools, or more esoteric approaches like property injection, then you'll need to look elsewhere.

Why use the built-in container?

One question that's come up a few times, is whether you can use the built-in provider in a .NET Core console application? The short answer is not out-of-the-box, but adding it in is pretty simple. Having said that, whether it is worth using in this case is another question.

One of the advantage of the built-in container in ASP.NET Core is that the framework libraries themselves register their dependencies with it. When you call the AddMvc() extension method in your Startup.ConfigureServices method, the framework registers a whole plethora of services with the container. If you later add a third-party container, those dependencies are passed across to be re-registered, so they are available when resolved via the third-party.

If you are writing a console app, then you likely don't need MVC or other ASP.NET Core specific services. In that case, it may be just as easy to start right off the bat using StructureMap or AutoFac instead of the limited built-in provider.

Having said that, most common services designed for use with ASP.NET Core will have extensions for registering with the built in container via IServiceCollection, so if you are using services such as logging, or the Options pattern, then it is certainly easier to use the provided extensions, and plug a third party on top of that if required.

Adding DI to a console app

If you decide the built-in container is the right approach, then adding it to your application is very simple using the Microsoft.Extensions.DependencyInjection package.

aspnet-core-di

To demonstrate the approach, I'm going to create a simple application that has two services:

public interface IFooService
{
    void DoThing(int number);
}

public interface IBarService
{
    void DoSomeRealWork();
}

Each of these services will have a single implementation. The BarService depends on an IFooService, and the FooService uses an ILoggerFactory to log some work:

public class BarService : IBarService
{
    private readonly IFooService _fooService;
    public BarService(IFooService fooService)
    {
        _fooService = fooService;
    }

    public void DoSomeRealWork()
    {
        for (int i = 0; i < 10; i++)
        {
            _fooService.DoThing(i);
        }
    }
}

public class FooService : IFooService
{
    private readonly ILogger<FooService> _logger;
    public FooService(ILoggerFactory loggerFactory)
    {
        _logger = loggerFactory.CreateLogger<FooService>();
    }

    public void DoThing(int number)
    {
        _logger.LogInformation($"Doing the thing {number}");
    }
}

As you could see above, I'm using the new logging infrastructure in my app, so I will need to add the appropriate package to my project.json. I'll also add the DependencyInjection package and the Microsoft.Extensions.Logging.Console package so I can see the results of my logging:

{
  "dependencies": {
    "Microsoft.Extensions.Logging": "1.0.0",
    "Microsoft.Extensions.Logging.Console": "1.0.0",
    "Microsoft.Extensions.DependencyInjection": "1.0.0"
  }
}

Finally, I'll update my static void main to put all the pieces together. We'll walk through through it in a second.

using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;

public class Program
{
    public static void Main(string[] args)
    {
        //setup our DI
        var serviceProvider = new ServiceCollection()
            .AddLogging()
            .AddSingleton<IFooService, FooService>()
            .AddSingleton<IBarService, BarService>()
            .BuildServiceProvider();

        //configure console logging
        serviceProvider
            .GetService<ILoggerFactory>()
            .AddConsole(LogLevel.Debug);

        var logger = serviceProvider.GetService<ILoggerFactory>()
            .CreateLogger<Program>();
        logger.LogDebug("Starting application");

        //do the actual work here
        var bar = serviceProvider.GetService<IBarService>();
        bar.DoSomeRealWork();

        logger.LogDebug("All done!");
    }
}

The first thing we do is configure the dependency injection container by creating a ServiceCollection, adding our dependencies, and finally building an IServiceProvider. This process is equivalent to the ConfigureServices method in an ASP.NET Core project, and is pretty much what happens behind the scenes. You can see we are using the IServiceCollection extension method to add the logging services to our application, and then registering our own services. The serviceProvider is our container we can use to resolve services in our application.

In the next step, we need to configure the logging infrastructure with a provider, so the results are output somewhere. We first fetch an instance of ILoggerFactory from our newly constructed serviceProvider, and add a console logger.

The remainder of the program shows more dependency-injection in progress. We first fetch an ILogger<T> from the container, and then fetch an instance of IBarService. As per our registrations, the IBarService is an instance of BarService, which will have an instance of FooService injected in it.

If can then run our application and see all our beautifully resolved dependencies!

output

Adding StructureMap to your console app

As described previously, the built-in container is useful for adding framework libraries using the extension methods, like we saw with AddLogging above. However it is much less fully featured than many third-party containers.

For completeness, I'll show how easy it is to update the application to use a hybrid approach, using the built in container to easily add any framework dependencies, and using StructureMap for your own code.

First you need to add StructureMap to your project.json dependencies:

{
  "dependencies": {
    "StructureMap.Microsoft.DependencyInjection": "1.2.0"
  }
}

Now we'll update our static void main to use StructureMap for registering our custom dependencies:

public static void Main(string[] args)
{
    // add the framework services
    var services = new ServiceCollection()
        .AddLogging();

    // add StructureMap
    var container = new Container();
    container.Configure(config =>
    {
        // Register stuff in container, using the StructureMap APIs...
        config.Scan(_ =>
                    {
                        _.AssemblyContainingType(typeof(Program));
                        _.WithDefaultConventions();
                    });
        // Populate the container using the service collection
        config.Populate(services);
    });

    var serviceProvider = container.GetInstance<IServiceProvider>();

    // rest of method as before
}

At first glance this may seem more complicated than the previous version, and it is, but it is also far more powerful. In the StructureMap example, we didn't have to explicitly register our IFooService or IBarService services - they were automatically registered by convention. When your apps start to grow, this sort of convention-based registration becomes enormously powerful, especially when couple with the error handling and debugging capabilities available to you.

In this example I showed how to use StructureMap with the adapter to work with the IServiceCollection extension methods, but there's obviously no requirement to do that. Using StructureMap as your only registration source is perfectly valid, you'll just have to manually register any services added as part of the AddPLUGIN extension methods directly.

Dependency Injection with constructor parameters

The following code shows you how to configure DI for objects that have parameters in the constructor.

using Microsoft.Extensions.DependencyInjection;
using System;

namespace NetCoreDIDemo
{
    class Program
    {
        static void Main(string[] args)
        {
            var services = new ServiceCollection();
            services.AddTransient<IMyService>(s => new MyService("MyConnectionString"));
            var provider = services.BuildServiceProvider();
            var myService = provider.GetService<IMyService>();
            
            Console.WriteLine($"The constructor parameter is: {myService.GetConstructorParameter()}");
            Console.ReadKey();
        }
    }

    public interface IMyService
    {
        string GetConstructorParameter();
    }

    public class MyService : IMyService
    {
        private string connectionString;
        public MyService(string connString)
        {
            this.connectionString = connString;
        }

        public string GetConstructorParameter()
        {
            return connectionString;
        }
    }
}

Happy coding!

The Windows 3.0 File Manager is now available in the Microsoft Store

FileManager-for-Windows10

Microsoft open sourced the original File Manager that shipped with Windows 3.0, allowing users to make changes and if they want, compile it for use on Windows 10. Now, the firm is making it easier to run the legacy app, as it's offering the Windows 3.0 File Manager through the Microsoft Store (via Aggiornamenti Lumia) as a UWP app.

The app is listed as being available on PC, mobile, Surface Hub, and HoloLens; however, it also requires the device to be installed on Windows 10 build 16299 or newer. Obviously, there are no mobile devices that qualify. If you do have a Windows phone that you want to try it out on, you could always download the code and try to compile it for an earlier build.

Obviously, there were some modifications that had to be made to the original app to get it to run on Windows 10. After all, Windows 3.0 was a 16-bit operating system. Microsoft also had to add header files that were previously stored in the NT source tree, and it had to make some APIs public.

This isn't the first time that Microsoft has dabbled in software nostalgia. As an April Fool's joke in 2015, it released an MS-DOS Mobile app for Windows phones. If you want to download the Windows File Manager app, you can find it here.

Latest Windows 10 build puts desktop apps in a 3D world

Mixed-Reality-Portal

Microsoft has released a new Insider preview build of Windows 10. Build 18329 should be available now to most people who have opted into the fast preview ring. Though it's not available to everyone because, for some reason, the new build isn't available in all the languages it'd normally be shipped in.

Top-Apps-In-Search

The strangest new feature is that you can now launch and run regular Win32 apps—2D apps built for the desktop—in the Windows Mixed Reality environment that's used for both virtual reality headsets and the HoloLens augmented reality headset. Previously, it was only possible to run apps built using the modern UWP API. Now, it seems that any Windows application will work. If you want to use Photoshop or Visual Studio with a headset on, you can.The new build also adds a couple of new scripts to support the writing of languages that until recently had no adequate written form. There's the Osage language spoken by the Osage Nation in Oklahoma (which prior to 2006 used the Latin alphabet with various diacritics) and the ADLaM script used to write Pular, the language of the Fulani people in West Africa (which, similarly, used the Roman alphabet with diacritics prior to the development of the new alphabet in the 1980s). ADLaM and Osage were both added to Unicode in 2016.

GitHub now gives free users unlimited private repositories

github-unlimited-private-repositories

GitHub is by far the most popular way to build and share software. That said, one weakness of the platform is that it limits who can create private repositories – that is, software projects that aren’t visible to the broader public, and are shared only with a handful of pre-defined collaborators – to paying users.

Fortunately, that’s no longer the case, as GitHub today announced it was giving users of its free plan access to unlimited private repositories. This is great news for GitHub’s users, but there is a caveat, of course.

Private repositories on free accounts are limited to three collaborators apiece. So, while this might work for a small project (like, for example, a team competing in a hackathon), it isn’t particularly well-suited for actual commercial usage.

That was probably a deliberate move from GitHub. There’s little risk of the company cannibalizing its existing paid users with this new free offering.

Until recently, developers who wanted to create private git repositories without opening their wallets were forced to use a rival service – most frequently BitBucket. Today’s news, obviously, isn’t great for Atlassian’s flagship code sharing platform, but it does mean that coders aren’t forced to use two disparate code management services for their private and public projects

I also wonder what ubiquitous private repositories will mean for Github’s culture of self-exhibition and sharing.

iPhone owners have less than two weeks to replace battery for £25

Why-Does-My-iPhone-Battery-Die-So-Fast-Heres-The-Real-Fix-828x466

Owners of iPhones with failing batteries have 12 days to take advantage of Apple’s out-of-warranty £25 battery swap offer before the price rises to as much as £65.

The discounted battery replacement scheme, which applies to the iPhone 6 and newer models, was launched following revelations last year that Apple was intentionally slowing iPhones because of worn batteries.

Apple apologised and reduced the cost of its out-of-warranty battery replacements for iPhone 6 and 6 Plus, 6S and 6S Plus, SE, 7 and 7 Plus, 8 and 8 Plus and iPhone X.

It also rolled out an iOS software update that showed the health of the phone’s battery and allowed users to switch off the feature that slowed their performance to avoid power problems.

If the iPhone reports that the battery is worn out or a user experiences slower performance because of an old battery, they can get it replaced in-store for £25 or via post for an additional £7.44 shipping fee.

But from 1 January, the cost of a battery replacement will increase to £45 for phones from the iPhone 6 or newer, or £65 for the iPhone X. The cost for older iPhones such as the 5S will be £79.

Battery replacements within the warranty period, or if the user has Apple’s extended warranty, AppleCare+, are free.

Microsoft’s new Office icons are part of a bigger design overhaul

office_icons_HD_00007

Microsoft is modernizing its Office icons as part of a broader focus on design for its various Office apps. It’s the first time the Office icons have changed in five years, and they’re designed to be more simple and modern to span across multiple devices and platforms. Office now exists on Windows, Mac, iOS, and Android, and Microsoft has been building a single core codebase to make rapid monthly improvements to the apps. These icons are designed to reflect how Office has changed recently, with new AI features, more collaborative features, and its platform independence for key apps like Word, Excel, PowerPoint, and Outlook.

The new icons deemphasize the letter for each Office app, but still manage to look familiar. “Our design solution was to de-couple the letter and the symbol from the icons, essentially creating two panels (one for the letter and one for the symbol) that we can pair or separate,” explains Jon Friedman, partner director of design at Microsoft. “This allows us to maintain familiarity while still emphasizing simplicity when inside the app.”

Google hints shutting down Google News over EU’s implementation of Article 11 or the “link tax”

458475271

Last week, The Guardian reported that Google may shut down Google News in Europe if the “link tax” is implemented in a way that the company has to pay news publishers. According to the “link tax” or Article 11, news publishers must receive a fair and proportionate remuneration for their publications by the information society service providers.

The vice president of Google News, Richard Gingras expressed his concern regarding the proposal and told The Guardian that the discontinuation of the news service in Europe will depend on the final verdict, “We can’t make a decision until we see the final language.”

The first draft of the “link tax”, or more formally, Directive on Copyright in the Digital Single Market was first issued in 2016. After several revisions and discussions, it was approved by the European Parliament on 12 September 2018. And, now a formal trilogue discussion with the European Commission, the Council of the European Union and the European Parliament is initiated to reach the final decision. The conclusion of this discussion is expected to be announced in January 2019.

Another part of the proposed directive, Article 13 is designed to ensure content creators are paid for material uploaded to sites such as the Google-owned YouTube. Article 11 and Article 13 have faced a lot of criticism since the directive was proposed. Mr. Gingras further said that when in 2014 the Spanish government attempted to charge a link tax on Google, the company responded by shutting down Google News in the country. It also removed Spanish newspapers from the service internationally. This resulted in a tremendous fall in traffic to Spanish news websites. “We would not like to see that happen in Europe,” Gingras added.

Julia Reda, an MEP, however, believes that this “link tax” will not be as extreme as the link tax implemented in Spain, where Google was required to pay publishers even if they didn’t want to be paid. “What we think is more likely is that publishers will have the choice to ask for Google to pay or not,” she told WIRED.

To know more in detail about Google’s response towards the link tax, read the full story on The Guardian.

Amazon’s Fire TV Cube is a set top box crossed with an Echo

FireTVCube

Amazon just added another model to its increasingly crowded selection of living room offerings. There’s bound to be some consumer confusion around the line, but the Cube differentiates itself by bridging the gap between Fire TV and Echo. Sure, past set top offerings have incorporated Alexa control, but this latest addition folds in the full smart speaker experience.

In fact, the Cube looks like a big, square Echo Dot. It’s not much to look at, honestly, but the familiar design elements are all there, including the four Echo buttons on top and a glowing blue light that lets you know when Alexa is listening.

The Fire TV Cube follows the lead of the JBL Link Bar announced back at I/O, which has Chromecast built in and effectively doubles as a Google Home when not in use. Here, however, the speaker is only really good for Echo-like functionality. Amazon is largely banking on users bringing their own home theater system to the table.

The upshot of that is that the device runs $120 normally, a price that includes an IR extender capable and ethernet adapter. And those who pre-order the thing in the next two days can get their hands on one for $90. There’s also a $200 bundle that includes Amazon’s Cloud Cam, for those who really want to go all in with Amazon hardware.

Microsoft snaps up GitHub for $7.5 billion

microsoft-github-800x421

As we anticipated yesterday, Microsoft has reached an agreement to buy GitHub, the source repository and collaboration platform, in a deal worth $7.5 billion. The all-stock deal is expected to close by the end of the year, subject to regulatory approval in the US and EU.

Decade-old GitHub is built on Git, the open source version control software originally written by Linux creator Linus Torvalds. Git is a distributed version control system: each developer has their own repository that they make changes to, and these changes can be propagated between repositories to share those changes. GitHub provides a repository hosting service: a place to put those repositories so that other developers can readily access them. Since its inception, it has become a mainstay of the open source world, with countless projects—including Microsoft projects such as the Visual Studio Code text editor and the .NET runtime—using GitHub repositories as a place to publish their code to the world and coordinate collaborative development. In total, some 28 million developers use GitHub, and there are 85 million code repositories.

Advertsing

125X125_06

Planet Xamarin

Planet Xamarin




TagCloud

MonthList