Azure-System.MethodAccessException: Attempt by security transparent method

Today I faced a strange issue, after publishing an empty ASP.NET MVC application to Azure WebSite. When I tried to browse the page I got an exception like this - Attempt by security transparent method ‘System.Web.WebPages.Administration.SiteAdmin.RegisterAdminModule()’ to access security critical method ‘System.Web.WebPages.ApplicationPart..ctor(System.Reflection.Assembly, System.String)’ failed. Here is the screenshot This issue...


View Components in ASP.NET MVC 6

In ASP.NET MVC 6, Microsoft introduced View Components, which similar to partial views, but they are much more powerful. It is like a mini controller, which helps to render a part of response rather the whole response. View Components consists of two parts, a class, derived from ViewComponent class(Similar to...


Cookie Authentication in ASP.NET 5

This post is about cookie based authentication in ASP.NET 5. I am implementing a cookie authentication in ASP.NET MVC application. Similar to other middleware components in ASP.NET, Cookie Authentication is also a middleware component, which you need to plug into ASP.NET pipeline. For implementing cookie authentication, you require reference of...


Sending email message using Exchange Web Service Managed API

Microsoft Exchange Web Services (EWS) is an interface by which you can programmatically manage Exchange items such as calendar, contact, and email. Microsoft Exchange Web Services is an Application Programming Interface (API) that provides programmatic access to the information and business logic in Microsoft Exchange Server 2007 or later versions....


Using SignalR in ASP.NET 5

In this post I am implementing a whiteboard solution using SignalR and ASP.NET 5. To use SignalR, you need to add “Microsoft.AspNet.SignalR.Server” reference in the project.json file. { "dependencies": { "Microsoft.AspNet.Diagnostics": "1.0.0-beta1", "Microsoft.AspNet.Hosting": "1.0.0-beta1", "Microsoft.AspNet.Server.WebListener": "1.0.0-beta1", "Microsoft.AspNet.StaticFiles": "1.0.0-beta1", "Microsoft.AspNet.SignalR.Server": "3.0.0-beta1" }, "commands": { "web": "Microsoft.AspNet.Hosting --server Microsoft.AspNet.Server.WebListener --server.urls http://localhost:5010" },...


Creating a WCF service proxy with ChannelFactory

A proxy, in its most general form, is a class functioning as an interface to something else. The proxy could interface to anything: a network connection, a large object in memory, a file, or some other resource that is expensive or impossible to duplicate.(From wiki). In case of WCF, proxy...


Windows is trying to configure Visio upon Application Start-up

This post is not related to anything programming :) In my system, when launching Visio, the application will pause while displaying “Please wait while Windows configures Microsoft Visio”. And after sometime, it shows the main window. I tried repair, but it was not working. Today I found a similar Microsoft...


How to deploy your nuget packages locally

In ASP.NET 5, everything is nuget package. If you are developing a class library, that is also has to be a nuget package, which you can add as dependency in a different project.json file. This post will help you to build nuget package and deploy it locally. To build nuget...