Thursday, February 12, 2009

Existing Web Application is not listed on New Shared Services Provider page



In order for your Web Application to be visible in the "Web applications" dropdown list on the "New Shared Services Provider" page:

If your installation is "Application" or "Complete" as Setup names it, user identity for the application pool under which the web application is running has to be different from NetworkService.

If you are running a "Single Server" or how setup names it "Stand-alone" installation then application pool user is not taken into account.

TIP: When using stsadm.exe -o extendvs make sure that -apidtype paremeter is set to ConfigurableID and make sure that there is no typo in it, because stsadm will not show any error message. It will set NetworkService user as an application pool user (causing it not to be shown in the dropdown).

Saturday, September 6, 2008

Integrating Cellular Emulator support when running Device Emulator from Visual Studio

Each time you set COM ports to use Cellular Emulator in Microsoft Device Emulator you need to do soft reset which this takes time.
Problem is that those settings are not saved, so when next time you run Device Emulator from VS you need to set those properties again and do soft reset.

This is how to set those options so they are applied each time VS runs Device Emulator for you:

  1. Run Cellular Emulator and check port it runs on:
    image 
  2. In Visual Studio go to:
    Tools/Options/Device Tools/Devices
    image
  3. Select device you want to configure and click Properties
    image
  4. Next click Emulator Options
  5. In opened window click Peripherals tab
    image
  6. In Serial Port 0 choose COM port from point 1.
    Note: If COM port from point 1 is not listed, just type it in.
  7. OK all

Now, when you hit F5 in VS it will load emulator with phone support.

Disadvantage is that it will take a lot of time to boot the emulator, so disable it when you do not need phone support.

Cellular Emulator must be running all the time for it to work.

Friday, September 5, 2008

Google Chrome on Lenovo T61

3 of us here installed Google Chrome on T61 laptops and got this:

image

 

Ups. It works on my home computer.

Wednesday, January 9, 2008

Why my VSTO Office 2003 addin doesn't work?

First things you need to know

  1. You can see the list of detected and enabled addins in Outlook in:
    Tools->Options->Other->Advanced Options->COM Add-Ins...
    If there were some error and addin has not been loaded it will be there with unchecked box. This is where you enable disabled addins. When you check addin and click OK - addin will be enabled right away, you don't have to restart Outlook

  2. If addin prevented Outlook from functioning correctly it will be "hard disabled" and put there:
    Help->About Microsoft Office Outlook->Disabled Items...

  3. When addin fails to load, by default, we don't see any info about it or the error details. But we can change it!
  • Open command prompt:
    cmd
  • Type:
    set VSTO_SUPPRESSDISPLAYALERTS=0
  • Run Outlook from that command line, should be like this:
    "c:program filesMicrosoft OfficeOffice11Outlook.exe"

Now if something fails with addin - you will see it.

This will give you good basic to debug why your addin doesn't work.
I recently had a lot of problems with it. I thought about sharing it with you so that you don't have to go through it again :-)
BTW: you won't find those information on any forums or other pages ;-)

Things to verify

  1. Install all required assemblies to GAC. This gives them full permissions so if it's something with permissions now it should work. If it does work - check your CAS settings.

  2. Check manifest file. If you played with solution reorganization, changed names of projects, classes - there will be a problem.
    Take a look at the underlined fragments:

    <assembly xmlns="urn:schemas-microsoft-com:asm.v1" xmlns:asmv2="urn:schemas-microsoft-com:asm.v2" manifestVersion="1.0">
      <assemblyIdentity name="Sample.Addin.dll" version="1.0.0.0" />
      <asmv2:entryPoint name="Startup" dependencyName="dependency0">
        <asmv2:clrClassInvocation class="Sample.Addin.OutlookAddin" />
      </asmv2:entryPoint>
      <asmv2:dependency asmv2:name="dependency0">
        <asmv2:dependentAssembly>
          <assemblyIdentity name="Sample.Addin" version="3.2.0.0" publicKeyToken="c45b3b012bedcf43" />
        </asmv2:dependentAssembly>
        <asmv2:installFrom codebase="Sample.Addin.dll" />
      </asmv2:dependency>
    </assembly>

  3. Then take a look at the registry setting in the setup project. Verify all paths.
    Make sure that XXX in keys below are equal to ProgID:
    HKCU/Software/Classes/XXX/CLSID
    and
    HKCU/Software/Microsoft/Office/Outlook/Addins/XXX

  4. Got this:
    "Could not load file or assembly 'Microsoft.Office.Interop.Outlook, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c' or one of its dependencies.
    System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.Office.Interop.Outlook, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c' or one of its dependencies...."


    Yeah, had this too :) Make sure that you don't have any Office 2007 applications installed on the development machine. I had SharePoint Designer. Uninstall them and reopen solution. Dependency to office.dll 12.0.0.0 should be gone (verify it in the dependency list in setup project).
    Rebuild setup project.


I think that's it :)
Good luck!

Friday, December 21, 2007

Can TextBox.Text ever be null?

Recently I have been asked this question. Answer is that it cannot be null and will not be null, so you don't have to:
.Text != null

Why? Because .Text property in base class does:
    set 
{
if (value == null)
{
value = "";
}
.....
}

Above is for TextBox from Windows.Forms, as for TextBox from WebControls it's the same. The getter looks like this:
    get 
{
string str = (string) this.ViewState["Text"];
if (str != null)
{
return str;
}
return string.Empty;
}

If you don't believe me just try to assign a null value :-)