Web project package and deployment targets files are written with extensibility in mind. User can easily extend a property to include more functionalities in their package by using msbuild targets and properties.
If we check the Microsoft.Web.Publishing.targets file under “%Program Files%\MSBuild\Microsoft\VisualStudio\v10.0\Web\”, we can see the following, which means if file $(WebPublishPipelineProjectName).wpp.targets exists in the project directory, we’ll import it automatically when build package or publish.
<!--***************************************************************-->
<!--To allow the Team build to have custom setting for the Web Application project without change the project file -->
<!--by default, if user have a file call $(WebPublishPipelineProjectName).wpp.targets, we will import these setting in before we start -->
<!--***************************************************************-->
<PropertyGroup>
<WebPublishPipelineCustomizeTargetFile Condition="'$(WebPublishPipelineCustomizeTargetFile)'==''">$(WebPublishPipelineProjectDirectory)\$(WebPublishPipelineProjectName).wpp.targets</WebPublishPipelineCustomizeTargetFile>
</PropertyGroup>
<Import Project="$(WebPublishPipelineCustomizeTargetFile)" Condition="Exists($(WebPublishPipelineCustomizeTargetFile))"/>
Here’s steps to create a customized target file to include some registry keys in the web package by using msdeploy’s regKey provider. (The link contains the functionality and limitation of regKey provider)
1. Create a file WebApplicationName.wpp.targets in the same folder as your web project (e.g. if the project file is WebApplication1.vbproj, then name the file WebApplication1.wpp.targets) with following content:
<!--********************************************************************-->
<!-- Task CollectRegKeysForPackage -->
<!-- RegKey reference: http://technet.microsoft.com/en-us/library/dd569085(WS.10).aspx -->
<!--********************************************************************-->
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<!--Targets get execute before this Target-->
<OnBeforeCollectRegKeysForPackage Condition="'$(OnBeforeCollectRegKeysForPackage)'==''">
</OnBeforeCollectRegKeysForPackage>
<!--Targets get execute after this Target-->
<OnAfterCollectRegKeysForPackage Condition="'$(OnAfterCollectRegKeysForPackage)'==''">
</OnAfterCollectRegKeysForPackage>
<CollectRegKeysForPackageDependsOn Condition="'$(CollectRegKeysForPackageDependsOn)'==''">
$(OnBeforeCollectRegKeysForPackage);
Build;
</CollectRegKeysForPackageDependsOn>
</PropertyGroup>
<PropertyGroup>
<IncludeRegKeyForMyProject Condition="'$(IncludeRegKeyForMyProject)'==''">False</IncludeRegKeyForMyProject>
<MyRegKeyPath Condition="'$(MyRegKeyPath)'==''"></MyRegKeyPath>
<AfterAddContentPathToSourceManifest Condition="'$(AfterAddContentPathToSourceManifest)'==''">
$(AfterAddContentPathToSourceManifest);
CollectRegKeysForPackage;
</AfterAddContentPathToSourceManifest>
</PropertyGroup>
<ItemGroup>
<MyRegkeys Include = "$(MyRegKeyPath)"/>
</ItemGroup>
<Target Name="CollectRegKeysForPackage"
DependsOnTargets="$(CollectRegKeysForPackageDependsOn)"
Condition="$(IncludeRegKeyForMyProject) AND '$(MyRegKeyPath)'!=''">
<Message Text="Adding %(MyRegkeys.Identity)" />
<ItemGroup>
<MsDeploySourceManifest Include="regkey"
Condition="$(IncludeRegKeyForMyProject)">
<Path>%(MyRegkeys.Identity)</Path>
</MsDeploySourceManifest>
</ItemGroup>
<CallTarget Targets="$(OnAfterCollectRegKeysForPackage)" RunEachTargetSeparately="false" />
</Target>
</Project>
2. Package the project from command line using parameters such as the following to include multiple registry keys (seperated by ; sign) in the package.
msbuild WebApplication1.vbproj /target:package /p:IncludeRegKeyForMyProject=True;MyRegKeyPath="hkey_current_user\control panel\desktop\windowmetrics;hkey_current_user\control panel\desktop\colors"
In obj\debug\package\WebApplication1.SourceManifest.xml file, you should see two regkey providers are defined:
<?xml version="1.0" encoding="utf-8"?>
<sitemanifest>
<regkey path="hkey_current_user\control panel\desktop\windowmetrics" />
<regkey path="hkey_current_user\control panel\desktop\colors" />
<IisApp path="D:\temp\WebApplication1\WebApplication1\obj\Debug\Package\PackageTmp" managedRuntimeVersion="v4.0" />
<setAcl path="D:\temp\WebApplication1\WebApplication1\obj\Debug\Package\PackageTmp" setAclResourceType="Directory" />
<setAcl path="D:\temp\WebApplication1\WebApplication1\obj\Debug\Package\PackageTmp" setAclUser="anonymousAuthenticationUser" setAclResourceType="Directory" />
</sitemanifest>
3. To proves it works, we change the hkey_current_user\control panel\desktop\windowmetrics\MenuWidth from –285 to –284, then we deploy the package locally from command line:
WebApplication1.deploy.cmd /y
4. We see the following line which showed that the corresponding registry is updated.
Info: Updating regValue (hkey_current_user\control panel\desktop\windowmetrics\MenuWidth).
5. Or we can import the package from IIS
After installation finishes, from its details tab, there are the following messages:
[2/9/2010 11:55:05 AM] Source regValue (hkey_current_user\control panel\desktop\windowmetrics\MenuWidth) does not match destination (hkey_current_user\control panel\desktop\windowmetrics\MenuWidth) differing in attributes (value['-285','-284']). Update pending.
[2/9/2010 11:55:05 AM] Source regValue (hkey_current_user\control panel\desktop\windowmetrics\MenuWidth) replaced with changed attributes (parameters) because of rule EnvironmentVariableNormalize.
[2/9/2010 11:55:05 AM] Updating regValue (hkey_current_user\control panel\desktop\windowmetrics\MenuWidth).
If you simply want to hardcode the registry keys for your project and don’t want to worry about more extensions, here’s a simplified version:
<!--********************************************************************-->
<!-- Task CollectRegKeysForPackage -->
<!-- RegKey reference: http://technet.microsoft.com/en-us/library/dd569085(WS.10).aspx -->
<!--********************************************************************-->
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<!-- Extends the AfterAddContentPathToSourceManifest action do also collect registry keys-->
<!-- Hard code -->
<MyRegKeyPath Condition="'$(MyRegKeyPath)'==''">hkey_current_user\control panel\desktop\windowmetrics;hkey_current_user\control panel\desktop\colors</MyRegKeyPath>
<AfterAddContentPathToSourceManifest Condition="'$(AfterAddContentPathToSourceManifest)'==''">
$(AfterAddContentPathToSourceManifest);
CollectRegKeysForPackage;
</AfterAddContentPathToSourceManifest>
</PropertyGroup>
<ItemGroup>
<MyRegkeys Include = "$(MyRegKeyPath)"/>
</ItemGroup>
<Target Name="CollectRegKeysForPackage" Condition="'$(MyRegKeyPath)'!=''">
<Message Text="Adding %(MyRegkeys.Identity)" />
<ItemGroup>
<MsDeploySourceManifest Include="regkey">
<Path>%(MyRegkeys.Identity)</Path>
</MsDeploySourceManifest>
</ItemGroup>
</Target>
</Project>
Note: if you change an existing target file (this.wpp.targets). You need to restart VS IDE to allow the target file cache to be unloaded and reloaded, in order for package/publish using the change.
Xinyang Qiu | Visual Web Devloper
As you probably heard the Visual Studio 2010 RC is currently available for MSDN subscribers! You can download it from here http://msdn.microsoft.com/en-us/vstudio/dd582936.aspx. General public release is slated for Wed.
The Web Development Tools Team has setup a DL that we would like you to use to send us direct feedback on anything web development related for this RC.
The DL is: vsweb@microsoft.com
Once you have had a chance to use the product please send us feedback on your overall experience with our product. The more details you can provide the better.
Also, feel free to shoot us a mail if:
- You encounter a bug or issue.
- You have general feedback, suggestions or ideas on our web tools product.
If you do encounter a bug please send us a clear set of repro steps. Any of the following items will also help us reproduce the bug more easily:
- For crashes, hangs - obtain a crash dump as described here: http://blogs.msdn.com/mikhailarkhipov/archive/2006/07/25/678308.aspx
- For hard to describe bugs capture a video of the bug in action.
- Send us your machine configuration (OS, 64/32 bit, RAM, etc.).
- Are you running in a Virtual Machine environment (Virtual PC, Hyper-V, VMWare, etc) or Remote Desktop?
- What profile are you using (Tools->Import/Export Settings? General, Web Development, Code Only, VB, C#, etc.
- How many projects are you using? How many files?
- Is your solution located on a network share?
- Would you be willing to share your project/solution with us for testing purposes only?
Finally, don’t forget to monitor our blog http://blogs.msdn.com/webdevtools as we have another of great topics lined up that will be published soon.
Thank you,
--Mike.
We finished generating a new VSDoc for the latest update of jQuery. You can download it from the jQuery Downloads page. A refresher on how to use the file can be found here or here. Happy coding!
Jeff King
Program Manager
Visual Studio Web Tools
You all probably know that new HTML 5 standard is coming. We made a new intellisense schema that you can add to VS 2008 or VWD Express 2008 and get intellisense and validation on HTML 5 elements. Note that schema is for markup only, we do not have DOM2 update for jscript intellisense yet.
How to install the schema:
- Download attached ZIP file.
- Place html_5.xsd in C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\Packages\schemas\html
- Run either x86 or x64 reg file depending on the OS and VS/VWD flavors installed. For example, for VWD Express installed on 64-bit OS run HTML-5-Schema-Reg-x64-VWD.reg and for VS 2008 installed on 32-bit OS run HTML-5-Schema-Reg-x86.reg.
- Restart VS
- You can select HTML 5 in the schema dropdown and HTML 5 element attributes should appear in the Properties window.

On 32-bit OS path is C:\Program Files\Microsoft Visual Studio 9.0\Common7\Packages\schemas\html. VWD shares folder with Visual Studio.
Schema is experimental and has certain limitations. For example, VS 2008 and VWD are not able to validate 'wildcard' attribute names, like HTML 5 data-* attributes and is not able to handle 'transparent' content model when element content is defined by the element parent (see, for example, A element). However, it may help you to start playing with the new standard.
Thanks
- Mikhail Arkhipov
Differences between Web Site Projects (WSP) and Web Application Projects (WAP) are highlighted in blogs such as this one. Based on that, if you feel a WAP would be better for your particular needs than a WSP, but have already created a WSP, you may be asking yourself, “Can I convert my WSP into a WAP, without starting from scratch?”.
This posting explains how to convert an existing Web Site Project to a Web Application Project in Visual Studio 2010. The most striking differences to a Web Site Project are that WAPs have a project file to include and exclude files, and compile to a single assembly.
The guidelines below include several of the basic steps detailed in the Walkthrough: Converting a Web Site Project to a Web Application Project in Visual Studio. This is an excellent topic to review as it discusses some specific issues you may encounter which were discovered in previous versions of Visual Studio (VS). Please keep in mind while reading it that it is based on a WSP to WAP conversion using previous versions of Visual Studio.
Let’s get started.
Open and Verify your Visual Studio Web Site Project
Before converting your WSP to a WAP, you should open it in Visual Studio and verify that is it working correctly. This will help prevent the need to research errors that have nothing to do with the conversion process.
- In the File menu, click Open Web Site.
- The Open Web Site dialog box is displayed.
- Select the project folder that you want to open, and then click Open.
- In the Build menu, click Build Web Site.
- In the Debug menu, click Start Debugging. Alternatively, you can press F5.
- Verify your project compiles and runs as expected
Create a new, empty Visual Studio WAP
A good strategy for converting a WSP to a WAP is to create a new, blank Visual Studio Web Application Project in a separate directory, but in the same solution. This avoids changing any part of the existing Web site files. It also allows you to copy existing functionality and files into the new WAP easily, within the same Visual Studio instance.
- In the File menu, click Add, and then click New Project.
- The Add New Project dialog box is displayed.
- In the Installed Templates section of the Add New Project dialog box, expand the language that you want to use, and then select Web to display the Web-related templates.
- Select Empty ASP.NET Web Application.
- Type values for Name, Location, and then click OK to create the Web Application Project.
- After the project has been created, delete the Web.config file that is created automatically.
Set Project / Assembly References
If the WSP required additional project or assembly references, you need to add them to the WAP. You can see the list of default references associated with the new (empty) Visual Studio Web Application Project under the References node in Solution Explorer.
- In the Solution Explorer, make sure Show All Files is turned on.
- In the Solution Explorer, right-click References, and then click Add Reference.
- The Add Reference dialog box is displayed.
- Select the reference that you have already added in the Web Site Project and then click OK.
- Note: To help prevent errors, add references to the Web Application Project for assemblies that existed in the \bin folder of the WSP.
Copy and Convert the App_Code folder from the Web Site Project to the Web Application Project
In WSPs, the files in the App_Code folder are all compiled together and then referenced (automatically) as a “dll” by all other files in the WSP. In WAPs, this is not the case. All code is compiled together as one .dll. I’ve found that copying the App_Code folder over first and converting it to the WAP model helps to head off some dependency issues which could arise if one copied the entire site, converted, and then tried to compile.
- In the Solution Explorer, copy the entire App_Code folder from the WSP to the WAP
- In the Solution Explorer, select the WAP’s root node; right-click, select Convert to Web Application
- You will see our standard Convert to Web Application confirmation dialog. Select “Yes” to this dialog.
- The App_Code folder should now be renamed to Old_App_Code folder
- Note: Do NOT name it back. As mentioned above, in the WAP model all code will be compiled into one assembly. At runtime, ASP.NET doesn’t know what type of project model you have created and will take anything in the “App_Code” folder and create a dynamic assembly for it, thereby causing “could not load type” exceptions as there would be duplicate types exists in two assemblies (the one for the VS web application and the one for App_Code). Learn more about why App_Code folder does not work well with WAPs.
- Compile the WAP
- If you see an error, the most likely causes are:
- Missing assembly reference. See the section above to add missing references to your project.
- Files marked with Build Action = Content instead of Build Action = Compile. Any file you want compiled should be marked as such.
- To set the Build Action property:
- Select the file in the Solution Explorer
- Press F4 (Brings up the File’s Property Grid)
- Look at the Build Action property. Change as necessary.
Copy and Convert the remaining Files and Folders from the WSP to the WAP
Once your Old_App_Code folder is compiled (by compiling your WAP in the step above), your WAP will have an assembly in the \bin directory. This will make it easier for the remaining files you are copying over to successfully compile, especially if they reference or use code in the files contained within that folder.
- Select the remaining files / folders from the WSP project and copy them into the WAP.
- Make sure not to copy the App_Code folder again.
- In the Solution Explorer, right click the root node of the WAP and select Convert to Web Application.
- Don’t worry, this won’t affect (or try to reconvert) any files or the Old_App_Code folder you have already converted.
- Note: This will cause VS to automatically generate a .designer.cs (or .vb) file for each page, user-control, and master page in the project. Additionally, each .aspx/.ascx will be modified to use the ‘Codebehind’ instead of the ‘CodeFile’ attribute in the Page directive.
- Example of the ‘CodeFile’ to ‘Codebehind’ change
- WSP file: <%@ Page Title=”Home Page” Language=”C#” CodeFile=”Default.aspx.cs” Inherits=”_Default” %>
- Converted WAP file: <%@ Page Title=”Home Page” Language=”C#” Inherits=”_Default” Codebehind=”Default.aspx.cs” %>
Compile your WAP
After all the files have been added and converted, you should build your project again to see if there are any compilation errors. At this point, some of the most likely causes of errors are:
- Code files set with Build Action = Content. These should be changed to Compile. Refer to the above section.
- Missing project or assembly references. See above for steps for adding project or assembly references.
- Class name collisions. In the WSP model, each .aspx and associated codefile was compiled together as a separate, individual unit. Therefore, one could have files such as foo\widget.ascx.cs and bar\widget.ascx.cs where the classes were the same. Once these files are moved to a WAP and all compiled together, class name collisions occur with errors something like, “has multiple definitions with identical signatures”. If this occurs, unique class names should be created.
Run your WAP
After completing the above steps and you have a WAP which successfully compiles, you are ready to try running your application. One of the most common problems I’ve seen encountered is the “Unknown server tag ‘SomeTag: Control’ (as it applies to user controls and such)”. This can be corrected in one of two ways.
- Add or modify the register directive on the page that is using the control. This will only register it for this specific page.
- <%@ Register Namespace”namespace the control is in” TagPrefix=”SomeTag” Assembly=”Name of dll compiled into the \bin folder” %>
- Register the control in the Web.config, making it available to all pages in the project
- In the <pages><controls> section add the following:
- <add tagPrefix=”SomeTag” namespace=”namespace the control is in” assembly=” Name of dll compiled into the \bin folder” />
Hope this helps!
Nichole Baker
SDET, Visual Studio Web Tools
Visual Studio 2010 Beta 2 will bring full support for developing applications in Silverlight 3. There’s a few things that have changed since VS2010 Beta 1, and we hope you enjoy the new beta release!
Silverlight 2 is no longer supported – long live Silverlight 3
Now that Silverlight 3 has released (including a GDR; the latest version is currently 3.0.40818), VS2010 has moved the minimum supported version to Silverlight 3. The new installation experience will include the latest Silverlight 3 developer runtime and Silverlight 3 GDR 2 SDK. If you already have the Silverlight 3 RTW version of the SDK installed, this component may fail during VS installation, but not to worry – it won’t affect anything outside Silverlight. If this does occur, you can uninstall the RTW version of the Silverlight 3 SDK and then install the newer SDK manually (recommended). You can find the Silverlight 3 GDR 2 SDK at http://go.microsoft.com/fwlink/?LinkID=157102. For more information about the setup error, see http://blogs.msdn.com/amyd/archive/2009/10/21/visual-studio-2010-and-silverlight-3-sdk.aspx.
The Silverlight 3 GDR 2 SDK has several bug fixes for VS2010 and Silverlight development in general. Some of the new features in VS2010 (such as IntelliSense improvements listed below) may not work without the updated SDK, but all VS2008 features will work correctly.
Silverlight designer is back – long live Silverlight designer
Back by popular demand is the XAML designer, removed from the Silverlight 3 Tools release for VS2008. This designer is better than ever, including for the first time an interactive design experience for Silverlight. Also new is support for the Properties tool window, to better allow you to customize your controls.
New option for OOB – long live Silverlight 3 Out-of-Browser
While almost all of our changes in VS2010 are under the hood, we’ve added one additional option to the Silverlight Out-Of-Browser dialog. One setting not previously exposed was the option to hide the default installation context menu for your app (i.e. if you want to limit installation to actions inside your application).
If you turn this off, users will no longer have the right-click install for OOB applications except where you provide it (i.e. via your own install button):
(For reference, if you’d like to turn this off in VS2008, you can modify the ShowInstallMenuItem attribute in OutOfBrowserSettings.xml under the project properties node.)
Improved Intellisense wire-up during development – Long live real-time IntelliSense
Something that has long been missing from Silverlight development is automatic and (near-)instant IntelliSense between XAML and code-behind. Now, once you’ve created a control in markup, it should appear in IntelliSense immediately:
This does require the Silverlight 3 GDR 2 SDK to work properly. See the note above regarding potential installation issues with the newer SDK.
Note for Expression Blend users – warnings when opening VS2010 solutions/projects
Unfortunately, Expression Blend 3 only supports .NET 3.5 and VS2008 project files and solutions, so VS2010 project files may present some difficulties. You may run into some of the following issues:
- There’s a pop-up warning about opening the VS2010 solution. Blend will continue to work fine, so you can ignore this error.
- Web Application projects targeting .NET 4.0 (VS2010 default) fail to load in Blend. It will also fail to build, which in turn will prevent you from running it from Blend. You can use VS2010’s multi-targeting to re-target the web project to .NET 3.5 if you need it to open in Blend.
- VS2010 Website projects fail to build in Blend. This will also prevent it from running. This is caused by a change in VS2010 wherein the target framework version is stored in the web.config file:
<compilation debug="false" targetFramework="4.0" />
If you remove this attribute, the website should work in Blend.

Visual Studio 2010 Beta 2 contains ASP.Net MVC 2 in the box so there is no need to install an out of band update to Visual Studio 2010 to develop ASP.Net MVC applications. Phil Haack posted about the in-box experience for Beta 2 andd also provides some info on how to upgrade your ASP.Net MVC 1 apps to ASP.Net MVC 2. From a tooling perspective, all of the new functionality released in ASP.Net MVC 2 Preview 2 for Orcas is available in Visual Studio 2010 Beta 2 including support for Single Project Areas. Additionally, if you look in the Scripts folder of a new ASP.Net MVC application, you will notice that jquery.validate is included as well as a vsdoc file to go with it. I'll post more on how to use jquery.validate in the coming weeks but for now, you should notice rich intellisense in your pages that use jquery.validate thanks to the inclusion of jquery.validate-vsdoc in your ASP.Net MVC 2 application.
Joe Cartano | Visual Web Developer
Dev10 Beta2 DB Deployment property page has some changes from Beta1. Please provide your valuable feedback for us to make it better for you. Thanks.
1. Tab page name changed from “Deploy/SQL” To “Deploy SQL”
2. Customer can use “Import from Web.config” button to import all the connection strings defined in root web.config to the database entries list. For example, if web.config contains the following connection strings:
<connectionStrings>
<add name="ApplicationServices"
connectionString="data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|\aspnetdb.mdf;User Instance=true"
providerName="System.Data.SqlClient" />
<add name="AdventureWorksConnection"
connectionString="Data Source=1p18-fwg36;Initial Catalog=AdventureWorks;Integrated Security=True"
providerName="System.Data.SqlClient" />
</connectionStrings>
Clicking “Import from Web.config” button, you will get two connection names in the database entries list. Each entry corresponds to a connection string in the web.config, with the connectionString content as the “connection string for the source database”.
3. Database scripting options is changed to a combo box with 3 choices: “Schema Only”, “Schema And Data” and “Data Only” (Beta2 only has schema only and complete database choices). “Exclude objects with no schema information from the generated script” option is removed form UI. (This SMO setting is called SchemaQualify, default is false, you can set to true for each connection in project file if that is what desired.
4. As Beta1, we hide complex scripting SMO options in the project file. If you view the project file of this web application, you will see the following:
<PublishDatabaseSettings>
<Objects>
<ObjectGroup Name="ApplicationServices" Order="1" Enabled="False">
<Destination Path="" />
<Object Type="dbFullSql">
<PreSource Path="data source=.\SQLEXPRESS%3bIntegrated Security=SSPI%3bAttachDBFilename=|DataDirectory|\aspnetdb.mdf%3bUser Instance=true" ScriptSchema="True" ScriptData="False" CopyAllFullTextCatalogs="False" />
<Source Path="obj\Debug\AutoScripts\ApplicationServices_SchemaOnly.sql" />
</Object>
</ObjectGroup>
<ObjectGroup Name="AdventureWorksConnection" Order="2" Enabled="False">
<Destination Path="" />
<Object Type="dbFullSql">
<PreSource Path="Data Source=1p18-fwg36%3bInitial Catalog=AdventureWorks%3bIntegrated Security=True" ScriptSchema="True" ScriptData="False" CopyAllFullTextCatalogs="False" />
<Source Path="obj\Debug\AutoScripts\AdventureWorksConnection_SchemaOnly.sql" />
</Object>
</ObjectGroup>
</Objects>
</PublishDatabaseSettings>
We have CopyAllFullTextCatalogs=”False” defined as default to avoid script full text catalog creation SQL script into the script file. If it is specified as true or not defined, SQL database with full text catalog will generate a statement which is not transact-able during deploy:
CREATE FULLTEXT CATALOG [test1234]
WITH ACCENT_SENSITIVITY = ON
AUTHORIZATION [dbo]
5. Some SQL files are meant to be deployed without transaction, such as statement with “Create Database”, “Create FULLTEXT CATALOG” etc. In this case, we need to make sure msdeploy package them with setting Transacted=”False” in their Source XML tag in the project file. Such as following:
<ObjectGroup Name="NewConnection1" Order="3" xmlns="">
<Destination Path="" />
<Object Type="dbFullSql">
<PreSource Path="Data Source=1p18-fwg35%3bInitial Catalog=test1%3bIntegrated Security=True" ScriptSchema="True" ScriptData="False" CopyAllFullTextCatalogs="True" />
<Source Path="obj\Debug\AutoScripts\NewConnection1_SchemaOnly.sql" Transacted="False" />
</Object>
</ObjectGroup>
Note, Source tag is used for this SMO option, not Presource tag, since this SMO option will be used in the source manifest file during packaging the generated script to the package file time. Our process is first use Presource SMO options to script a database to a temporary SQL file, then use Source SMO options in a manifest file to package the temporary SQL file to the web application package. Similar SMO options include “dropDestinationDatabase”.
Thanks
Xinyang Qiu
SDETII
Visual Studio Web Tools
If by any chance you are not seeing intellisense in your JavaScript or HTML after installing Visual Studio 2010 Beta 2 you might be running into a known bug that we can show you how to fix.
The bug is related to user settings which we don’t remove when Beta 1 is uninstalled. One particular setting under HKCU\Software\Microsoft\VisualStudio\10.0\HTML Editor\TargetFriendlyName. For Beta 2, this setting does not match the schema’s we know about. As a result, JScript intellisense will fail to load and most items will be missing in markup as well.
The minimum fix is to manually repair the TargetFriendlyName setting in the registry (change it to be just "XHTML 1.0 Transitional”) but due to the fact that more settings could be affected the recommended fix is to reset all settings after Beta 2 is installed.
To reset all settings drop down the Tools menu and select Import and Export Settings. This will bring up the Import and Export Settings Wizard as seen below. Choose the last option “Reset all settings” and click Next when ready.
From there choose whether you want to saving your settings or not and click Next again.
Finally, choose the collection of settings that best fits your development environment and click Finish when done.
Thank you,
Mike Snow
SDET Lead
Visual Studio Web Tools
Visual Studio 2010 Beta2 is out and we at the Web Development Tools team are pleased to let you know that we have fixed a lot of the performance issues from Beta1. It took a considerable amount of time and effort but we feel it was well worth it. We would like to thank the community for your feedback and in helping us identify a lot of these issues.
There has been some good improvements to Add Reference dialog, first switch to design view etc. Please try using Beta2 and let us know if you find any of the Web Scenarios to be particularly slow. We would like to hear your issues and concerns around performance for Web Scenarios.
You can help make the product better by providing us with early feedback. If you encounter a performance issue please respond via comments section of this blog or you can reach us at vwdperf-at-microsoft-dot-com.
Here are the list of information that can help us with to narrow down the issue.
1. What is the time taken in Visual Studio 2008 SP1 for this action?
2. What is the time taken in Visual Studio 2010 for this action?
3. Can this be reproduced consistently in Visual Studio 2010?
4. Do you have a ASP.NET Website or a ASP.NET Web Application Project? What is the size of this Website or Web Application Project?
5. Is it C# or VB?
6. Is it a 4.0 , 3.5 or a 2.0 App?
7. Do you have other applications running on the box? If so what are they?
8. Machine configuration.
Thanks
Reshmi Mangalore
SDET| Web Development Tools
Visual Studio 2010 Beta 2 has officially shipped! If you haven’t already, download a copy from here.
What New with Visual Studio
If you are new to Visual Studio 2010 please check out all our previous blogs to get a understanding of all the changes we made for Beta 1 including this intro blog on beta 1: http://blogs.msdn.com/webdevtools/archive/2009/05/20/visual-studio-10-and-asp-net-4-0-beta1.aspx
What’s New with Beta 2
With this release the Web Tools team has introduced a number of great improvements. A number of these improvements are listed below.
- New Template
Using the default ASP.NET web site template, projects now come with a pre-configured site. This template configures your site to use master and content pages. In addition, it has styles pre-defined and controls for login, register and changing your password.
If you do not want to use this template but would rather start from a empty state you can still use the “Empty Web Site” template. This creates a completely empty project that you will need to add a default web form to.
- Silverlight 3 Tooling Support
IMPORTANT NOTE: If you already have Silverlight 3 SDK RTM version (not the GDR) installed on your box you will need to first uninstall it before running Visual Studio 2010 beta 2 setup. This is irrespective of the SDK language version and platform. The SDK GDR does not install on top of the RTM version of the SDK. This problem should be remedied by RTM. If you proceed with install in this state you will get an error at the end of install stating that the SDK failed to install. This error does not affect your setup of beta 2 for Visual Studio but you will still need uninstall to SDK RTM and re-install the SDK GDR if you wish to get the latest version of the SDK. Note that you can install the SL3 GDR SDK directly from here: http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=1ea49236-0de7-41b1-81c8-a126ff39975b.
While Dev10 tooling for Beta 1 has Silverlight 2 features that worked with Silverlight 3, Beta 2 now re-introduces all the Silverlight 3 features directly into Visual Studio.
Changes include:
- Support for configuring Out of browser (see screenshot below).
- Support for Transparent Platform Extensions.
- Page.xaml renamed to MainPage.xaml.
- Removal of support for Silverlight 2.
- Parameterization of Web Packages
VS will automatically parameterize the connection strings defined in the web.config and the destination virtual application name. The users can specify customized parameters in parameters.xml file in the project directory as well, to parameterize configurations, such as WCF service’s end point etc.
- Import from web.config file for DB deployment
Web application’s Deploy SQL property page provided a button “Import from web.config”, which will import the web.config connection string names to the connection list, with the connection strings as their package source.
- Code Focused Profile
When you first launch VS it will prompt you for the IDE profile you want to use. http://weblogs.asp.net/scottgu/archive/2009/09/02/code-optimized-web-development-profile-vs-2010-and-net-4-0-series.aspx
- Performance Enhancements.
Significant changes were made to increase performance across the board.
Upcoming Web Tools Blogs
Over the next two weeks our team has a number of blogs planned that will show you the low level details of what’s new in Dev10.
Topics include:
- Import from web.config file for DB deployment
- MVC and Dev10 support
- Trimming of Web.config file
- SL 3.0 and Dev10 support
- New Template
- How to use Snippets in Dev10
- JavaScript Improvements in Dev10
- Parameterization of WebPackages
- And more…
More Info
VS 2010 Beta 2 also comes with support for:
- Visual Studio Express which includes the following free SKUs for Web: VB, C#, and C++.
- Side by Side support with VS 2008.
ASP.NET PM and VWD PM - What’s new in ASP.NET 4 and VWD 2010 Whitepaper. Available here: http://www.asp.net/learn/whitepapers/aspnet40/ (Note: The URL is being updated to http://www.asp.net/learn/whitepapers/aspnet4/)
For more info on this release check out the following blogs which other teams and individuals have created for this release:
- ScottGu’s series of blogs on ASP.NET 4: http://weblogs.asp.net/scottgu/archive/2009/08/25/vs-2010-and-net-4-series.aspx
- AJAX: http://stephenwalther.com/blog/archive/2009/10/21/the-microsoft-ajax-library-and-visual-studio-beta-2.aspx
- Data Enhancements: http://blogs.msdn.com/scothu/archive/2009/10/20/data-enhancements-in-net-4-visual-studio-2010-beta-2.aspx
- ASP.NET 4 Beta 2 - http://msdnstage.redmond.corp.microsoft.com/en-us/library/ee532866(VS.100).aspx
- Visual Studio 2010 Beta 2 - http://msdn.microsoft.com/en-us/vstudio/dd582936.aspx
- Web Deployment Overview - http://vishaljoshi.blogspot.com/2009/09/overview-post-for-web-deployment-in-vs.html
Thank you,
Mike Snow
SDET Lead
Visual Studio Web Tools
Last week we released ASP.Net MVC 2 Preview 2 for Visual Studio 2008 Sp1. In the box support for single project areas is now included and the Add View tool has been modified to streamline this scenario. A walkthrough that creates two simple single project areas can be found here. If you follow the steps in the walkthrough you will notice that Add Controller and Add View are now available in the single project areas in your ASP.Net MVC 2 Preview 2 application. Here are some screenshots that show off the tooling changes.
Right-Clicking the Controllers folder of any single project area (Areas –> Blog –> Controllers) will invoke the familiar Add Controller dialog.
The new controller will be added to the Controllers folder of the single project area rather than the Controllers folder of the ASP.Net MVC 2 Preview 2 Application.
Right-Click within an action method of the controller to add a view with the Add View dialog.
The view will be added to Areas –> [Area Name] –> Views –> [Controller Name] when added from an action method in the controllers folder of an area. The Views folder structure will be created for you if it does not yet exist. Notice the intellisense error in the view that was added. This is because the area needs a Web.Config just like the Web.Config in the Application’s Views folder. We are working on simplifying some of these scenarios for the next release of ASP.Net MVC 2 but for now you should follow the steps in the walkthrough to register your single project area so that it will work at run time.
Right click within the newly created area to find the familiar Go To Controller context menu item. The controller within your area also contains a Go To View context menu item. You can navigate back and forth between controllers and views in your area just as you can with controllers and views in the root of the ASP.Net MVC 2 application.
Hope this helps you get started with single project areas!
Joe Cartano | Visual Web Developer
The multi-targeting feature of Visual Studio 2010 allows web developers to develop web applications targeting ASP.NET 2.0, 3.0, 3.5 and 4.0. Our earlier posts here and here describe some of the multi-targeting capabilities of Visual Studio 2010.
Targeting frameworks 2.0, 3.0 or 3.5 using VS 2010 requires 3.5 Sp1 to be installed
With VS 2010, only the latest 4.0 version of the .NET framework will be installed on your machine as part of the Visual Studio installation. For VS 2010 to be able to target any of the earlier frameworks 2.0, 3.0 or 3.5, the .NET Framework 3.5 Sp1 must be installed on the machine.
When 3.5 Sp1 is not present
If 3.5 Sp1 was not already present on your machine prior to installation of VS 2010, you will see the following behavior when you start VS 2010:
- The New Website dialog will show 4.0 as the only available option (as shown in Figure 1)
Figure 1
- If you open the Property pages of the website, you will see that 4.0 is the only available option (as shown in Figure 2)
Figure 2
- Conversion of projects created using Visual Studio 2005 or Visual Studio 2008 to VS 2010 -
During conversion of a web project created using VS 2005 or VS 2008, instead of the upgrade prompt (shown in figure 6), you will see a dialog (shown in figure 3) that allows you to either upgrade your project to 4.0 or take you to the installation page for .NET 3.5 Sp1.
Figure 3
To then be able to target 2.0, 3.0 or 3.5 using VS 2010, you should install the 3.5 Sp1 framework from the installation page. To quickly navigate to the installation page, you can use the 'More Frameworks' link in figure 1 or select the option 'Take me to the Framework Download Web Site' in figure 3.
When 3.5 Sp1 is installed
Once 3.5 Sp1 is installed, then simply restart VS 2010 and the earlier frameworks such as 2.0, 3.0 and 3.5 will now light-up as available target frameworks.
- The New Website dialog will show 2.0, 3.0, 3.5 and 4.0 (as shown in Figure 4)
Figure 4
- If you open the Property pages of the website, you will see that you can re-target your website to 2.0, 3.0, 3.5 or 4.0 (as shown in Figure 5)
Figure 5
- Conversion of projects created using Visual Studio 2005 or Visual Studio 2008 to VS 2010 -
During conversion of a web project created using VS 2005 or VS 2008, you will see the more familiar prompt (shown in figure 6) allowing you to continue targeting the lower .NET framework version such as ASP.NET 2.0, 3.0 or 3.5, or optionally, upgrade the project to target the latest .NET framework version ASP.NET 4.0
Figure 6
Bala Chirtsabesan | SDET | Visual Studio Web Developer
Scalable Vector Graphics (SVG) is W3C standard language for describing two-dimensional vector and mixed vector/raster graphics in XML. Firefox 3+, Opera 9+ and Safari 3+ support SVG rendering. Unfortunately, Internet Explorer 8 does not support SVG natively and requires a plug-in. There a plug in from Adobe (although support was discontinued this year) as well as few pulg-ins listed in Wikipedia article on SVG.
SVG element is part of upcoming HTML 5 standard which allows inline SVG in HTML documents. Inline SVG is not yet fully supported in modern browsers so you probably still want to use <object> element for now. For example:
<html>
<head>
<title>SVG test</title>
</head>
<body>
<object data="svg-test.svg" type="image/svg+xml" width="500" height="500" />
</body>
</html>
Now you need to author SVG file. SVG is XML and fortunately, Visual Studio and Visual Web Developer come with XML editor that provides intellisense and validation provided you have appropriate XML schema. Although XML editor supports both DTD and XSD validation we decided to use XSD schema. W3C site provides only modularized DTD schema for SVG. For your convenience we converted modular DTD to a single XSD file using handy Dtd2Xs converter from Syntext and then manually edited it to fix a few minor issues. SVG schema is attached to this post - see below or click here to download the file.
In order to enable SVG intellisense in VS and VWD follow these steps:
- Create Schemas folder in your Web site or Web Application project root.
- Place downloaded SVG.XSD in the Schemas folder.
- Create a new XML file and save it with SVG extension, such as svg-test.svg.
- Add basic SVG content and save the file, for example
<?xml version="1.0" encoding="utf-8"?>
<svg xmlns="http://www.w3.org/2000/svg" width="500" height="500" version="1.1">
<rect x="100" y="100" width="300" height="300" />
</svg>
- Add new HTML file (say, svg-test.htm) in the root folder and add
<object data="svg-test.svg" type="image/svg+xml" width="500" height="500" />
to the <body> element. You can also use existing HTML or ASPX page.
- Right-click on the svg-test.htm file in Solution Explorer and choose Browse With....
- Pick SVG-enabled browser and click OK. You should see SVG content rendered like

Now try typing < in the SVG file. XML editor should now provide you wil intellisense for SVG elements and atributes:

Similar steps should work in VS 2010 as well. Enjoy!
-- Mikhail Arkhipov
Visual Studio 2010 improves .NET framework multi-targeting by applying framework-appropriate filtering to the property grid and Intellisense.
For example, if you select a button on a web form of a .NET 2.0 web project, in the Property Grid you will see:
If you go to the Project Properties and change the Target Framework version to 4.0:
...the Property Grid display will change to display 4.0-specific properties:
While this looks simple and straight-forward, there's actually an illusion at work! Only one framework can be loaded into an AppDomain at a time, and Visual Studio uses .NET 4.0 specific capabilities. So the actual controls displayed on the design surface are always 4.0 controls. Their properties are filtered for display in the Property Grid and Intellisense to match the Target Framework displayed in the Project Properties.
Setting the Target Framework in the Project Properties writes to the targetFramework attribute of the compilation tag in web.config file as well. The web.config setting is used by the build system, which is responsible for generating the errors and warnings that appear in the Error List. So do not manually change the Target Framework by hand-editing the web.config file, use the Project Properties instead. This will ensure that the entire project system is using the same setting.