thefrozencoder

Programming and Technology blog

RDP Ubuntu 20.04 not working out of the box

Recently while setting up a new Ubuntu 20.04 VM (from the Quick Create in Hyper-V) I found that I could not RDP into the machine once it was setup, however it was sitting on my network configured with my NAT Switch.

Turns out that the xrdp daemon was not starting and had a cryptic error about VSOCK. Doing a bit of research found that I needed to edit the /etc/xrdp/xrdp.ini file and set the option use_vsock from true to false

#/etc/xrdp/xrdp.ini

use_vsock=false

After that change I restarted the xrdp daemon and was able to connect to it.

Unable to connect to web server 'IIS Express'.

 

Randomly would get this error and dialog when loading and running a new or existing Visual Studio Web project on a machine that never had run it before. The problem seems to have various solutions to it with varying results. Below is the solution that ultimately worked in my situation with the Event Log error I was getting.

First open up the Event Viewer in "Windows Administrative Tools" under the start menu. If you find the following error:

Unable to bind to the underlying transport for [::]:XXXXX. The IP Listen-Only list may contain a reference to an interface which may not exist on this machine.  The data field contains the error number.

Where XXXX is a port number for the website that is failing to run in Visual Studio.

If this is the case you can run the following command in an elevated PowerShell / command prompt

netsh http add iplisten ipaddress=::

Then reboot the machine and try again

Type 'ContosoUniversity.DAL.Department' could not be found

So I was going through the tutorial Handling Concurrency with the Entity Framework in an ASP.NET MVC Application when I encountered this error on step 7 of 10.

Type 'ContosoUniversity.DAL.Department' could not be found. Make sure that the required schemas are loaded and that the namespaces are imported correctly. Near type name, line 1, column 132.

The error is thrown on the following line:

var databaseValues = (Department)entry.GetDatabaseValues().ToObject();

This error is due to a bug in EF 4.1 where you separate the DAL and Model Entities out into different namespaces and is referenced here EF4.1 CodeFirst - entry.GetDatabaseValues() throw EntitySqlException.

To fix this issue I came up with this workaround:

Replace the lines:

var databaseValues = (Department)entry.GetDatabaseValues().ToObject(); 
var clientValues = (Department)entry.Entity;

with the following lines:

var clientValues = (Department)entry.CurrentValues.Clone().ToObject();
entry.Reload();
var databaseValues = (Department)entry.CurrentValues.ToObject();

It seems to work ok for simple concurrency checks and it allows you to continue on with the tutorial.

Workaround for Installing KB Article KB971092 successfully

In some cases there is an issue with installing the following update “Security Update for Microsoft Visual Studio 2008 Service Pack 1 (KB971092)”.  The workaround to properly install the update you must set the security on the files vsvars32.bat and vcvarsall.bat to allow the local Users group write permission on those files.  I am not sure why this is an issue but from reading other posts and such on the issue most of the affected people do not have vc++ installed.

They can be found in the following folders:

x86

  • C:\Program Files\Microsoft Visual Studio 9.0\VC\vcvarsall.bat
  • C:\Program Files\Microsoft Visual Studio 9.0\Common7\Tools\vsvars32.bat

x64

  • C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\vcvarsall.bat
  • C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\Tools\vsvars32.bat