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…
The Windows 3.0 File Manager is now available in the Microsoft Store
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,…
Latest Windows 10 build puts desktop apps in a 3D world
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. 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.…
Lifetime Managers in Unity Container
The unity container manages the lifetime of objects of all the dependencies that it resolves using lifetime managers. Unity container includes different lifetime managers for different purposes. You can specify lifetime manager in RegisterType() method at the time of registering type-mapping. For example, the following code snippet shows registering a type-mapping with TransientLifetimeManager. var container = new UnityContainer() .RegisterType<ICar, BMW>(new TransientLifetimeManager()); The following table lists all the lifetime managers: Lifetime Manager Description TransientLifetimeManager Creates a new object of requested type every time you call Resolve or ResolveAll method. ContainerControlledLifetimeManager Creates…
ARM \ Logic App Deployment with Azure DevOps
Microsoft’s documentation refers to Logic Apps as being iPaaS or integration Platform-as-a-Service. The “i” in iPaaS indicates the strength of Logic Apps; not only are Azure systems integrated but external and third-party systems can be included in your Logic Apps, including Twitter, Slack, Office 365, and many others. This integration is done using a set of Microsoft-provided connectors. However, if a connector does not exist, then you can still integrate your logic app to external systems via their APIs. Go to the Azure portal https://portal.azure.com and create the logic app.…
Azure WebJobs API
This API is accessed the same way as the git endpoint. e.g. if your git URL is https://yoursite.scm.azurewebsites.net/yoursite.git, then the API to get the list of deployments will be https://yoursite.scm.azurewebsites.net/deployments. The credentials you use are the same as when you git push. See Deployment-credentials for more details. List all web jobs GET /api/webjobs Triggered Jobs List all triggered jobs GET /api/triggeredwebjobs Response [ { name: “jobName”, runCommand: “…\run.cmd”, type: “triggered”, url: “https://…/triggeredwebjobs/jobName”, history_url: “https://…/triggeredwebjobs/jobName/history”, extra_info_url: “https://…/”, scheduler_logs_url: “https://…/vfs/data/jobs/triggered/jobName/job_scheduler.log”, settings: { }, using_sdk: false, latest_run: { id: “20131103120400”, status: “Success”, start_time:…
Adding an external Microsoft login to IdentityServer4
This article shows how to implement a Microsoft Account as an external provider in an IdentityServer4 project using ASP.NET Core Identity with a SQLite database. Setting up the App Platform for the Microsoft Account To setup the app, login using your Microsoft account and open the My Applications link https://apps.dev.microsoft.com/?mkt=en-gb#/appList Click the Add an app button. Give the application a name and add your email. This app is called microsoft_id4_enrico. After you clicked the create button, you need to generate a new password. Save this somewhere for the application configuration.…
GitHub now gives free users 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,…
Adding Swagger to Web API project
Adding Swagger to your Web API project does not replace ASP.NET Web API help pages. Or maybe yes? Here how to implement Swagger in your apps
iPhone owners have less than two weeks to replace battery for £25
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…
Microsoft’s new Office icons are part of a bigger design overhaul
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…
Google hints shutting down Google News over EU’s implementation of Article 11 or the “link tax”
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,…
Connect ASP.NET MVC 4.6.2 project to IdentityServer4
I have a website running on ASP.NET MVC 4.5.2. I have an IdentityServer4 server running but when I try and authenticate against it I get an: invalid_request I googled a bit but I can’t find a solution. Finally, I found the way. First, in your IdentityServer4 you have to create a new client: public static IEnumerable GetClients() { return new List<client> { new Client { ClientId = “yourid”, AllowedScopes = new List<string> { “openid” }, AllowedGrantTypes = GrantTypes.Hybrid, RedirectUris = new List { “https://yoururl/signin-oidc” }, } } } When you…
Create a well formed URI using UriBuilder class with C#
You can use System.UriBuilder class to build a new well-formed URI. You need to set some property of UriBuilder object’s, like Scheme, Port, Host, Path etc… You can get generated URI using AbsoluteUri Method. // Generate a new URI. UriBuilder objUri = new UriBuilder(); objUri.Scheme = “http”; objUri.Port = 80; objUri.Host = “www.microsoft.com”; objUri.Path = “en-us/default.aspx”; Response.Write(“Genereted URI: ” + objUri.Uri.AbsoluteUri); Happy coding!
The Last Slice: challenge
Beat challenge 1 (download the game, change the code) here. Then beat challenge 2. First five to beat challenge 3 win $10,000 USD each. No joke. Challenge 1 This is the first of three challenges for The Last Slice: A retro 8-bit video game that’s currently impossible to beat. Clone or download the code, install the prerequisites on your Windows 10 PC, open TheLastSlice.sln file with Visual Studio and run the game. You have the source code…change it any way you’d like to beat the game. The Prerequisites Here’s what…
Gravatar Tag Helper for .NET Core 2.1
A tag helper is any class that implements the ITagHelper interface. However, when you create a tag helper, you generally derive from TagHelper, doing so gives you access to the Process method. In your ASP.NET Core project, create a folder to hold the Tag Helpers called TagHelpers. The TagHelpers folder is not required, but it’s a reasonable convention. Now let’s get started writing some simple tag helpers. Tag helpers use a naming convention that targets elements of the root class name (minus the TagHelper portion of the class name). In…
Amazon’s Fire TV Cube is a set top box crossed with an Echo
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…
Microsoft snaps up GitHub for $7.5 billion
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…
Microsoft has reportedly acquired GitHub
Microsoft has reportedly acquired GitHub, and could announce the deal as early as Monday. Bloomberg reports that the software giant has agreed to acquire GitHub, and that the company chose Microsoft partly because of CEO Satya Nadella. Business Insider first reported that Microsoft had been in talks with GitHub recently. GitHub is a vast code repository that has become popular with developers and companies hosting their projects, documentation, and code. Apple, Amazon, Google, and many other big tech companies use GitHub. Microsoft is the top contributor to the site, and…
Deferring Processing of Azure Service Bus Messages
Sometimes when you’re handling a message from a message queue, you realise that you can’t currently process it, but might be able to at some time in the future. What would be nice is to delay or defer processing of the message for a set amount of time. Unfortunately, with brokered messages in Azure Service Bus, there is no built-in feature to do this simply, but there are a few workarounds. In this post, we’ll look at four separate techniques: let the lock time out, sleep and abandon, defer the…
London launches world’s first contactless payment scheme for street performers
Here’s a casualty of the cashless society you might not have previously thought of: the humble street performer. After all, if more of us are paying our way with smartphones and contactless cards, how can we give spare change to musicians on the subway? London has one solution: a new scheme that outfits performers with contactless payment terminals. The project was launched this weekend by the city’s mayor, Sadiq Khan, and is a collaboration with Busk In London (a professional body for buskers) and the Swedish payments firm iZettle (which…
Microsoft Buys Conversational AI Company Semantic Machines
In a blog post, Microsoft Corporate Vice President and Chief Technology Officer of AI & Research David Ku announced the acquisition of Berkeley, California-based conversational AI company Semantic Machines. The natural language processing technology developed by Semantic Machines will be integrated into Microsoft’s products like Cortana and the Azure Bot Service. On its website, Semantic Machines says that existing natural language systems such as Apple Siri, Microsoft Cortana and Google Now only understands commands, but not conversations. However, Semantic Machines’ technology understands conversations rather than just commands. Some of the…
Microsoft turns SharePoint into the simplest VR creation tool yet
Microsoft is sticking with its pragmatic approach to VR with SharePoint spaces, a new addition to its collaboration platform that lets you quickly build and view Mixed Reality experiences. It’s a lot like how PowerPoint made it easy for anyone to create business presentations. Sharepoint spaces features templates for things like a gallery of 3D models or 360-degree videos, all of which are viewable in Mixed Reality headsets (or any browser that supports WebVR). While they’re certainly not complex virtual environments, they’re still immersive enough to be used for employee…
Given, When, Then
Given-When-Then is a style of representing tests specifying a system’s behavior. It’s an approach developed by Dan North and Chris Matts as part of Behavior-Driven Development (BDD). It appears as a structuring approach for many testing frameworks such as Cucumber. You can also look at it as a reformulation of the Four-Phase Test pattern. The essential idea is to break down writing a scenario (or test) into three sections: The given part describes the state of the world before you begin the behavior you’re specifying in this scenario. You can…
7 Popular Unit Test Naming Conventions
Following are 7 popular unit tests naming conventions that are found to be used by majority of developers and compiled from above pages: MethodName_StateUnderTest_ExpectedBehavior: There are arguments against this strategy that if method names change as part of code refactoring than test name like this should also change or it becomes difficult to comprehend at a later stage. Following are some of the example: isAdult_AgeLessThan18_False withdrawMoney_InvalidAccount_ExceptionThrown admitStudent_MissingMandatoryFields_FailToAdmit MethodName_ExpectedBehavior_StateUnderTest: Slightly tweeked from above, but a section of developers also recommend using this naming technique. This technique also has disadvantage that if…