How to use Office UI Fabric in your Web Applications

The Office UI Fabric framework is a easy to use UI framework that provides you with CSS and JavaScript components allowing you to style your web applications, making them seamlessly integrate with the Office 365 and SharePoint Online user experience.

You can fine out more at on the Office UI Fabric site and you can visit the Office UI JS GitHub site here to find out how to use the JavaScript components.

In my video here I show a quick demo of how to include the components in your own web application.

Video Tutorial – Azure Functions, FaaS and Serverless Architectures.

It seems like Microsoft is constantly adding new services and features to Windows Azure and one of the latest services Azure provides is Azure Functions.

Azure Functions are born from the notion of Functions as a Service (FaaS) and builds on the serverless architecture paradigm that has come about recently as a new way to think about building tradition web solutions. It’s the idea of offloading work to the cloud but instead of using traditional PaaS offerings such as the Azure App Service where you still have to build your web services with WebAPI or WCF you build your functions inside the Azure Functions service and have it automatically create the HTTP endpoints, authentication and all the other management and setting up that goes around deploying web services.

You can find out more about what features and scenarios Azure Functions support by visiting http://functions.azure.com.

You might also want to read through this great article by Mike Roberts on serverless architectures.

The video below walks through creating a simple application first using a WebAPI based service and then replacing it with an Azure Function.

ASP.Net Core 1.0 RTM – Serving Static Files

If you have been using ASP.Net Core pre RTM release then you might have been using the Microsoft.AspNetCore.StaticFiles dependency to serve up static content from your ASP.Net web application.

If you have been using the latest stable version of this dependency 1.0.0 then you may come across an issue when using the RTM release of ASP.Net Core.

With the RTM release and Update 3 for Visual Studio 2015 we now have a Program.cs with a Main() entry point to our application added to our project when we create a new web application.


public class Program
 {
    public static void Main(string[] args)
    {
        var host = new WebHostBuilder()
           .UseKestrel()
           .UseContentRoot(Directory.GetCurrentDirectory())
           .UseIISIntegration()
           .UseStartup<Startup>()
           .Build();

           host.Run();
    }
 }

As you can see there is a .UseContentRoot extension method that gets called setting the content root of our application to the current directory.

To use static files we still need need to reference the Microsoft.AspNetCore.StaticFiles dependency but we must use the pre-release version 1.0.0-rc2-final or we will get the following error.

Error CS0121 The call is ambiguous between the following methods or properties: ‘Microsoft.AspNetCore.Hosting.WebHostBuilderExtensions.UseContentRoot(Microsoft.AspNetCore.Hosting.IWebHostBuilder, string)’ and ‘Microsoft.AspNetCore.Hosting.HostingAbstractionsWebHostBuilderExtensions.UseContentRoot(Microsoft.AspNetCore.Hosting.IWebHostBuilder, string)’

The reason is that the WebHostBuilderExtensions class that contains the UseContentRoot method has been moved to the Microsoft.AspNetCore.Hosting assembly and if you reference version 1.0.0 and not 1.0.0-rc2-final version of the Microsoft.AspNetCore.StaticFiles assembly then you will get an ambiguous reference between these namespaces.

To setup static file serving correctly with RTM just add a dependency to 1.0.0-rc2-final version of Microsoft.AspNetCore.StaticFiles and then add the following in your Startup.cs.


public void Configure(IApplicationBuilder app)
{
    app.UseStaticFiles();
}

You can see the updated documentation for static files here:

https://docs.asp.net/en/latest/fundamentals/static-files.html