March 01, 2015

Azure Websites not work with MX records and Mail Server

Error:
MX Records conflict with Windows Azure website host
MX Records conflict with azurewebsites.net
Mail server not working with azurewebsites.net
Azure Websites not work with MX records
Windows Azure CNAME causes email problems
Windows Azure CNAME causes email server ignore mail forwarding

Test:
Just use of this command for find out problem. If your answer is so like to below result your MX records are correct.
Command: 
nslookup -q=mx domain.com
Correct Result: 
domain.com MX preference = 10, mail exchanger = blah-blah.com
But in my case after set a website host from azurewebsites.net MX records gone, because CNAME record affects the other records

Solution:
Remove CNAME records after set custom domain in Windows Azure panel and just use of A record

February 22, 2015

The prefix attribute on head for Open Graph is missing

Error: 
The 'prefix' attribute on <head> for Open Graph is missing


Solution:
Just add this prefix to your head element
<head prefix="og: http://ogp.me/ns#">

December 29, 2014

IDENTITY_INSERT is set to OFF

Error:
Cannot insert explicit value for identity column in table 'XYZ' when IDENTITY_INSERT is set to OFF.



Solution:
If you work on ASP .Net vNext with MVC 6.0 and EF 7.0 beta, welcome to hell :-))
It's was kidding.

Solution 1 is add [DatabaseGenerated(DatabaseGeneratedOption.None)] annotation to your ID of your Table (class model)

Solution 2 is add below line to OnModelCreating override method of your DbContext
builder.Entity<XYZ>().Property(i => i.Id).GenerateValuesOnAdd(generateValues: false);

December 23, 2014

No service for type

Error:
An unhandled exception occurred while processing the request.
Exception: TODO: No service for type 'ABC.Services.XYZService' has been registered.
Microsoft.Framework.DependencyInjection.ServiceProviderExtensions.GetRequiredService(IServiceProvider provider, Type serviceType)

Solution:
If you have a new Service in your ASP .Net vNext, you need to add below line in ConfigureServices(IServiceCollection services) function in Startup.cs for register it ;-)

services.AddTransient<XYZService>();

PS: At this time ASP .Net vNext, Visual Studio 2015 and MVC 6.0 are beta version.
Update 1: it could be solved with this services.AddScoped<XYZService>();