Popular Posts

Monday, December 7, 2015

Get ip v4 or ip v6 c#

http://www.codeproject.com/Tips/1062341/Retrieve-IPv-and-IPv-IP-addresses-from-a-server

Monday, November 30, 2015

Wpf, wcf busy and cancel

http://www.codeproject.com/Articles/567356/Async-Await-in-WPF-to-invoke-WCF-with-Busy-Indicat

Tuesday, November 24, 2015

Wednesday, November 18, 2015

Excel to call. Net library

http://www.codeproject.com/Tips/1052970/Launching-a-VB-Net-Class-Library-from-an-MS-Office

Thursday, September 10, 2015

Tdd and javascript and typescript

https://visualstudiomagazine.com/articles/2013/06/01/test-driven-development-with-typescript.aspx?m=1

Saturday, August 22, 2015

Steps on creating local nuget packages


1- D:\rahman\LocalNuget\GenericRepository>c:\nuget\nuget spec (Create spec from project file)

2- D:\rahman\LocalNuget\GenericRepository>c:\nuget\nuget pack Core.GenericRepository.csproj -IncludeReferencedProjects -build (Create package with all referenced projects)

Friday, August 21, 2015

Entityframework data-migrations was raising "A network-related or instance-specific error occurred"

For some very strange reason when I was issuing the "Update-Database" command in the Package Manager Console I was getting the following error:

A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)

If I was running my application through the Console / Unit test it was working fine and creating the database and applying data migrations.

PM> update-database -verbose 

Provided the clue!! Data migration was strangely connecting to  .\SQLEXPRESS "(DataSource:  .\SQLEXPRESS, Provider: System.Data.SqlClient, Origin: Configuration)."

This clue made me curious on why this was happening even though the connection string and app config were both correct.

The solution was:

Strangely the start up project was set to another DLL project and even though in the Package Manager Console I was selecting my Data project and issuing the Update-Database command it was trying to get the connection string from the startup project that even didn't have any connection string at all.

Just some silly error that can cause you headaches!!!!



Thursday, July 16, 2015

Monday, July 6, 2015

Selfhosting web api in console

http://www.c-sharpcorner.com/UploadFile/b1df45/Asp-Net-web-api-self-hosting/

Console based windows service

http://www.codeproject.com/Tips/1006545/EasyService-Net-Create-a-Windows-Service-in-Second

Sunday, July 5, 2015

Thursday, July 2, 2015

Web api identity with refresh token

http://bitoftech.net/2014/07/16/enable-oauth-refresh-tokens-angularjs-app-using-asp-net-web-api-2-owin/

Tuesday, June 30, 2015

Web api authentication

http://www.asp.net/web-api/overview/security/individual-accounts-in-web-api?body=%20http://www.asp.net/web-api/overview/security/individual-accounts-in-web-api

Token based authentication web api

http://bitoftech.net/2014/06/01/token-based-authentication-asp-net-web-api-2-owin-asp-net-identity/

Bootstrsp via drag and drop

http://www.layoutit.com/

Thursday, May 28, 2015

Use gridview in asp.net mvc

http://www.dotnetfunda.com/articles/show/3075/quickly-listing-records-in-grid-in-aspnet-mvc

Displaying messages in angularjs

http://www.codeproject.com/Tips/992700/Display-Error-Messages-in-Angular

Angularjs dialogue box

http://www.codeproject.com/Articles/992699/An-Advanced-and-Easy-use-AngularJS-Modal-Dialog

Friday, May 15, 2015

Javascript in win form

http://www.codeproject.com/Articles/990346/Using-HTML-as-UI-Elements-in-a-WinForms-Applicatio

Saturday, May 2, 2015

IIS Express gives Access Denied error when debugging ASP.NET MVC - Stack Overflow

IIS Express gives Access Denied error when debugging ASP.NET MVC - Stack Overflow



After enabling Authorization and authentication in visual studio 2013 with Cassino (IIS express) was getting the following error:



Server Error in '/' Application.
Access is denied. Description: An error occurred while accessing the resources required to serve this request. The server may not be configured for access to the requested URL.
Error message 401.2.: Unauthorized: Logon failed due to server configuration. Verify that you have permission to view this directory or page based on the credentials you supplied and the authentication methods enabled on the Web server. Contact the Web server's administrator for additional assistance.


Solution:

The cause if had for this problem was IIS Express not allowing WindowsAuthentication. This can be enabled by setting
<windowsAuthentication enabled="true">
in the applicationhost.config file located at C:\Users[username]\Documents\IISExpress\config.

Wednesday, April 29, 2015

Saturday, April 25, 2015

Asp.net 5 features

http://stephenwalther.com/archive/2015/02/24/top-10-changes-in-asp-net-5-and-mvc-6

Friday, April 24, 2015

NCalc - Mathematical Expressions Evaluator for .NET - Home

NCalc - Mathematical Expressions Evaluator for .NET - Home



calculate mathematical expression - eval string expression in c#

Web Forms - AUTOFAC DEPENCEY INJECTION

Web Forms — Autofac 3.3 documentation



This worked:



 public class Global : HttpApplication, IContainerProviderAccessor

    {



        // Provider that holds the application container.

        static IContainerProvider _containerProvider;



        // Instance property that will be used by Autofac HttpModules

        // to resolve and inject dependencies.

        public IContainerProvider ContainerProvider

        {

            get { return _containerProvider; }

        }



        void Application_Start(object sender, EventArgs e)

        {

            // Build up your application container and register your dependencies.

            var builder = new ContainerBuilder();

            var assemblies = new List<Assembly>();

            assemblies.Add(Assembly.Load("Questionnaire.RepositoriesInterfaces"));

            assemblies.Add(Assembly.Load("Questionnaire.Data"));

            assemblies.Add(Assembly.Load("Questionnaire.Business"));

            builder.RegisterAssemblyTypes(assemblies.ToArray()).AsImplementedInterfaces();



            _containerProvider = new ContainerProvider(builder.Build());



            // Code that runs on application startup

            RouteConfig.RegisterRoutes(RouteTable.Routes);

            BundleConfig.RegisterBundles(BundleTable.Bundles);

        }

Wednesday, April 8, 2015

Transaction scope

http://www.codeproject.com/Articles/690136/All-About-TransactionScope

Thursday, April 2, 2015

Monday, March 30, 2015

Google map winform

http://www.codeproject.com/Tips/889136/Csharp-Google-Maps-in-WinForm-with-WebBrowser-and

Thursday, March 19, 2015

Miniprofiler entity framework

http://www.codeproject.com/Articles/882618/Mini-Profiler-from-Nuget

Alternative to automaper

http://www.codeproject.com/Articles/886420/TinyMapper-yet-another-object-to-object-mapper-for

Button with image and shape

http://www.codeproject.com/Articles/26622/Custom-Button-Control-with-Gradient-Colors-and-Ext

Monday, February 16, 2015

Url query builder

http://www.codeproject.com/Tips/873961/Better-URL-building-with-Flurl

Sqldependency and signalr

http://www.codeproject.com/Articles/874240/SignalR-Database-update-notifications-in-ASP-NET-M

Sunday, February 1, 2015

Msmq pub sub

http://www.codeproject.com/Articles/871746/Implementing-pub-sub-using-MSMQ-in-minutes