June 2005 - Posts
Wow, am I getting tired of seeing the screens from this little piece of software. WebMarshal is a web filtering tool to block access to unacceptable sites. It and its companion, MailMarshal, are becoming the bane of my existence!
Last week the blooming thing blocked all access to dotnet.org.za, and today I notice I can no longer get to slashdot, both apparently fitting the “block p0rn0.gr@phy” rule. Hmmm. Come on dotnetters, please only post high quality p0rn from now on.
Note: note my creative spelling above. Wouldn't want to get blocked again. It's quite a process to get it opened again.
[Yes, I know it is not the software that is the problem, but it's still the WebMarshal screen I keep seeing]
Microsoft have released a free ebook on their site called
Introducing Visual Basic 2005 for Developers. I remember when .net 1.0 came out I read a great little primer on vb.net for vb6 developers and it covered a lot of the basics in a really simple, concise, clear manner, so I'm hoping this one is similar.
Those who know me know that I am really not a violent person, but I've just gotten access to my blog again (we were blocked by webmarshal, yippee) and I've got a TON of blog spam. One day I will catch one of these scum-of-the-earth, and he will feel some serious pain.
In fact, it will be the same day I catch one of our superb taxi drivers...
And a telkom exec...
This was annoying, but I finally found how to get the user's domain and username (e.g [domain]\[username]). I was fooling around with (amongst others) System.Environment properties (e.g. .UserName), but not getting the domain part. Then I found this article by Peter A. Bromberg, Ph. D., and within the code sample I found what I needed:
System.Security.Principal.WindowsIdentity.GetCurrent().Name
I was trying to load a file from a supplied path and name, and I was concatenating strings. I forgot to include a trailing '\' though, so the app failed. Then I remembered that System.IO.Path.Combine does the '\' checking for you. So, today's lesson - when building a path string use System.IO.Path.Combine.
[Update: there are various conditions of when and how Path.Combine works - check my follow-up post to see more]
[This post is originally from my old Blogger site, but has been getting some interest lately, so I thought it might be worth re-posting here on my new blog]
I've been working quite a bit with XML Web Services lately, and every now and then I get the following exception:
"Only one WebServiceBinding attribute may be specified on type..."
A search on Google returned few results, only one of which was helpful. It suggested restarting Visual Studio. This works, but I was curious as to what was happening. I discovered that Visual Studio.Net stores a cached version of whatever Web Application is currently open, and that this cache can become corrupted. The location of this cache can be found in Tools - Options - Projects - Web Settings, under the "Offline Projects" section. To fix this problem, browse to the folder and delete the specific cache for the web services project, then close and re-open the solution from within V.S. Alternatively, as the gotdotnet posting suggests, just close and re-open the entire IDE. I've also heard of other problems occurring from this cache becoming corrupted, but there does not seem to be an actual way to rebuild it directly from within Visual Studio.
Does anybody know of a way to do this?
[Update: Read the comments on the original post for some more info. The most recent comment indicated that it might have to do with referencing one of the web service projects within a single solution from more than one other project in the same solution, which I had done as well (I had 2 different front ends).]