Showing posts with label bugs. Show all posts
Showing posts with label bugs. Show all posts

Tuesday, August 17, 2010

Visual Studio 2010 COM-Interface Bugfest

"EnvDTE is an assembly-wrapped COM library containing the objects and members for Visual Studio core automation."

But unfortunately the implementation the the VS 2010 RTM version the library is pretty much unusable. Some methods like EnvDTE.Project.Delete() are not even implemented.


Others like EnvDTE._Solution.Remove(Project project) have buggy implementations. Removing a project with _Solution.Remove(Project project) will work, but when you try to add the same project from a different location using the _Solution.AddFromFile method you will end up with the error message "A project with that name is already opened in the solution". Once you removed it you have to restart Visual Studio if you ever want to be able to add the project to the solution.

As we speak the Visual Studio 2010 automation COM-Interface is not usable.

Tuesday, January 26, 2010

Do not use Windows Backup!

At the time we speak this application is FUBAR, or in other words "fucked up beyond all repair".

Why?

  • I never saw a completely successful backup, neither on my Vista Box nor on my Windows 7 box.
  • You only waste hours or days running backups that are never successful, scanning your disk with chkdsk of sfc, searching the net, searching the registry, screwing up your systems registry, or formatting your disk.
  • The errors are just cryptic hexadecimal numbers like 0x80070057, 0x80070570 without any reference to the cause of the error.

When I first started Windows Backup on Windows 7 I kept getting error 0x800700002 which quite obviously means, that a registry key named ProfileImagePath below HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList was pointing to a directory %systemroot%\system32\config\systemprofile that did not exist on my machine. In this case I could convince Windows Backup to go on after I manually created this directory for Windows Backup.
That was it? No. After that I got some obvious 0x80070570 followed of course by a 0x8007000D and on my Vista Box all I naturally get is 0x80070079. In the meantime I ran hours of chkdsk /r or sfc /scannow. In the end I assumed that maybe my backup hard drive had some kind of problem and reformatted it.

What I did not know at this point was that this meant the end for my "Windows Backup" on my machine. When I now start Windows Backup all I get is 0x80070057:



It took Microsoft half a year of investigation to find out that this error in fact is related to some problems they have with non-US locale settings.

The closest I ever got was a single unreproducible backup that ended "successfully with errors". But when I checked the log I found this error message:

Error while backing up "C:\Windows\System32\config\systemprofile\myFolder". The system cannot find the file specified (0x80070002))

The surprising part is, that this folder never existed and never will exist on my system. This raises the question, why a *backup* program starts seeing ghost files, which of course it later fails to find??

It also raises the question, what specifications, development and quality assurance process they have at Microsoft, that allows them to ship *twice* a solution that throws hexadecimal errors messages in a users face? From a software engineering perspective this is bare amateur level. If Microsoft wants to know, why the people love Apple, then here you got the answer. They would not ship crap like this once.

The reason could be simple. Because it feels like the core of Windows Backup is some component Microsoft bought and then tried to cram somehow into Windows. I would not wonder if there is just some sort of (former) third party backup.exe running under the hood.

As we speak of backup, means the security of your data, using Windows Backup you must ask yourself the following questions:

Do you really want to trust your data to a backup program
  • that is incapable of giving a useful error message?
  • that needs folders to be manually created to work at all?
  • that tries to backup files that do not exist?
  • that is dependent on US locale settings?
  • that even after the Vista desaster, Microsoft itself was unable to fix in the 3 years time until Windows 7?
So the conclusion is simple:

If you love your data,
do not use Windows Backup!

Wednesday, February 18, 2009

Screw Silverlight

The thought behind evaluating Silverlight 2 was to check whether Silverlight is suited to build rich office applications, that can be handled just like common GUI applications but just in IE. Another central question was to verify that I can use my Xaml controls from WPF applications seamlessly in Silverlight 2.
So I am really not interested in fancy design, multimedia and other special effects that seems to be the general target audience for Silverlight 2.

First thing you have to do when you try to evaluate Silverlight 2 with Visual Studio you have to download a whole bunch off applications. Most important it seemed to install the Silverlight Tools for Visual Studio 2008 SP1 .

After downloading some 70 megs of data the the first frustration is right around the corner, if you have to use an authenticating proxy to get Internet access.

Though you have to download some 70 megs the package needs to download more data. And of course there is nowhere a full package. Even more unfortunate it seems that until today Microsoft has never heard anything of a thing called authenticating proxy and consequently the install fails. Sigh.
Call it a act of despair and interest I programmed my own little authenticating proxy bridge that acts as proxy and forwards each request to the real proxy plus adding the required authentication information. So finally I was able to install the tools.

