Readme for Visual Studio Support of Longhorn Projects
Covers: Visual Basic & Visual C# Projects
[If desired, right-click on Readme.html in Solution Explorer and choose View in Browser]

Project Types & File Descriptions

Below is a list and details of seven Project Template types in our current Visual Studio support for Longhorn.  To add additional Panes, Documents, and Windows to an Application, choose Project/Add New Item.

Longhorn Application

A project for creating an application with a Longhorn user interface

VB Project Filename

Description

C# Project Filename

Window1.xaml

Markup file defining the application’s primary window.

Window1.xaml

Window1.xaml.vb

Codebehind file

Window1.xaml.cs

MyApp.xaml

Markup file defining the application object and shared resources.

MyApp.xaml

MyApp.xaml.vb

Codebehind file

MyApp.xaml.cs

PROJECTNAME.vbproj

Project file

PROJECTNAME.csproj

App.ico

Application icon

App.ico

 

Longhorn Custom Control

A project for creating controls to use in Longhorn applications

VB Project Filename

Description

C# Project Filename

CustomControl1.vb

Code file defining a Class that inherits from Control.

CustomControl1.vb

PROJECTNAME.vbproj

Project file

PROJECTNAME.csproj

 

Longhorn Document Project

A project for creating a document deployed in a .container file

VB Project Filename

Description

C# Project Filename

Document1.xaml

Markup file defining the document’s primary content.

Document1.xaml

Document1.xaml.vb

Codebehind file

Document1.xaml.cs

MyApp.xaml

Markup file defining the application object and shared resources.

MyApp.xaml

MyApp.xaml.vb

Codebehind file

MyApp.xaml.cs

PROJECTNAME.vbproj

Project file

PROJECTNAME.csproj

Doc.ico

Document icon

Doc.ico

 

Longhorn Hosted Application

A project for creating an Application that runs hosted in the Browser

VB Project Filename

Description

C# Project Filename

Pane1.xaml

Markup file defining the application’s primary pane.

Pane1.xaml

Pane1.xaml.vb

Codebehind file

Pane1.xaml.cs

Window1.xaml

Markup file defining the application’s primary window.

Window1.xaml

Window1.xaml.vb

Codebehind file

Window1.xaml.cs

MyApp.xaml

Markup file defining the application object and shared resources.

MyApp.xaml

MyApp.xaml.vb

Codebehind file

MyApp.xaml.cs

PROJECTNAME.vbproj

Project file

PROJECTNAME.csproj

App.ico

Application icon

App.ico

 

Longhorn Navigation Application

A project for creating an application with that uses Navigation in the root of its Window

VB Project Filename

Description

C# Project Filename

Pane1.xaml

Markup file defining the application’s primary pane.

Pane1.xaml

Pane1.xaml.vb

Codebehind file

Pane1.xaml.cs

Window1.xaml

Markup file defining the application’s primary window.

Window1.xaml

Window1.xaml.vb

Codebehind file

Window1.xaml.cs

MyApp.xaml

Markup file defining the application object and shared resources.

MyApp.xaml

MyApp.xaml.vb

Codebehind file

MyApp.xaml.cs

PROJECTNAME.vbproj

Project file

PROJECTNAME.csproj

App.ico

Application icon

App.ico

Images\*.*

Images used in Window1.xaml. (A workaround.)

Images\*.*

Window1.xaml has a SourceUri attribute on its WindowNavigationContainer element.  This attribute determines the start page for the window.

To navigate to a 2nd page, you can use a <HyperLink NavigateUri=”Pane2.xaml”>Link Text </HyperLink> in Pane1.xaml

 

Longhorn Screen Saver

A project for creating a trustworthy ScreenSaver Application

VB Project Filename

Description

C# Project Filename

Pane1.xaml

Markup file defining the screensaver’s primary pane.

Pane1.xaml

Pane1.xaml.vb

Codebehind file

Pane1.xaml.cs

MyApp.xaml

Markup file defining the application object and shared resources.

MyApp.xaml

MyApp.xaml.vb

Codebehind file

MyApp.xaml.cs

PROJECTNAME.vbproj

Project file

PROJECTNAME.csproj

App.ico

Application icon

App.ico

TrustInfo.xml

