Oct 09

In Visual Studio 2012 a horribly slow performance on MVC 4 website running in Azure Emulator

I experience in Visual Studio 2012 a horribly slow performance on MVC 4 website running in Azure Emulator. The symptoms

  • very slow response on your MVC 4 website with Azure webproject
  • timeouts
  • website often unresponsive
  • no difference in performance using SQLExpress, Local IIS Web server or Visual Studio Development Server
  • when pausing the webapp during waiting for page loading the stack with external code displays Microsoft.WindowsAzure.ServiceRuntime.DefaultEntryPoint.Run()
  • ERROR_WINHTTP_AUTODETECTION_FAILED (12180) in the Azure Compute Emulator

As usual it took many hours to figure everything out and it took me 5 seconds to apply the solution:

  • goto Internet Explorer
  • Tools
  • Internet Options
  • Connections
  • LAN Settings
  • uncheck “Automatically detect settings”

My site is now running 10-20 times faster and is always responsive now :-)

Jul 10

C:WindowsMicrosoft.NETFramework64v4.0.30319Microsoft.Common.targets (1605): Could not resolve this reference. Could not locate the assembly “EntityFramework”. Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors.

Project build fine on local machine, but fails on TFS with error: C:WindowsMicrosoft.NETFramework64v4.0.30319Microsoft.Common.targets (1605): Could not resolve this reference. Could not locate the assembly “EntityFramework”. Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors.

It took me some time to solve, but the solution is simple: Add the package folder to sourcecontrol

◾go to source control explorer
◾open your solution
◾right click Packages folder
◾click ‘Add items to folder’
◾select all files
◾click next
◾click excluded items
◾select all files
◾click include items
◾click finish

 

Jun 26

Could not load file or assembly ‘Antlr3.Runtime’ or one of its dependencies. The parameter is incorrect. (Exception from HRESULT: 0x80070057 (E_INVALIDARG))

I think you recognize this: you’re in the middle of developping software, everything runs smoothly and you progresses quickly. But suddenly this feeling of happiness stops when you see an error like this: Could not load file or assembly ‘Antlr3.Runtime’
or one of its dependencies. The parameter is incorrect. (Exception from
HRESULT: 0x80070057 (E_INVALIDARG)) Antlr3.Runtime

You have really no clue where to find, but one thing is for sure: it’s not in your code, because you didn’t changed anything.

It happened to me when developping an MVC 4 .net 4.5 webapp. After extensive search the solution is (as usual) simple:

empty your %TEMP% folder:

  • close all programs that you are using (the one in the system tray included)
  • Click the start button
  • click Run
  • type: %TEMP% in the box
  • click the OK button

Now a the directory for temporary files opens:

  • select all files ( CTRL – A)
  • press the DELETE key on your keyboard
  • acknowledge that you want to delete all files

Hopes it helps you to save a few yours of searching

CD

Mar 24

Tables without a clustered index are not supported in this version of sql server

I try to do an insert in to n:n (SQL Azure based) related tables (UserSet and TenantSet) using the Entity Framework, but it fails with the error: “tables without a clustered index are not supported in this version of sql server”. I’ve used the model first approach to generate the SQL database, so the SQL Server database should be fine.

After extensive search it seems that the table UserTenant has no clustered index. The script that the Entity Framework generate contains (in my opinion) an error. The relevant part of the script is:

Creating primary key on [User_UserId], [Tenant_TenantId] in table ‘UserTenant’

ALTER
TABLE [dbo].[UserTenant]
ADD
CONSTRAINT [PK_UserTenant]
PRIMARYKEY NONCLUSTERED ([User_UserId], [Tenant_TenantId] ASC);
GO

Of course the NONCLUSTERED parameter should me CLUSTERED. Change that and run the script again.

That’s all, hope the Entity Framework team resolves this what looks like a bug.