Ok, so I created a new Silverlight project, opened the toolbox, took a button and dropped it onto the designer and...

the designer won't let me do that.

Although we have a fully fledged Xaml designer in WPF, there is absolutely no way to add a control in the designer in Silverlight. You are supposed to drag the items out of the toolbox into the Xaml text editor where it does nothing but adding the following code

<
Button></Button>


Wow, what an awesome and intuitive feature for my 1500 USD Visual Studio.

Ok, lets hand code my button. After setting the button properties width and height you would like some text on your button.

So you code

<Button Width="100" Height="20">Press me</Button>

This is perfect Xaml, even Expression Blend will code it that way, it works fine for WPF, but .....

that is not good enough for Silverlight.

"Button does not support text content" is the error. It turns out that if you want to get it to work with Silverlight you have to code it

<Button Width="100" Height="20" Content="Press me"/>

So let me get this straight.

  • You have to download at least 4 packages to start with silverlight.
  • Even then these packages need to download more data and neither there are full packages available nor does the setup support simple things like authenticating proxies.
    No Internet access means no Silverlight.
  • The nice Xaml designer shipped with WPF had been crippled for Silverlight to be absolutely useless.
  • The Xaml for Silverlight is incompatible with other Xaml.
  • If you do not want to hand code every GUI element and if even if you have the 1500 USD Team Edition of Visual Studio 2008 you need to buy Expression Blend 2 for just another 699 USD.

Ok guys,

this is where my evaluation comes to an abrupt end after just 60 minutes and tell you what....

Screw Silverlight 2.

Tuesday, January 13, 2009

Dealing with Microsoft UDDI services

How do I install and setup Microsoft UDDI Services?

Read the UDDI SOA Howto.

Where to get the UDDI samples?


Microsoft did not include the UDDI samples in the current Windows SDK for Windows Server 2008 and .Net Framework 3.5.

Therefore you need to install the old Windows Server 2003 SDK .

After you installed the Core SDK you find the samples in

%PROGRAMFILES%\Microsoft SDK\samples\UDDI


Where to get Microsoft.UDDI.DLL?

You find it if you install the Windows Server 2003 SDK you find it in

%PROGRAMFILES%\Microsoft SDK\bin

or if you installed .NET 3.0 you find it in

%PROGRAMFILES%\Reference Assemblies\Microsoft\UDDI\v2.1\bin\system32


How to turn on Debugging?


If you want to turn on Debugging use regedit and goto:

[HKLM\SOFTWARE\Microsoft\UDDI\Debug]

set FileLogLevel to the appropriate value. Possible values are:

0 = None
1 = Error,
2 = Warning,
3 = FailAudit,
4 = PassAudit,
5 = Info ,
6 = Verbose

where 6 (Verbose) prints the most information into the file specified by LogFileName

How to configure another virtual directory for UDDI?

Open the IIS Manager, right click on Default Web Site and select New Virtual directory. Select a name for the alias, then select the UDDI/webroot folder (e.g. "c:\inet\uddi\webroot" ). Then select the Read, Run Scripts and Browse permission. After the wizard finishes right click on the virtual directoy and select Properties. Now change the Application Pool to "MSUDDIAppPool". Last thing is to select the ASP.NET tab and change the ASP.NET Version to 1.1.4322.

How to configure Authentication?

Microsoft UDDI offers basically 2 different types of authentication.

Windows Authentication and UDDIAuthentication. The difference is that in Windows Authentication you do not have to specify a Username and Password when you create the UDDIConnection object.

Windows Authentication
In Windows Authentication you do not have to specify a Username and Password. UDDI simply takes the Usercredentials received by the UDDI web service. To configure UDDI for using Windows credentials open the IIS Manager, right click the virtual directory (e.g. uddi or uddipublic), go to the Directory Security tab and click on Authentication and access control. Now make sure "Enable anonymous access" is disabled and Authenticated access is set to Integrated Windows authentication.

Ok, whats UDDIAuthentication?
When you use UDDIAuthentication you specify a Username and Password when you create the UDDIConnection object. However this user has to be a valid windows user account and has to have appropriate permissions. Using UDDIAuthentication the authentication of the account is not enforced by IIS but the UDDI Service will authenticate the user.
To configure UDDI for doing UDDI authentication open the IIS Manager, right click the virtual directory (e.g. uddi or uddipublic), go to the Directory Security tab and click on Authentication and access control. Now make sure "Enable anonymous access" is enabled.

