Thomas N. Sørensen

We are currently running som experiments with Visual Studio 2008 and VSTO 3.0. But when deploying a solution to a client workstation we have encountered a problem with the VSTO file type association. For some reason the file type .vsto was suddenly associated with notepad. An after this we can not correctly use the setup files generated by VS 2008 / VSTO 3.0 on this machine.

We hare tried uninstalling and reinstalling Visual Studio Tools for Office Runtime 3.0, but this did not reset the file association for VSTO file types. We have not been able to manually set the association, as we can't find an the appropriate program. The client workstation is running Vista.

Could anyone please guide us how to set the .vsto file mapping correctly - either manually or somehow automatically by reinstalling.

Thanks in advance

Thomas N. Sorensen



Re: Visual Studio Tools for Office VSTO file type mapping lost

Geoff Darst - MSFT

Hi Thomas,

You just need to go into Windows Explorer, right click on a .vsto file, choose "Open With" and choose the desired application to associate the file with. Be sure to check "Always use the selected program to open this kind of file."

Sincerely,

Geoff Darst

Microsoft VSTO Team





Re: Visual Studio Tools for Office VSTO file type mapping lost

Nikhil Khandelwal - MSFT

These are known bugs in Beta 2 and it has been fixed in RTM. For now, as a workaround you will have to reset the default handler for .vsto file back to VSTO Execution Engine. Currently, it seems to be set to notepad.

For Windows XP:

Right-click a .vsto file and select "Open With...". In the list of the programs you should be able to see "Visual Studio Tools for Office Execution Engine Component (VSTOEE)". Please select it and make sure you select the checkbox that says "Always use the selected program to open this kind of file". In case you do not find the VSTOEE component in the list of the available programs follow the steps below:

For Windows Vista (and sometimes Windows XP):

You will need to add a registry entry to show the VSTOEE component in the Open With.. dialog box.

Copy and paste this into notepad and name the file vsto.reg:

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\bootstrap.vsto.1\shell]

[HKEY_CLASSES_ROOT\bootstrap.vsto.1\shell\open]
@=""

[HKEY_CLASSES_ROOT\bootstrap.vsto.1\shell\open\command]
@="rundll32.exe \"C:\\Program Files\\Common Files\\Microsoft Shared\\VSTO\\vstoee.dll\",InstallVstoSolution %1"

Now double-click the registry file to add it into the registry.

Once it has been added you might need to restart explorer.exe so that it picks up the changes. Now you should see the VSTOEE component being listed in the Open With... dialog box. Use it as the default program for the .vsto extension. Everything should work as expected now.

Hope this helps! I've also put up a blog entry for future reference: http://blogs.msdn.com/nikhil/archive/2007/08/27/vsto-file-type-mapping-lost.aspx

-Nikhil






Re: Visual Studio Tools for Office VSTO file type mapping lost

Thomas N. Sorensen

Hi Nikhil,

Thanks for taking your time to help. I tried making and running the reg file and using regedit I can see that the entries have been inserted correctly.

But when trying to do an "open with" using VSTO Execution Engine Component on a vsto file, I now get the following error:

"<path+filename>.vsto is not a valid Win32 application".

And when running the generated setup.exe the following error is returned:

The following error occurred attempting to install '<path+filename>.vsto':
"%1 is not a valid Win32 application. "

Have I missed something in your guide or do you have other suggestions

Kind regards

Thomas





Re: Visual Studio Tools for Office VSTO file type mapping lost

Nikhil Khandelwal - MSFT

Please also add this to the registry:

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\.vsto]
"Content Type"="application/x-ms-vsto"
@="bootstrap.vsto.1"

[HKEY_CLASSES_ROOT\.vsto\bootstrap]
@="bootstrap.vsto.1"

This should fix the problem.

Thanks,

Nikhil






Re: Visual Studio Tools for Office VSTO file type mapping lost

Thomas N. Sorensen

Hi Nikhil,

That worked - I can now run the vsto files without problems (the setup.exe on the other hand still gives the error: The following error occurred attempting to install '<filename>.vsto': "%1 is not a valid Win32 application. " - but this is not critical as long as I can manually run the vsto files).

Thank you very much for your help.

Thomas