Tuesday, July 21, 2015

Visual Studio 2015


Some new features in Visual Studio 2015:
  • Visual Studio 2015 RC Downloads
  • .Net in GitHub
  • Vsual Studio Code
  • Visual Studio Online
  • Visual Studio 2015 includes Xamarin integrated for mobile development
  • Cordovo tooling in Visual Studio 2015
  • .Net and microservices
  • Don't have to build to run a web app
  • All source code are in Git hub (example Asp.Net MVC source code). If we get source code, source reference will override nuget package.
  • Dev and Test in Cloud - use virtual machines
  • Debugging
    • Performance step (no more debug trace lines)
    • Applying linq queries with lamda expression in the output window while debugging
    • Editing the linq query real time while debugging

Tuesday, November 11, 2014

Entity Framework Power Tools

Found this cool entity framework power tool to do reverse engineering for creating code first entity framework data models from an existing database.

Install the Entity Framework Power Tools Beta 4 from here:
https://visualstudiogallery.msdn.microsoft.com/72a60b14-1581-4b9b-89f2-846072eff19d

Once the tool is installed, you should be able to access the entity framework reverse engineer plugin from Visual Studio.

Right click on your solution in Visual Studio and you should see menu option for reverse engineer:
"Entity Framework" -> "Reverse Engineer Code First"

Create a class library for your data layer and click "Reverse Engineer Code First" menu option. Folowwing the instructions to create entity framework data models for an existing database.


Monday, November 3, 2014

Memory gates checking failed because the free memory is less than 5% of total memory

I got this exception when running a service on my localhost:

"Memory gates checking failed because the free memory (180146176 bytes) is less than 5% of total memory.  As a result, the service will not be available for incoming requests.  To resolve this, either reduce the load on the machine or adjust the value of minFreeMemoryPercentageToActivateService on the serviceHostingEnvironment config element."

 I checked memory usage in task manager and the free memory was indeed less than 5%.

Easy fix for this issue is to set "minFreeMemoryPercentageToActivateService" value in "serviceHostingEnvironment" configuration to 0:

<system.serviceModel>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" minFreeMemoryPercentageToActivateService="0"/>
</system.serviceModel>

Monday, June 2, 2014

Cannot drop database because it is currently in use error

We might get following error when we try to drop a database in SQL Server:

"Cannot drop database 'MyDatabaseName' because it is currently in user".

To resolve this error, alter the database first before deleting the database like below..

USE [master]
GO

ALTER DATABASE [MyDatabaseName] set single_user with rollback immediate

DROP DATABASE [MyDatabaseName]
GO


Thursday, March 6, 2014

Visual Studio solution file opens in notepad!

If you edit your visual studio solution (.sln) file in notepad and after that if the solution file always opens in notepad by default, then this is what you need to make the solution file open back in visual studio again:

1. Right click on the solution file, select "Properties"
2. Look for "Opens with:" option and change it to your Visual Studio version.



Saturday, November 17, 2012

The Principles of Open Space Conference

Today I attended a technical open space conference and I really liked the concept.

In brief these are the principles of open space conference:

1. Whoever shows up are the right people.
2. Whenever it starts, it starts.
3. Whenever it's over, it's over.
4. Wherever it happens is the right place.
5. Whatever happens is the only thing that could


Tuesday, February 21, 2012

Visual Studio Database (VSDB) Project issue with UDF and Views

In Visual Studio 2010, there seems to be a dependency problem with User Defined Functions (UDF) and Views. The deployment script created by the VSDB project always puts UDF before database Views. Consider this scenario, we have a database function which depends on a database view and we have altered both the function and the view. Now, when a deployment script is created for this database project, the altered function is always placed before the alter view statement. Running this script will fail at alter function statement because the dependent view was not altered yet. I could not find any settings in VSDB project to change the sequence order for the build, meaning build my database View first and then the UDF. The only workaround I found was to alter my database View in the pre-deployment script.