Web Application and Web Site Development Models
History
Visual Studio 2003 introduced the Web Application model. Visual Studio 2005 introduced the Web Site model and initially did not allow the Web Application model. Developers complained and a plug-in was released to allow Visual Studio to do Web Applications. Developer Express Supports only Web Site model originally but will add support in WDE 2008 SP1.
Web Application
A Web Application is project based. If the resource is not in your project it does not exist.
It must be deployed to be used.
Easier to work with Source Control since the projects expose source control syncronization files.
By default, all code is compiled, class files, code behind files, designer files, into a single assembly.
Content files, .ASPX and .ASCX, are compiled dynamically.
With Web Applications you have control over the names of assemblies.
Web Applications also have the ability to create a Web Application from multiple Web Projects.
Web Applications have the ability to run pre-build and post-build steps during compilation.
Web Site
A Web Site is folder based, if it is in the folder it is part of the Web Site.
Web Sites automatically deploy site using HTTP, FTP or File System.
Web Sites run on IIS, they do not run locally for HTTP and FTP.
If you specify local file system the site will run with the local development server.
A Solution file gets created but does not have any information.
Web pages and code files are compiled dynamically. (There are precompile options)
Gives you the ability to open and edit any directory as a Web Project without a project file.
Ability to generate one assembly for each page which could result in a performance gain.
Showing posts with label Visual Studio. Show all posts
Showing posts with label Visual Studio. Show all posts
Sunday, August 17, 2008
Saturday, August 16, 2008
Blackberry Visual Studio Plugin
Blackberry provides for free a plug-in for Visual Studio. The current version is a beta for Visual Studio 2008. There is a prior version for VS2005.
After installing, you can launch the blackberry emulator directly. Also after selecting File->New -> Project... , you will see there is a new installed template for Blackberry. Running the template results in a working project without any additional code.
This plug-in is a great start as it provides an excellent Blackberry emulator and an environment for starting Blackberry mobile device development.
After installing, you can launch the blackberry emulator directly. Also after selecting File->New -> Project... , you will see there is a new installed template for Blackberry. Running the template results in a working project without any additional code.
This plug-in is a great start as it provides an excellent Blackberry emulator and an environment for starting Blackberry mobile device development.
Thursday, August 14, 2008
Changing The Default View For Web Pages In Visual Studio
To change the default view of web pages in Visual Studio select from the menu:
Tools->Options...
On "Options" dialog select from the left side tree control:
HTML Designer->General
In the "Start pages in" groupbox you have three options:
Source View, Design View, Split View
Tools->Options...
On "Options" dialog select from the left side tree control:
HTML Designer->General
In the "Start pages in" groupbox you have three options:
Source View, Design View, Split View
Thursday, August 7, 2008
Prerequisite Package Location In Visual Studio
In order to use Prerequisite Packages in Visual Studio you must place them in the appropriate Bootstrapper directory.
For Visual Studio 2008 on 32 bit:
%PROGRAMFILES%\Microsoft SDKs\Windows\v6.0A\Bootstrapper\Packages\
For Visual Studio 2008 on 64 bit:
%PROGRAMFILES(X86)%\Microsoft SDKs\Windows\v6.0A\Bootstrapper\Packages\
For Visual Studio 2005 on 32 bit:
%PROGRAMFILES%C:\Microsoft Visual Studio 8\SDK\v2.0\BootStrapper\Packages\
For Visual Studio 2008 on 64 bit:
%PROGRAMFILES(X86)%\Microsoft Visual Studio 8\SDK\v2.0\BootStrapper\Packages\
Saturday, July 12, 2008
Visual Studio: Hot Keys: Windows
Most of the Hot Key chords for windows start with Ctrl W.
The ones that do not close windows or are data related.
Ctrl W A
Command Window
Ctrl W C
Class View
Ctrl W D
Code Definition Window
Ctrl W E
Error List
Ctrl W L
Server Explorer
Ctrl W O
Output
Ctrl W P
Properties
Ctrl W S
Solution Explorer
Ctrl W T
Task List
Ctrl W X
Toolbox
Ctrl Esc
Close Window
Ctrl Alt D
Data Sources
Ctrl F4
Close current tab
Ctrl Tab
IDE Navigator, first document (next document)
The ones that do not close windows or are data related.
Ctrl W A
Command Window
Ctrl W C
Class View
Ctrl W D
Code Definition Window
Ctrl W E
Error List
Ctrl W L
Server Explorer
Ctrl W O
Output
Ctrl W P
Properties
Ctrl W S
Solution Explorer
Ctrl W T
Task List
Ctrl W X
Toolbox
Ctrl Esc
Close Window
Ctrl Alt D
Data Sources
Ctrl F4
Close current tab
Ctrl Tab
IDE Navigator, first document (next document)
Tuesday, July 8, 2008
Visual Studio: Hot Keys: Solutions Projects Files
Ctrl Shift N
New project
Ctrl Shift O
Displays the Open Project dialog
Shift Alt C
Add New Item, with class as default
Shift Alt A
Add Existing Item
Ctrl Shift A
Add New Item, with file as default
Ctrl Alt Down Arrow
Displays list of all open documents
Ctrl O
Open File Dialog
New project
Ctrl Shift O
Displays the Open Project dialog
Shift Alt C
Add New Item, with class as default
Shift Alt A
Add Existing Item
Ctrl Shift A
Add New Item, with file as default
Ctrl Alt Down Arrow
Displays list of all open documents
Ctrl O
Open File Dialog
Monday, July 7, 2008
Visual Studio: Hot Keys: Refactoring
Note all of the Refactoring Hot Key Chords start with Ctrl R.
Ctrl + R E
Encapsulate a Field, creates a property from a field
Ctrl + R I
Extract an Interface, create a new interface from an existing class, interface or struct
Ctrl + R M
Extract Method, create method from code selection
Ctrl + R P
Promote to Parameter, promote a local variable to a parameter
Ctrl + R V
Remove Parameters
Ctrl + R R
Rename, allows renaming of identifier
Ctrl + R O
Change Order of Parameters
Ctrl + R E
Encapsulate a Field, creates a property from a field
Ctrl + R I
Extract an Interface, create a new interface from an existing class, interface or struct
Ctrl + R M
Extract Method, create method from code selection
Ctrl + R P
Promote to Parameter, promote a local variable to a parameter
Ctrl + R V
Remove Parameters
Ctrl + R R
Rename, allows renaming of identifier
Ctrl + R O
Change Order of Parameters
Friday, July 4, 2008
Visual Studio: Hot Keys: IntelliSense
IntelliSense Hot Keys
Ctrl + space or
Ctrl + K W
Complete word using the current selection in the list
Ctrl + J or
Ctrl + K L
Pull up the intellisense selection list
Ctrl + K I
Show the declaration of selected identifier in a Quick Info tool tip
Ctrl + Shift Space or
Ctrl + K P
Display for the specified method the name and parameters required
When Intellisense Selection List is displayed:
Ctrl causes the list to be rendered transparent
Ctrl + space or
Ctrl + K W
Complete word using the current selection in the list
Ctrl + J or
Ctrl + K L
Pull up the intellisense selection list
Ctrl + K I
Show the declaration of selected identifier in a Quick Info tool tip
Ctrl + Shift Space or
Ctrl + K P
Display for the specified method the name and parameters required
When Intellisense Selection List is displayed:
Ctrl causes the list to be rendered transparent
Wednesday, June 18, 2008
Forcing The Compile Order Of Projects In Visual Studio
For managed code projects, setting project references causes Visual Studio to do the right thing in terms of building dependencies and linking them in the right order. It does the job so well I do not care how it goes about it.
But in the case of Unmanaged Code you will occasionally want to move the outputs around so they can be found by other projects.
To do this right click on the solution in the Solution Explorer, select Properties from the menu.
In the property pages dialog, under Common Properties, select Project Dependencies.
Here you will be able to select a project, then select which projects it Depends on.
Note if the checkbox for a project is grayed out it means a dependency already exists going the other way.
But in the case of Unmanaged Code you will occasionally want to move the outputs around so they can be found by other projects.
To do this right click on the solution in the Solution Explorer, select Properties from the menu.
In the property pages dialog, under Common Properties, select Project Dependencies.
Here you will be able to select a project, then select which projects it Depends on.
Note if the checkbox for a project is grayed out it means a dependency already exists going the other way.
Friday, May 23, 2008
Snippet Definition Commentary
Snippets are probably the most powerful code generation tool available in Visual Studio. The power result from simplicity blended with extensibility.
To better show this combination of ease and flexibility I am going to dissect the 'class' snippet.
It is stored as XML so it has the xml directive to start and the top element is 'CodeSnippets' which has one or more 'CodeSnippet' elements so the boilerplate for all snippets looks like:
A 'CodeSnippet' element has two child elements 'Header' and 'Snippet'
Header contains information about how the snippet should be used.
Snippet defines how code generation.
The 'Header' element has child elements of 'Title', 'Shortcut', 'Description', 'Author' and 'SnippetTypes'.
Visual Studio uses the 'Shortcut' element's value to autosuggest the snippet. In this case the value of 'class' which is also a keyword helps suggest this snippet at the right time.
Since there is no restriction on uniqueness of snippet names, the IDE will show that there are multiple snippets for the same snippet shortcut.
The 'Title' and 'Description' will allow users to select the appropriate one.
Another key element with snippets is the 'SnippetTypes' which can have one or more 'SnippetType' child elements.
In this case it indicates that the class snippet can be used to both expand and surround code. The surrounds value indicates that if some text is selected and the snippet is invoked the selected text will be used.
The 'Snippet' element is where all the code generation work is defined.
In order for the snippet to something more powerful than copy and paste we need a way to declare some placeholders.
That is what the 'Declarations' element with 'Literal' child elements define. The 'ID' child of 'Literal' in this case is 'name' in the 'Code' element this is important.
The 'ToolTip' provides context sensitive information when using the element. The 'Default' element give the 'Literal' a value at the start.
The 'Code' child element of 'Snippet' has the body of the code to be created. When this is done the user selected values of the 'Literals' will be substituted.
So the 'Literal' with 'ID' of 'name' is seen here as '$name$'. There are a few built in and implied literals as well.
When the snippet is used in 'SurroundsWith' mode the selected text provides the value for the implied '$selected$'
Now having all the details and a working example
all one needs to create a snippet is a chunk of code
that is constantly being used.
Simply put it in the 'Code' element.
Then repeatedly extract literals from the code.
Define the literals in the header and you are done.
To better show this combination of ease and flexibility I am going to dissect the 'class' snippet.
It is stored as XML so it has the xml directive to start and the top element is 'CodeSnippets' which has one or more 'CodeSnippet' elements so the boilerplate for all snippets looks like:
<?xml version="1.0" encoding="utf-8" ?>
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
<CodeSnippet Format="1.0.0">
</CodeSnippet>
</CodeSnippets>
A 'CodeSnippet' element has two child elements 'Header' and 'Snippet'
Header contains information about how the snippet should be used.
Snippet defines how code generation.
<CodeSnippet Format="1.0.0">
<Header>
</Header>
<Snippet>
</Snippet>
</CodeSnippet>
The 'Header' element has child elements of 'Title', 'Shortcut', 'Description', 'Author' and 'SnippetTypes'.
Visual Studio uses the 'Shortcut' element's value to autosuggest the snippet. In this case the value of 'class' which is also a keyword helps suggest this snippet at the right time.
Since there is no restriction on uniqueness of snippet names, the IDE will show that there are multiple snippets for the same snippet shortcut.
The 'Title' and 'Description' will allow users to select the appropriate one.
Another key element with snippets is the 'SnippetTypes' which can have one or more 'SnippetType' child elements.
In this case it indicates that the class snippet can be used to both expand and surround code. The surrounds value indicates that if some text is selected and the snippet is invoked the selected text will be used.
<Header>
<Title>class</Title>
<Shortcut>class</Shortcut>
<Description>Code snippet for class</Description>
<Author>Microsoft Corporation</Author>
<SnippetTypes>
<SnippetType>Expansion</SnippetType>
<SnippetType>SurroundsWith</SnippetType>
</SnippetTypes>
</Header>
The 'Snippet' element is where all the code generation work is defined.
In order for the snippet to something more powerful than copy and paste we need a way to declare some placeholders.
That is what the 'Declarations' element with 'Literal' child elements define. The 'ID' child of 'Literal' in this case is 'name' in the 'Code' element this is important.
The 'ToolTip' provides context sensitive information when using the element. The 'Default' element give the 'Literal' a value at the start.
The 'Code' child element of 'Snippet' has the body of the code to be created. When this is done the user selected values of the 'Literals' will be substituted.
So the 'Literal' with 'ID' of 'name' is seen here as '$name$'. There are a few built in and implied literals as well.
When the snippet is used in 'SurroundsWith' mode the selected text provides the value for the implied '$selected$'
<Snippet>
<Declarations>
<Literal>
<ID>name</ID>
<ToolTip>Class name</ToolTip>
<Default>MyClass</Default>
</Literal>
</Declarations>
<Code Language="csharp"><![CDATA[class $name$
{
$selected$$end$
}]]>
</Code>
</Snippet>
Now having all the details and a working example
all one needs to create a snippet is a chunk of code
that is constantly being used.
Simply put it in the 'Code' element.
Then repeatedly extract literals from the code.
Define the literals in the header and you are done.
Subscribe to:
Posts (Atom)