XML file specifying the permissions the screen saver requires.

TrustInfo.xml

 

Longhorn Tile

A project for creating a Sidebar tile

VB Project Filename

Description

C# Project Filename

TileForeground.xaml

Markup file defining the tile’s rendering.

TileForeground.xaml

TileForeground.xaml.cs

Codebehind file

TileForeground.xaml.cs

MyTile.cs

Code file defining the Tile class.  All code behind files can reference this class with “Tile”.

MyTile.cs

Flyout.xaml

Markup file defining the tile’s flyout.

Flyout.xaml

Flyout.xaml.cs

Codebehind file

Flyout.xaml.cs

Properties.xaml

Markup file defining the tile’s property page.

Properties.xaml

Properties.xaml.cs

Codebehind file

Properties.xaml.cs

TileBackground.xaml

Markup file defining a non-interactive layer behind TileForeground.xaml.

TileBackground.xaml

TileBackground.xaml.cs

Codebehind file

TileBackground.xaml.cs

PROJECTNAME.vbproj

Project file

PROJECTNAME.csproj

Registering Tiles to Run in the Longhorn Sidebar

Un-registering Longhorn Sidebar Tiles

VB & C#: Open a Longhorn Build Environment commandline, change to the Tile project’s directory, type “msbuild /t:unregister”

 

 File Type Descriptions

File Type

Description

Markup File

.xaml files are XML files that specify a hierarchy of elements, other objects, property settings, and event hooks.

Editing a Markup File in Visual Studio's XML Editor
When you edit a markup file in Visual Studio’s XML Editor, it will provide:

  • A list of which tags can be inserted at the current context.
  • A list of appropriate attribute for an element.
  • A list of possible values for some attributes.

The intellisense is generated based on the information in the Xaml schema file: xaml.xsd (stored in Program Files\Microsoft Visual Studio .Net Whidbey\common7\packages\schema\xml).

The intellisense experience you will get currently is not perfect.  If you have a sample that has some intellisense errors based on the schema, it may still build.

Due to the incomplete support, if you’d like to disable intellisense in a markup file, add a “/” to the end of the xmlns, so that the schema targetNamespace doesn’t match.

Markup Compilation
When a project is built, the XML files are converted into code or a binary stream for runtime.  Code files created by the build process can be found in obj\release or obj\debug.

Elements with IDs
When you add an ID attribute onto an element in the Markup File, the Code file created by markup compilation will contain a variable of the same name and proper type.  Currently, you must build your project after defining the ID in order to be able to have the intellisense engine understand the appropriate type.

Commenting:
<!-- is start of xml comment.
--> is the end. 

Codebehind File

Codebehind files are code files that define the startup & interaction logic for a Markup File.

In VB and C#, these files are partial classes that in conjunction with the compiled output of the markup file, form a complete definition of a new class.  Each ID specified in a markup file will end up defining a field in the class, so you may refer to elements by ID inside of event handlers.

Project file

Project files are MsBuild project files which contain:

  • List and classification of items in a project.
  • Definition of build steps (inline and/or via import of build target files).
  • A set of default properties for the build process.

Building in Visual Studio
 
To build a project in Visual Studio, choose to Run it via F5 (with debugging support) or ctrl-F5 (without debugging support).

Building on a Command Line
1)      Launch a Longhorn Build Environment command-line:
Start/All Programs/Microsoft Longhorn SDK/Open Build Environment Window/Longhorn Build Environment
2)      Change to the directory of your project
3)      Type “msbuild” and enter
(if you only have one file that ends in “proj”, it will run the default targets defined in that file, usually Build.)

Running the project from a Command Line
To run the project in the Longhorn Build Environment commandline:
1)      Type “msbuild /t:run”

Modifying Project Properties
·         There is no way currently to modify most Longhorn Project properties inside of Visual Studio.
·         If you’d like to modify the properties:
1)      If you have the project open in Visual Studio, press Save All.
2)      Launch a Longhorn Build Environment command-line
3)      Change to the directory of your project
4)      Notepad [PROJECTFILENAME]
5)      Make changes then save
6)      Switch back to Visual Studio
7)      When prompted, choose Reload.

We look forward to your feedback.
Thank you.

-Visual Basic, C#, and Avalon Teams