Soliving: Visual Studio 2013 U1 Lightswitch – March 2014–Can’t create project (.lsxtproj) is not supported.

After updating the SQL Server Data Tools in Microsoft Visual Studio 2013, creating a LigthSwitch project will result in an error: ‘…\Application1.lsxtproj’ cannot be opened because its project type (.lsxtproj) is not supported by this version of the application. To open it, please use a version that supports this type of project.

 

I installed everything regarding the SQL Server Data Tools and after restarting Microsoft Visual Studio 2013, I could create a LightSwitch project again.

 

Note

On my development machine: “Micrososft Office Developer Tools for Visual Studio 2013 – March 2014 Update” is installed.

image

Solving: Found conflicts between different versions of the same dependent assembly.

 

I was getting the warning: C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(1546,5): warning MSB3247: Found conflicts between different versions of the same dependent assembly.

The was caused by the referenced assembly System.Net.Http.

Solution

Edit the *.csproj file and change:

<Reference Include="System.Net.Http, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />

to

<Reference Include="System.Net.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />

 

http://connect.microsoft.com/VisualStudio/feedback/details/733213/warning-generated-for-default-asp-net-mvc-4-project

 

 

And in the web.config add:

<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Net.Http" culture="neutral" publicKeyToken="b03f5f7f11d50a3a" />
<bindingRedirect oldVersion="0.0.0.0-4.0.0.0" newVersion="4.0.0.0" />
</dependentAssembly>

Fix: Unable to delete file "…". Access to the path ‘…’ is denied.

I was getting a build error: “Unable to delete file "…". Access to the path ‘…’ is denied.”, when building a solution in Microsoft Visual Studio 2013.

I fixed the problem by:

  • Closing Microsoft Visual Studio 2013
  • Opening a command prompt in administration mode and then, running:
  • rd /s /q (to remove all file from the debug folder).

How to simply compare two tables on different SQL Server instances.

I restored a backup of a database on a different SQL Server instance running on the same server and I wanted to compare data in a table found on SQL Server Instance 1 with the same table on SQL Server Instance 2.

 

First add a linked server (all queries will be run from [MyServer\MyInstance1])

exec sp_addlinkedserver @server = 'MyServer\MyInstance2'
go

Then compare the data in the two tables with a except statement:

 

select * from [MyServer\MyInstance1].MyDatabase1.dbo.MyTable1
except
select * from [MyServer\MyInstance2].MyDatabase1.dbo.MyTable1

Fix: Could not connect to a SQL Server 2014 instance from within Microsoft Visual Studio 2013.

 

I installed SQL Server 2014, but from within Visual Studio 2013 I could not connect to the newly installed instance.

 

image

 

 

image

 

 

This was caused by the missing Microsoft Visual Studio update: “Microsoft SQL Server 2014 Update for database tooling”:

 

 

image

 

After installing the update, I was able to connect to a SQL Server 2014 instance from within Microsoft Visual Studio 2013.

 

image

Fix: ‘Could not find the Database Engine startup handle’ during SQL Server 2014 installation on Windows 8.1

After the installation of SQL Server 2014 was almost completed on a Windows 8.1 workstation, I got the error: "Could not find the Database Engine startup handle".

 

This was caused by the fact, that I used all standard settings during installation. When you choose all to install SQL Server 2014 with all default options, the SQL Server windows service will run under the NT Service\MSSQL$V2014 account, after changing this login to a correct login (a local admin account on the box) the service started correctly and I could login to the SQL Server 2014 instance.

 

image

JavaScript DateTime daylight saving pitfall

Be aware, that dates with different daylight saving times, don’t differ by 24 hours per day, but 24 * days + 1 hour or 24 * days – 1 hour:

 

var app = (function ()
{
var self = this;
// The "main" entry point for this application.
self.start = function ()
{
console.log("Document ready!");
self.daylightSavingsTest();
};
self.daylightSavingsTest = function ()
{
// Notes (in the netherlands):
// "Winter time" refers to "standard time".
// "Summer time" refers to "standard time" + 1 hour.
// Time changes at sunday [2014-03-30: 02:00:00.000]. Changes to [2014-03-30: 03:00:00.000]. 
var d1 = new Date(2014, 1, 1, 0, 0, 0, 0); // '2014-02-01: 00:00:00.000';
var d2 = new Date(2014, 1, 3, 0, 0, 0, 0); // '2014-02-03: 00:00:00.000';
// [getTime()], returns the number of milliseconds since [1970-01-01 00:00:00] (winter / standard time).
var t1 = d1.getTime();
var t2 = d2.getTime();
// When all daylight saving times of 2 dates are the same, 
// you can calculate the difference in days between 2 dates with parseInt((t2 - t1) / (24 * 60 * 60 * 1000)):
var days = parseInt((t2 - t1) / (24 * 60 * 60 * 1000));
console.log(days); // Outputs: 2
// When all daylight saving times of 2 dates are NOT the same, 
// you can't calculate the difference in days between 2 dates with parseInt((t2 - t1) / (24 * 60 * 60 * 1000)):
d1 = new Date(2014, 2, 30, 0, 0, 0, 0); // '2014-03-30: 00:00:00.000';
d2 = new Date(2014, 3, 1, 0, 0, 0, 0);  // '2014-04-01: 00:00:00.000';
t1 = d1.getTime();
t2 = d2.getTime();
days = parseInt((t2 - t1) / (24 * 60 * 60 * 1000));
console.log(days); // Outputs: 1
// You can fix this by using Math.round:
days = Math.round((t2 - t1) / (24 * 60 * 60 * 1000));
console.log(days); // Outputs: 2
// Or just use moment.js!!!!
};
return self;
})();
// Start the application.
app.start();

 

image