Sebastian Wojciechowski’s WebLog

.NET Developer

Google toolbar 4 beta

Check it out. New version of Google Toolbar. It has a new looks. Take a look at it, maybe you will like it :-) It’s still beta.

http://www.google.com/tools/toolbar/T4/index.html

Just found those cool things:

  • When you type text toolbar gives you suggestions and checks for typos
  • When you type text which is longer that a toolbar’s textbox, it expands! that what I was missing. Now you can type long sentences and see it all.

So go ahead and download it, now! :-)

For SharePoint developers working with URL is a crucial thing. So probably many of us noticed that BasePath property of Uri class is private. Maybe it is something like property in .NET 1.0 (example in “Framework Designing Guidelines”) but I don’t think so.

So, how we can solve this? Well, in a SharePoint context I think we can use segment method, because in SharePoint we always get a file name at the end of the URL.

1 Uri testUrl = new Uri(http://testUrl.com/something/list/AllItems.aspx);

2 string basePath = testUrl.AbsolutePath.Replace(testUrl.Segments[testUrl.Segments.Length - 1], “”);

In more advanced method you can check is the last segment is a file, for example by doing IndexOf(”.”);
Safer version is to use static method System.IO.Path.GetDirectoryName. Using this method we only have to replace “\” with “/” since GetDirectoryName translates it to a file path. It looks like this:

1 Uri testUrl = new Uri(http://testUrl.com/something/list/AllItems.aspx);

2 string basePath = Path.GetDirectoryName(testUrl.AbsolutePath).Replace(@”\”, “/”);

Here is a complete console application for you to test. If you know any other ways to get BasePath, be sure to comment this post.

 

using System;
using System.IO;

class MyApp
{
    [STAThread]
    static void Main(string[] args)
    {
        Uri testUrl = new Uri(“http://testUrl.com/something/list/AllItems.aspx”);

        //Segments method
        Console.WriteLine(“Using segments:” +
                   testUrl.AbsolutePath.Replace(testUrl.Segments[testUrl.Segments.Length - 1], “”));

        //Path.GetDirectoryName method
        Console.WriteLine(“Using Path.GetDirectoryName: “ +
                Path.GetDirectoryName(testUrl.AbsolutePath).Replace(@””, “/”) + “/”);
        Console.ReadLine();
    }
}

Yesterday I ran into this problem. I tried to deploy Web Parts package with stsadm.exe and then bam!!

“The server instance specified was not found. Please specify the server’s address and port.”

On Saturday everything worked like a charm, and on Sunday that error (don’t ask how I know it worked on Saturday and Sunday ;-) ).
I didn’t do anything unusual. I’ve checked the Windows Auto update log, and it installed many updates on Saturday morning. I thought that it was it.

Anyway, what helped me is this post on Mohammed Jeelani’s Blog.

For me it was the first reason.

From time to time my keyboard gets stuck in Visual Studio.NET 2005 BETA 2. Enter, backspace, keyboard cut & paste just stop working in C# editor.
Seems that showing and hiding the solution explorer fixes this problem.
Looks like hidden panels steal focus - pin them, turn off auto-hide.
And if your keyboard gets really stuck, try to press Shift + Alt + Enter few times.

Good luck :-)

Are you tired of deploying applications with a millions of dll files?
for ex. Something.XML.dll, Something.DAL.dll, SomeControl.Something.dll

Now (well since 16 March 2005) you can merge those files into one single assembly and deploy just one file!
It is freely available for use from this page from “Other Tools & Utilities” section.

Best fo all - its license does allow commercial usage!

Be sure to read the article: “Merging .NET assemblies using ILMerge” from CodeProject . Hope it helps.

I am just a fan of custom installs. Every time I install something I choose custom to see what will be installed.
As you can see sometimes it’s not a good idea. Since first time I have installed Visual Studio 2005 Beta 2 I had problem with test projects. When trying to add a new test project I kept getting this error message:

Package 'Microsoft.VisualStudio.QualityTools.TestCaseManagement.QualityToolsPackage, Microsoft.VisualStudio.QUalityTools.TestCaseManagement, Version=8.0.0.0, Culture=neutral, PublicKeyToken=v03f577f11d50a3a' has failed to load properly ( GUID = {A9405AE6-9AC6-4F0E-A03F-7AFE45F6FCB7} ). Please contact package vendor for assistance. Application restart is recommended, due to possible environment corruption. Would you like to disable loading this package in the future? You may use 'devenc /resetskippkgs' to re-enable package loading.

It seems that Microsoft.VisualStudio.QualityTools.TestCaseManagement.QuailtyToolsPackage requires Team Foundation Client feature to work. It was one of that features I decided not to install since I didn’t plan to use it.

If you have other problems with Visual Studio 2005 Beta2 check out this page Visual Studio 2005 Beta 2 Install Issues

Microsoft has provided 101 samples for Visual Studio 2005 for download on MSDN website. Samples are avaible both in C# and VB.NET .
They have been written and tested with Beta 2 of Visual Studio 2005
Right now there are 4 main categories:

  • Base Class Libraries
  • Data Access
  • Web Development
  • Windows Forms

plus the remaining 51 samples are coming soon.

http://lab.msdn.microsoft.com/vs2005/downloads/101samples/default.aspx

« Newer Posts - Older Posts »