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 :-)

Jun 09

Linkedin hack: bad security policy unneccesarily exposed password of linkedin users

This week about 1,5 million password were published that where stolen out of the LinkedIn database. While every system has its weakness and no system is full proof, this exposure of passwords is COMPLETELY unnecessary.

Why you should never store passwords?
Linkedin stores all the password in a database. They indeed n the password, but in a weak manner. But even if you do encrypt them, there is still an encryption key that can be stolen. You still are vulnerable to theft of this key, once you store password.

How to prevent stolen passwords?
There is a simple solution: DON’T STORE ANY PASSWORDS

But how can you authenticate if you don’t have the password?
Instead of storing the complete (encrypted) password, you should store a hash of the password. By choosing a good algorithm it is impossible to retrieve the password simple because the information is not there !!

Simple, once you know IT


May 16

Scheduled periodic background task won’t start on Windows Phone

I’ve created an Windows Phone app that has a User interface app and background task to do some stuff periodically. The programs seems to run OK, no error messages and also seems to schedule the agent. The strange this is, that the agent never runs and there is no message / error or trace that indicates a problem.

One other detail is that on Settings -> Applications -> “background task” the app is not listed there. If the task should be working OK, than there should be the program name.  So apparently the Windows Phone does not see the periodic agent. There is no error whatsoever, no indication but the agent just does not run at all.

What is the solution that I’ve found so this problem: in order to start the the agent you must add a reference to the agent project in the front-end (user interface) project. Without this reference, the periodic task will never start. You add the reference by doing the following:

  • Go to the solution explorer
  • right click References
  • Add Reference
  • Project
  • Select the agent project from the list

If you run the Windows Phone app now, it should schedule the agent as I intended.

Simple once you know IT.


May 09

How to solve “There was no endpoint listening at …” on Windows Phone 7 connecting to Azure WCF service

My WCF Service works fine when I test it with wcftest. All the endpoints are exposed as intended. But when I try to consuming the service on my Windows Phone 7 I get the message:

There was no endpoint listening at http://myservice.cloudapp.net/GeneralApplicationServices.svc that could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details.

InnerException: {“The remote server returned an error: NotFound.”}

Everything in the code looked fine, wcftest is also working OK, so what could be the problem? After extensive searching with no decent result I made a new wp7 app with the same service reference. And guess what? It worked right away.

So what was the difference? After I remmed out all the non relevant code, I was left with basically 4 lines of code:

  1. initialize the context: context = newAppActivityClient();AppActivityClient 
  2.  add the eventhandler for the async service: context.AddCompleted += new EventHandler<AddCompletedEventArgs>(context_AddCompleted)
  3. Handle the Async event: MessageBox.Show(“It worked”)
  4. Call the service: context.AddAsync(Guid.NewGuid(),Guid.NewGuid(),Guid.NewGuid(),567,”Dit is de data2″,10,6)

Still not working. This were exactly the four lines of code in my newly created project that indeed was working very well. So no difference in the source code. I also used a fiex GUID (FD9EDB38-864D-49F2-A8AE-B6439AB3362D), no difference, I examined all other files in the solution….. And there was it, just in front of me:

The solution:

Add the networking capability to the WMAppManifest.xml. The code is:

<Capability Name=”ID_CAP_NETWORKING”/>

Normally this capability is default in the manifest. But I removed it, because the first version of my app didn’t need any networking capabilities.

Simple, once you now IT.


May 04

Azure deployment issue: Error: The deployment requires certificates that do not exist for the new hosted service.

When deploying a new Hosted Service on Microsoft Windows Azure I got the following error after I tried to create the new hosted service in the Azure Management portal:

Error: The deployment requires certificates that do not exist for the new hosted service.  To fix, create the new hosted service without the deployment, add the required certificate(s), and then create the deployment.  Find more solutions in the Windows Azure support forum.

This was strange, because I have never had this error before. After some searching I found out that I had checked “Enable Remote Desktop for all row”. I figured this caused the certificate requirement.

After unchecking this option, the problem persisted. Again I did some search and found out the issue:

You must uncheck ‘Enable Connection for all roles’ on the Azure project (Right click the Azure project in the Solution explorer -> Configure Remote Desktop:

Simpel, once you know IT