Um, that's not "the" GetUserName function. That function is not part of the .NET Framework. That is an example of a function that you can write yourself that uses My.User internally. That GetUserName function couldn't possibly have worked in VB6, so it must have been a different GetUserName function. I don't know whether My.User doesn't work without the application framework enabled but, as I said, you can just use Environment.UserName to get the name of the logged on user. If your app is using custom authentication then I'm not sure that that will work, but I'm guessing that you're not using custom authentication.