Now use the following pattern:

UddiSiteLocation location = new UddiSiteLocation(
httpServerName + "inquire.asmx",
httpsServerName + "publish.asmx",
httpServerName + "extension.asmx",
"My Site",
AuthenticationMode.UddiAuthentication);

UddiConnection oConnect = new UddiConnection(location, @"Domain\Username", "Password");

oConnect.AutoGetAuthToken = true;

The secret to UDDI Authentication
1.) Try to the current user out the current HTTPContext (Windows Authentication)
2.) Query the Security.Authentication Mode Parameter which is set in the UDDI Database in table UDO_config.
3.) If the Security.Authentication Mode parameter is set to 8 UDDI tries Passport authentication.
4.) Windows Authentication is only used if the current user is not the anonymous user (Anonymous Access is disabled) and you did not specify a username in the connection.
5.) By Default UDDIAuthentication is used.


public AuthToken GetAuthToken(GetAuthToken gat)
{
Debug.Enter();
AuthToken token = new AuthToken();
try
{
IIdentity identity = HttpContext.Current.User.Identity;
int @int = Config.GetInt("Security.AuthenticationMode", 3);
if (8 == @int)
{
if (!(identity is PassportIdentity))
{
throw new UDDIException(ErrorType.E_fatalError, "UDDI_ERROR_PASSPORT_CONFIGURATION_ERROR");
}
Debug.Write(SeverityType.Info, CategoryType.Soap, "Generating credentials for Passport based authentication
dentity is " + gat.UserID);
PassportAuthenticator authenticator = new PassportAuthenticator();
if (!authenticator.GetAuthenticationInfo(gat.UserID, gat.Cred, out token.AuthInfo))
{
throw new UDDIException(ErrorType.E_unknownUser, "USER_FAILED_AUTHENTICATION");
}
if (!authenticator.Authenticate(token.AuthInfo, 0x3840))
{
throw new UDDIException(ErrorType.E_unknownUser, "UDDI_ERROR_USER_FAILED_AUTHENTICATION");
}
if (!Context.User.IsVerified)
{
throw new UDDIException(ErrorType.E_unknownUser, "UDDI_ERROR_NOT_A_VALID_PUBLISHER");
}
}
else if ((!((WindowsIdentity) identity).IsAnonymous && ((@int & 2) != 0)) && Utility.StringEmpty(gat.UserID))
{
Debug.Write(SeverityType.Info, CategoryType.Soap, "Generating credentials for Windows based authentication
Identity is " + identity.Name);
new WindowsAuthenticator().GetAuthenticationInfo(gat.UserID, gat.Cred, out token.AuthInfo);
}
else
{
if ((@int & 1) == 0)
{
throw new UDDIException(ErrorType.E_unsupported, "UDDI_ERROR_AUTHENTICATION_CONFIGURATION_ERROR");
}
Debug.Write(SeverityType.Info, CategoryType.Soap, "Generating credentials for UDDI based authentication");
new UDDIAuthenticator().GetAuthenticationInfo(gat.UserID, gat.Cred, out token.AuthInfo);
}
Debug.Write(SeverityType.Info, CategoryType.Soap, "Windows Identity is " + WindowsIdentity.GetCurrent().Name);
Debug.Write(SeverityType.Info, CategoryType.Soap, "Thread Identity is " + Thread.CurrentPrincipal.Identity.Name);
Debug.Write(SeverityType.Info, CategoryType.Soap, "HttpContext Identity is " + identity.Name);
Debug.Verify(Context.User.IsPublisher, "UDDI_ERROR_NO_PUBLISHER_CREDENTIALS", ErrorType.E_fatalError, new
bject[] { Context.User.ID });
Debug.Write(SeverityType.Info, CategoryType.Authorization, "Authenticated user (userid = " + gat.UserID + " )");
}
catch (Exception exception)
{
DispositionReport.Throw(exception);
}
return token;
}


Errors and Solutions

If authentication fails with "Authetication failed" and in the UDDI log you will see.

FAIL AUTH 2009/01/13 18:09:14 System.ArgumentOutOfRangeException: Length cannot be less than zero.
Parameter name: length
at System.String.Substring(Int32 startIndex, Int32 length)
at UDDI.API.Authentication.UDDIAuthenticator.GetAuthenticationInfo(String userid, String password, String& ticket)

Dont forget to put an @ before the string specifying the username so use:

string szUsername = @"Domain\User";