Dedicated Server

A dedicated hosting service, dedicated server, or managed hosting service is a type of Internet hosting in which the client leases an entire server not shared with anyone. This is more flexible than shared hosting, as organizations have full control over the server(s), including choice of operating system.

Managed Dedicated Server

Managed dedicated server To date, no industry standards have been set to clearly define the management role of dedicated server providers. What this means is that each provider will use industry standard terms, but each provider will define them differently. For some dedicated server providers.

SQL ServerCompact Edition

The compact edition is an embedded database engine. Unlike the other editions of SQL Server, the SQL CE engine is based on SQL Mobile (initially designed for use with hand-held devices) and does not share the same binaries.

SQl Server Architecture

When writing code for SQL CLR, data stored in SQL Server databases can be accessed using the ADO.NET APIs like any other managed application that accesses SQL Server data.

Bandwidth and Connectivity

Bandwidth refers to the data transfer rate or the amount of data that can be carried from one point to another in a given time period (usually a second) and is often represented in bits (of data) per second (bit/s).

Thursday, February 12, 2004

SQL Server Architecture - Data Storage

Data storage
The main unit of data storage is a database, which is a collection of tables with typed columns. SQL Server supports different data types, including primary types such as Integer, Float, Decimal, Char (including character strings), Varchar (variable length character strings), binary (for unstructured blobs of data), Text (for textual data) among others. The rounding of floats to integers uses either Symmetric Arithmetic Rounding or Symmetric Round Down (Fix) depending on arguments: SELECT Round(2.5, 0) gives 3.

Microsoft SQL Server also allows user-defined composite types (UDTs) to be defined and used. It also makes server statistics available as virtual tables and views (called Dynamic Management Views or DMVs). In addition to tables, a database can also contain other objects including views, stored procedures, indexes and constraints, along with a transaction log. A SQL Server database can contain a maximum of 231 objects, and can span multiple OS-level files with a maximum file size of 220 TB. The data in the database are stored in primary data files with an extension .mdf. Secondary data files, identified with a .ndf extension, are used to store optional metadata. Log files are identified with the .ldf extension.

Storage space allocated to a database is divided into sequentially numbered pages, each 8 KB in size. A page is the basic unit of I/O for SQL Server operations. A page is marked with a 96-byte header which stores metadata about the page including the page number, page type, free space on the page and the ID of the object that owns it. Page type defines the data contained in the page - data stored in the database, index, allocation map which holds information about how pages are allocated to tables and indexes, change map which holds information about the changes made to other pages since last backup or logging, or contain large data types such as image or text. While page is the basic unit of an I/O operation, space is actually managed in terms of an extent which consists of 8 pages. A database object can either span all 8 pages in an extent ("uniform extent") or share an extent with up to 7 more objects ("mixed extent"). A row in a database table cannot span more than one page, so is limited to 8 KB in size. However, if the data exceeds 8 KB and the row contains Varchar or Varbinary data, the data in those columns are moved to a new page (or possibly a sequence of pages, called an Allocation unit) and replaced with a pointer to the data.

For physical storage of a table, its rows are divided into a series of partitions (numbered 1 to n). The partition size is user defined; by default all rows are in a single partition. A table is split into multiple partitions in order to spread a database over a cluster. Rows in each partition are stored in either B-tree or heap structure. If the table has an associated index to allow fast retrieval of rows, the rows are stored in-order according to their index values, with a B-tree providing the index. The data is in the leaf node of the leaves, and other nodes storing the index values for the leaf data reachable from the respective nodes. If the index is non-clustered, the rows are not sorted according to the index keys. An indexed view has the same storage structure as an indexed table. A table without an index is stored in an unordered heap structure. Both heaps and B-trees can span multiple allocation units.

Tuesday, February 10, 2004

Microsoft SQL Server



Microsoft SQL Server is a relational model  database server  produced by Microsoft. Its primary query languages are T-SQL  and ANSI SQL.

THE BEGINNING
Prior to version 7.0 the code base for MS SQL Server was sold by Sybase SQL Server to Microsoft, and was Microsoft's entry to the enterprise-level database market, competing against Oracle, IBM, and, later, Sybase. Microsoft, Sybase and Ashton-Tate originally teamed up to create and market the first version named SQL Server 1.0 for OS/2 (about 1989) which was essentially the same as Sybase SQL Server 3.0 on Unix, VMS, etc. Microsoft SQL Server 4.2 was shipped around 1992 (available bundled with IBM OS/2 version 1.3). Later Microsoft SQL Server 4.21 for Windows NT was released at the same time as Windows NT 3.1. Microsoft SQL Server v6.0 was the first version designed for NT, and did not include any direction from Sybase.

About the time Windows NT was released, Sybase and Microsoft parted ways and each pursued their own design and marketing schemes. Microsoft negotiated exclusive rights to all versions of SQL Server written for Microsoft operating systems. Later, Sybase changed the name of its product to Adaptive Server Enterprise to avoid confusion with Microsoft SQL Server. Until 1994, Microsoft's SQL Server carried three Sybase copyright notices as an indication of its origin.

Since parting ways, several revisions have been done independently. SQL Server 7.0 was a rewrite from the legacy Sybase code. It was succeeded by SQL Server 2000, which was the first edition to be launched in a variant for the IA-64 architecture.

In the ten years since release of Microsoft's previous SQL Server product (SQL Server 2000), advancements have been made in performance, the client IDE tools, and several complementary systems that are packaged with SQL Server 2005. These include: an ETL tool (SQL Server Integration Services or SSIS), a Reporting Server, an OLAP and data mining server (Analysis Services), a

Monday, February 9, 2004

Microsoft SQL Server Editions

sql server

Microsoft makes SQL Server available in multiple editions, with different feature sets and targeting different users. These editions are:

SQL ServerCompact Edition (SQL CE)
    The compact edition is an embedded database engine. Unlike the other editions of SQL Server, the SQL CE engine is based on SQL Mobile (initially designed for use with hand-held devices) and does not share the same binaries. Due to its small size (1 MB DLL footprint), it has a markedly reduced feature set compared to the other editions. For example, it supports a subset of the standard data types, does not support stored procedures or Views or multiple-statement batches (among other limitations). It is limited to 4 GB maximum database size and cannot be run as a Windows service, Compact Edition must be hosted by the application using it. The 3.5 version includes considerable work that supports ADO.NET Synchronization Services.

SQL Server Datacenter Edition
SQL Server
Developer Edition
    SQL Server Developer Edition includes the same features as SQL Server Enterprise Edition, but is limited by the license to be only used as a development and test system, and not as production server. This edition is available to download by students free of charge as a part of Microsoft's DreamSpark program.

SQL Server 2005 Embedded Edition (SSEE)
   SQL Server 2005 Embedded Edition is a specially configured named instance of the SQL Server Express database engine which can be accessed only by certain Windows Services.

SQL Server 2005 Enterprise Edition
    SQL Server Enterprise Edition is the full-featured edition of SQL Server, including both the core database engine and add-on services, while including a range of tools for creating and managing a SQL Server cluster.
SQL Server Evaluation Edition
   SQL Server Evaluation Edition, also known as the Trial Edition, has all the features of the Enterprise Edition, but is limited to 180 days, after which the tools will continue to run, but the server services will stop.

SQL Server Express Edition
    SQL Server Express Edition is a scaled down, free edition of SQL Server, which includes the core database engine. While there are no limitations on the number of databases or users supported, it is limited to using one processor, 1 GB memory and 4 GB database files (10 GB database files from SQL Server Express 2008 R2[28]). The entire database is stored in a single .mdf file, and thus making it suitable for XCOPY deployment. It is intended as a replacement for MSDE. Two additional editions provide a superset of features not in the original Express Edition. The first is SQL Server Express with Tools, which includes SQL Server Management Studio Basic. SQL Server Express with Advanced Services adds full-text search capability and reporting services.

SQL Server Fast Track
    SQL Server Fast Track is specifically for enterprise-scale data warehousing storage and business intelligence processing, and runs on reference-architecture hardware that is optimized for Fast Track.

SQL Server Standard Edition
    SQL Server Standard edition includes the core database engine, along with the stand-alone services. It differs from Enterprise edition in that it supports fewer active instances (number of nodes in a cluster) and does not include some high-availability functions such as hot-add memory (allowing memory to be added while the server is still running), and parallel indexes.

SQL Server Web Edition
   SQL Server Web Edition is a low-TCO option for Web hosting.

SQL Server Workgroup Edition
    SQL Server Workgroup Edition includes the core database functionality but does not include the additional services..

SQL Server 2005


SQL Server 2005 (codename Yukon), released in October 2005, is the successor to SQL Server 2000. It included native support for managing XML data, in addition to relational data. For this purpose, it defined an xml data type that could be used either as a data type in database columns or as literals in queries. XML columns can be associated with XSD  schemas; XML data being stored is verified against the schema. XML is converted to an internal binary data type before being stored in the database. Specialized indexing methods were made available for XML data. XML data is queried using XQuery; Common Language Runtime (CLR) integration was a main feature with this edition, enabling one to write SQL code as Managed Code by the CLR. SQL Server 2005 added some extensions to the T-SQL language to allow embedding XQuery queries in T-SQL. In addition, it also defines a new extension to XQuery, called XML DML, that allows query-based modifications to XML data. SQL Server 2005 also allows a database server to be exposed over web services using TDS packets encapsulated within SOAP (protocol) requests. When the data is accessed over web services, results are returned as XML.

For relational data, T-SQL has been augmented with error handling features (try/catch) and support for recursive queries with CTEs (Common Table Expressions). SQL Server 2005 has also been enhanced with new indexing algorithms, syntax and better error recovery systems. Data pages are checksummed for better error resiliency, and optimistic concurrency support has been added for better performance. Permissions and access control have been made more granular and the query processor handles concurrent execution of queries in a more efficient way. Partitions on tables and indexes are supported natively, so scaling out a database onto a cluster is easier. SQL CLR was introduced with SQL Server 2005 to let it integrate with the .NET Framework.

SQL Server 2005 introduced "MARS" (Multiple Active Results Sets), a method of allowing usage of database connections for multiple purposes.

SQL Server  2005 introduced DMVs (Dynamic Management Views), which are specialized views and functions that return server state information that can be used to monitor the health of a server instance, diagnose problems, and tune performance.

SQL Server 2005 introduced Database Mirroring, but it was not fully supported until the first Service Pack release (SP1). In the initial release (RTM) of SQL Server 2005, database mirroring was available, but unsupported. In order to implement database mirroring in the RTM version, you had to apply trace flag 1400 at startup. Database mirroring is a high availability option that provides redundancy and failover capabilities at the database level. Failover can be performed manually or can be configured for automatic failover. Automatic failover requires a witness partner and an operating mode of synchronous (also known as high-safety or full safety).

Sunday, February 8, 2004

Dedicated Server - Limitation


Many providers do not allow IRC (bots, clients or daemons). This is due to rogue IRC users triggering DDoS attacks against the provider, which may overwhelm their networks, lowering service quality for all customers.
  • Adult content is disallowed by many providers as it may either be of questionable legality or consume large amounts of bandwidth.
  • Copyright violation Hosting copyrighted material of which you do not own the copyright to is against the terms of service of most hosting companies.

Saturday, February 7, 2004

Dedicated Server - Software


 Providers often bill for dedicated servers on a fixed monthly price to include specific software packages. Over the years, software vendors realized the significant market opportunity to bundle their software with dedicated servers. They have since started introducing pricing models that allow dedicated hosting providers the ability to purchase and resell software based on reduced monthly fees.

Microsoft offers software licenses through a program called the Service Provider License Agreement. The SPLA model provides use of Microsoft products through a monthly user or processor based fee. SPLA software includes the Windows Operating System, Microsoft SQL Server, Microsoft Exchange Server, Microsoft SharePoint and shoutcast hosting, and many other server based products.

Dedicated Server Providers usually offer the ability to select the software you want installed on a dedicated server. Depending on the overall usage of the server, this will include your choice of operating system, database, and specific applications. Servers can be customized and tailored specific to the customer’s needs and requirements.

Other software applications available are specialized web hosting specific programs called control panels. Control panel software is an all inclusive set of software applications, server applications, and automation tools that can be installed on a dedicated server. Control panels include integration into web servers, database applications, programming languages, application deployment, server administration tasks, and include the ability to automate tasks via a web based front end.

Most dedicated servers are packaged with a control panel. Control panels are often confused with management tools, but these control panels are actually web based automation tools created to help automate the process of web site creation and server management. Control panels should not be confused with a full server management solution by a dedicated hosting provider.

Friday, February 6, 2004

Dedicated Server - Management

Switch


Management
Managed dedicated server

To date, no industry standards have been set to clearly define the management role of dedicated server providers. What this means is that each provider will use industry standard terms, but each provider will define them differently. For some dedicated server providers, fully managed is defined as having a web based control panel while other providers define it as having dedicated system engineers readily available to handle all server and network related functions of the dedicated server provider.

Server A management can include some or all of the following:
  • Operating system updates
  • Application updates
  • Server monitoring
  • SNMP hardware monitoring
  • Application monitoring
  • Application management
  • Technical support
  • Firewall services
  • Antivirus updates
  • Security audits
  • DDoS protection and mitigation
  • Intrusion detection
  • Backups and restoration
  • Disaster recovery
  • DNS hosting service
  • Load balancing
  • Database administration
  • Performance tuning
  • Software installation and configuration
  • User management
  • Programming consultation

Dedicated hosting server providers define their level of management based on the services they provide. In comparison, fully managed could equal self managed from provider to provider.

Administrative maintenance of the operating system, often including upgrades, security patches, and sometimes even daemon updates are included. Differing levels of management may include adding users, domains, daemon configuration, or even custom programming.

Dedicated server hosting providers may provide the following types of server managed support:
  • Fully Managed - Includes monitoring, software updates, reboots, security patches and operating system upgrades. Customers are completely hands-off.
  • Managed - Includes medium level of management, monitoring, updates, and a limited amount of support. Customers may perform specific tasks.
  • Self Managed - Includes regular monitoring and some maintenance. Customers provide most operations and tasks on dedicated server.
  • Unmanaged - Little to no involvement from service provider. Customers provide all maintenance, upgrades, patches, and security.

Thursday, February 5, 2004

Dedicated Server - Bandwidth and connectivity

Bandwidth

Bandwidth refers to the data transfer rate or the amount of data that can be carried from one point to another in a given time period (usually a second) and is often represented in bits (of data) per second (bit/s). For example, visitors to your server, web site, or applications utilize bandwidth *Third – Total Transfer (measured in bytes transferred)

95th Method: line speed, billed on the 95th percentile, average or peak usage, refers to the speed in which data flows from the server or device. Line speed is measured in bits per second (or kilobits per second, megabits per second or gigabits per second).

Unmetered Method: The second bandwidth measurement is unmetered service where providers cap or control the “top line” speed for a server. Top line speed in unmetered bandwidth is the total Mbit/s allocated to the server and configured on the switch level. For example, if you purchase 10 Mbit/s unmetered bandwidth, the top line speed would be 10 Mbit/s. 10 Mbit/s would result in the provider controlling the speed transfers take place while providing the ability for the dedicated server owner to not be charged with bandwidth overages. Unmetered bandwidth services usually incur an additional charge.

Total Transfer Method: Some providers will calculate the Total Transfer, the measurement of actual data leaving and arriving, measured in bytes. Measurement between providers varies, though it is either the total traffic in, the total traffic out, whichever is the greater or the sum of the two.

Bandwidth Pooling: This is a key mechanism for hosting buyers to determine which provider is offering the right pricing mechanism of bandwidth pricing. Most Dedicated Hosting providers bundle bandwidth pricing along with the monthly charge for the dedicated server. Let us illustrate this with the help of an example. An average $100 server from any of the common dedicated bandwidth providers would carry 2 TB of bandwidth. Suppose you purchased 10 servers then you would have the ability to consume 2 TB of bandwidth per server. However, let us assume that given your application architecture only 2 of these 10 servers are really web facing while the rest are used for storage, search, database or other internal functions then the provider that allows bandwidth pooling would let you consume overall 20 TB of bandwidth as incoming or outbound or both depending on their policy. The provider that does not offer bandwidth pooling would just let you use 2 TB of bandwidth and the rest of the 8 TB of bandwidth would be practically unusable.


One of the reasons for choosing to outsource dedicated servers is the availability of high powered networks from multiple providers. As dedicated server providers utilize massive amounts of bandwidth, they are able to secure lower volume based pricing to include a multi-provider blend of bandwidth. To achieve the same type of network without a multi-provider blend of bandwidth, a large investment in core routers, long term contracts, and expensive monthly bills would need to be in place. The expenses needed to develop a network without a multi-provider blend of bandwidth does not make sense economically for hosting providers.

Many dedicated server providers include a service level agreement based on network uptime. Some dedicated server hosting providers offer a 100% uptime guarantee on their network. By securing multiple vendors for connectivity and using redundant hardware, providers are able to guarantee higher uptimes; usually between 99-100% uptime if they are a higher quality provider. One aspect of higher quality providers is they are most likely to be multi-homed across multiple quality uplink providers, which in turn, provides significant redundancy in the event one goes down in addition to potentially improved routes to destinations.

Bandwidth consumption over the last several years has shifted from a per megabit usage model to a per gigabyte usage model. Bandwidth was traditionally measured in line speed access that included the ability to purchase needed megabits at a given monthly cost. As the shared hosting model developed, the trend towards gigabyte or total bytes transferred, replaced the megabit line speed model so dedicated server providers started offering per gigabyte.

Prominent players in the dedicated server market offer large amounts of bandwidth ranging from 500 gigabytes to 3000 gigabytes using the “overselling” model. It is not uncommon for major players to provide dedicated servers with 1Terabyte (TB) of bandwidth or higher. Usage models based on the byte level measurement usually include a given amount of bandwidth with each server and a price per gigabyte after a certain threshold has been reached. Expect to pay additional fees for bandwidth overage usage. For example, if a dedicated server has been given 3000 gigabytes of bandwidth per month and the customer uses 5000 gigabytes of bandwidth within the billing period, the additional 2000 gigabytes of bandwidth will be invoiced as bandwidth overage. Each provider has a different model for billing. As of yet, no industry standards have been set.

Wednesday, February 4, 2004

Dedicated Server - Operating system support


Availability, price and employee familiarity often determines which operating systems are offered on dedicated servers. Variations of Linux and Unix (open source operating systems) are often included at no charge to the customer. Commercial operating systems include Microsoft Windows Server, provided through a special program called Microsoft SPLA. Red Hat Enterprise is a commercial version of Linux offered to hosting providers on a monthly fee basis. The monthly fee provides OS updates through the Red Hat Network using an application called yum. Other operating systems are available from the open source community at no charge. These include CentOS, Fedora Core, Debian, and many other Linux distributions or BSD systems FreeBSD, NetBSD, OpenBSD.

Support for any of these operating systems typically depends on the level of management offered with a particular dedicated server plan. Operating system support may include updates to the core system in order to acquire the latest security fixes, patches, and system-wide vulnerability resolutions. Updates to core operating systems include kernel upgrades, service packs, application updates, and security patches that keep server secure and safe. Operating system updates and support relieves the burden of server management from the dedicated server owner.

Dedicated hosting service

dedicated hosting service
A dedicated hosting service, dedicated server, or managed hosting service is a type of Internet hosting in which the client leases an entire server not shared with anyone. This is more flexible than shared hosting, as organizations have full control over the server(s), including choice of operating system, hardware, etc. Server administration can usually be provided by the hosting company as an add-on service. In some cases a dedicated server can offer less overhead and a larger return on investment. Dedicated servers are most often housed in data centers, similar to colocation facilities, providing redundant power sources and HVAC  systems. In contrast to colocation, the server hardware is owned by the provider and in some cases they will provide support for your operating system or applications.

Tuesday, February 3, 2004

WebMatrix 1. 0

Microsoft WebMatrix Web Hosting

WebMatrix is a brand new web development tool from Microsoft that includes everything you need for website development. Start from open source web applications, built-in web templates or just start writing code yourself. It’s all-inclusive, simple and best of all free. Developing websites has never been easier.
Installation

To install WebMatrix 1.0, you must first install the Microsoft Web Platform Installer 3.0. After you've installed the Web Platform Installer, you can use it to install WebMatrix.

If you have problems during installation, refer to Troubleshooting Problems with Microsoft Web Platform Installer.

How to Publish Applications

See Step-by-Step Instructions for Publishing Applications

Changes and Issues with WebMatrix
Issue: WebMatrix 1.0 is available only on platforms that support Microsoft .NET Framework 4

The .NET Framework version 4 is required for WebMatrix. In certain cases, the WebMatrix 1.0 installer will let you try to install on a platform that is not part of the supported configuration set. In particular, Windows Vista without the SP1 update will let you begin the installation of WebMatrix, but the .NET Framework 4 component will fail and block your installation.

Workaround
Install on a supported platform, which includes:
  • Windows 7
  • Windows Server 2008
  • Windows Server 2008 R2
  • Windows Vista SP1 or later
  • Windows XP SP3
  • Windows Server 2003 SP2

Issue: Cannot install WebMatrix 1.0 if Microsoft Visual Studio 2008 is installed without Microsoft Visual Studio 2008 SP1

Workaround
Install Microsoft Visual Studio 2008 SP1 from the Microsoft Download Center.

Issue: Some assemblies for SQL Server Compact 4.0 are not installed in the GAC

The managed assemblies for SQL Server Compact 4.0 are not placed in the global assembly cache (GAC) when you install SQL Server Compact 4.0 on a 64-bit computer and the computer has only the .NET Framework 3.5 SP1 Client Profile installed. The managed assemblies that are not installed in the GAC are:

* System.Data.SqlServerCe.dll (ADO.NET provider)
* System.Data.SqlServerCe.Entity.dll (ADO.NET Entity Framework )

Workaround
Uninstall SQL Server Compact 4.0. Download and install the full version of .NET Framework 3.5 SP1 from the following location:
Microsoft .NET Framework 3.5 Service pack 1 (Full Package)
Then reinstall SQL Server Compact 4.0.

Issue: Cannot uninstall SQL Server Compact using the command line

Uninstallation of SQL Server Compact using command-line options does not work in this release.

Workaround
Use Programs and Features in the Windows Control Panel to uninstall Microsoft SQL Server Compact 4.0.


New stuff, Changes and issues with ASP.NET Web Pages




New: Configuration setting added to disable the package manager

A new asp:Admin Manager Enabled key is available for the element in the web.config file, which lets you completely disable the package manager. The default value for this element is true, meaning that if it is not included in the web.config file, the package manager is enabled. To disable the package manager, add the following element to the web.config file in the root of the website:

Change: "webPages: Admin Folder Virtual Path" key renamed to "asp:Admin Folder Virtual Path"

The webPages: Admin Folder  Virtual Path key that can be added to the web.config file to specify the location of the package manager has been renamed to use the asp: namespace instead of the webPages namespace. If you have used this element, you must rename it in the configuration file.

Issue: Passwords for membership users no longer recognized

The algorithm for creating and storing membership (login) passwords has been changed to be more secure. As a result, the passwords stored for members (users) created in Beta versions of ASP.NET Razor will not be recognized.

Workaround
If the site has not yet been put into production, remove the user records from the membership database. If database is live, programmatically regenerate existing passwords in the membership database.

Issue: Unexpected behavior when using a custom user table for membership

To initialize the membership provider for an ASP.NET Razor website, you call the WebSecurity.Initialize Database Connection method. (In
WebMatrix, the Starter Site template includes a call to this method in the _AppStart.cshtml file.) If the auto CreateTables parameter of this method is set to true (by default, it is set to true in the Starter Site template), and if an unrecognized table name is passed to the method (the second parameter), the method does not throw an error. Instead, it automatically creates the table.

This can be a problem if you intend to use a custom user table for membership but pass the wrong table name to the WebSecurity. Initialize Database  Connection method. Because the method does not by default raise an error if the table you specify does not exist, and because it instead creates a new table, the application can appear to be working. However, application code that relies on your custom user table (and on fields in it) can eventually fail with unexpected errors.

Workaround
Make sure that the name passed in the Initialize Database Connection method matches the user profile table in the membership database, or make sure that the auto Create Tables parameter is set to false.

Issue: Error message "The Admin Module requires access to /App_Data"

Under some circumstances, trying to create users or otherwise work with the ASP.NET membership system can cause the page to display the error The Admin Module requires access to /App_Data. This occurs if the account that IIS or IIS Express is running under does not have permissions to create and write to the App_Data folder under the website root.

Workaround
Manually create an App_Data folder for the website. Then make sure that the Windows account that the application runs under (typically NETWORK SERVICE) has read/write permissions for root folders of the application and for subfolders such as App_Data. More detailed information is available in the KnowledgeBase article Problems with SQL Server Express user instancing and ASP.net Web Application Projects.

Issue: "Failed to generate a user instance of SQL Server" error

If a
WebMatrix Web application uses SQL Server Express and is running IIS 7.5 on Windows 7 or Windows Server 2008 R2, you might see an error that indicates that SQL Server cannot retrieve the user's local application path at run time.

Workaround
Make sure that the Windows account that the application runs under (typically NETWORK SERVICE) has read/write permissions for root folders of the application and for subfolders such as App_Data. More detailed information is available in the Knowledge Base article Problems with SQL Server Express user instancing and ASP.net Web Application Projects.

Issue: Files that contains package-manager resources or package-manager passwords are servable under IIS 6.0 and earlier

If you deploy an ASP.NET Web Pages (Razor) application that was built using the RC2 release, and if the application contains a password.txt or packagesources.txt file under /App_Data/admin, IIS 6.0 will serve the file if requested, potentially exposing the passwords for your package manager instance.

Workaround
Rename the password.txt or packagesources.txt file to password.config or packagesources.config. By default, IIS 6.0 does not serve files that have the .config extension. (In IIS 7, no files in the App_Data folder are served, so you do not need to rename the files.)

Issue: Uninstalling packages installed using the Beta 3 release does not completely remove package components

If you installed a package using the package manager in the Beta 3 release and then try to uninstall it using the current release, the package is not completely uninstalled. Using the package manager's Uninstall button removes some components, but leaves the package's library code and does not update the package.config file.

Workaround
Perform these steps:
1. Delete the App_Data\packages folder. This removes all packages.
2. Delete the packages.config file in the root of the website.

Issue: In Visual Studio, invoking the web-based package manager takes the application offline

If you are working in Visual Studio (not
WebMatrix) and use the _admin functionality to start the package manager, Visual Studio takes the application offline and posts the app_offline.htm into the website root, which disrupts your ability to use the package manager.

Note Although you would most typically see this behavior when using the web-based package manager interface, the same behavior occurs if you add, remove, or modify any files in the App_Data folder.

Workaround
To work with packages in Visual Studio, use the NuGet extension instead of the web-based package manager. For information, see the NuGet documentation. If you are working with other files in the App_Data folder, consider keeping the files elsewhere to avoid this issue. If that's not practical, delete the app_offline.htm file manually or wait until the site comes back online automatically (by default, after 30 seconds).

Issue: Visual Studio IntelliSense and project templates available only in ASP.NET MVC version 3

Installing ASP.NET Web Pages does not also install tools for Visual Studio such as IntelliSense and project templates for ASP.NET Web Pages applications.

Workaround
To use IntelliSense and project templates for ASP.NET Web Pages applications in Visual Studio, install ASP.NET MVC 3 RC either through the Web Platform Installer or the stand-alone installer.

Issue: Reading feeds or other external data via a proxy server

If the server running the site is behind a proxy server, you might need to configure proxy information in the web.config file in order to be able to read information that comes from outside your site. For example, if you use the ReCaptcha helper, the helper communicates with the reCAPTCHA service, but might be blocked by your proxy server. Similarly, feeds that are used in ASP.NET Web Pages, such as the feed used by the package manager, might require proxy configuration.

If you experience problems in working with an external service or working with the package feed, put the following elements into your application's root web.config file:
 

For more information about configuring a proxy server, see Element (Network Settings) on the MSDN Web site.

Issue: Uninstalling the .NET Framework version 4 disables ASP.NET Web Pages with Razor Syntax

If you uninstall the .NET Framework version 4 and then reinstall it, ASP.NET Web Pages with Razor syntax is disabled. Pages with the .cshtml extension do not run correctly. ASP.NET Web Pages registers an assembly in the machine root web.config file, and removing the .NET Framework removes that file. Reinstalling the .NET Framework installs a new version of the configuration file, but does not add the reference for the ASP.NET Web Pages assembly.

Workaround
After reinstalling the .NET Framework, reinstall ASP.NET Web Pages with Razor syntax. This adds the following element to the web.config file in the machine root, which is typically in the following location:
C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config (32-bit)
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Config (64-bit)

<-- Additional assemblies here. -->

Issue: Extensionless URLs do not find .cshtml/.vbhtml files on IIS 7 or IIS 7.5

On IIS 7 or IIS 7.5, requests with a URL like the following are not able to find pages that have the .cshtml or .vbhtml extension:
http://www.example.com/ExampleSite/ExampleFile
The issue arises because URL rewriting is not enabled by default for IIS 7 or IIS 7.5. The likeliest scenario is that you do not see the problem when testing locally using IIS Express, but you experience it when you deploy your website to a hosting website.

Workaround
* If you have control over the server computer, on the server computer install the update that is described in  

   A update is available that enables certain IIS 7.0 or IIS 7.5 handlers to handle requests whose URLs do 
   not end with a period.
* If you do not have control over the server computer (for example, you are deploying to a hosting website),  

   add the following to the website's web.config file:

Issue: Deploying an application to a computer that does not have SQL Server Compact installed

Applications that include SQL Server Compact databases can run on a computer where SQL Server Compact is not installed. Microsoft
WebMatrix1.0 automatically copies these binaries for you and performs the appropriate web.config file transforms.

Workaround
If you need to copy these files and make the web.config file changes manually, do the following:

1. Copy the database engine assemblies to the Bin folder (and subfolders) of the application on the target 

     computer:
    * Copy C:\Program Files\Microsoft SQL Server Edition\v4.0\Desktop\System.Data.SqlServerCe.dll
       to \Bin
    * Copy C:\Program Files\Microsoft SQL Server Compact Edition\v4.0\Private\x86\* to \Bin\x86
    * Copy C:\Program Files\Microsoft SQL Server Compact Edition\v4.0\Private\amd64\* to \Bin\amd64
2. In the root folder of the website, create or open a web.config file. (In WebMatrix 1.0, this file type is   

    available if you click All in the Choose a File Type dialog box.)
3. Add the following element as a child of the element (not inside the element):

Issue: "Database" and "WebGrid" helpers do not work in Medium Trust in Visual Basic

If you are using Visual Basic (creating .vbhtml files), the Database and WebGrid helpers will not work if the application is set to use Medium Trust.

Workaround
If you use Visual Studio 2010, you can resolve this problem by installing the Service Pack 1 release. Until the final version of the SP1 release is available, you can download the Beta version of SP1 from the Microsoft Visual Studio 2010 Service Pack 1 Beta page on the Microsoft Download Center.
If this is not practical, or if you do not use Visual Studio 2010, you can temporarily set the application to use Full Trust.

Issue: "ApplicationPart" resources are externally accessible

If an assembly contains objects that derives from the Application Part class, that assembly's resources are exposed by the ResourceRouteHandler class. For example, consider the following URL:
/r.ashx/System.Web.WebPages.Administration/Resources/AdminResources.resources
This request downloads all of the resource strings in the System.Web.WebPages.Administration.dll assembly. All of the embedded resources (even those that are not intended to be served as static content) are downloaded. If the embedded resources contain sensitive information, this can represent a security risk.

Workaround
If you create an Application Part object, make sure that the embedded resources associated with that Application Part object's assembly do not contain sensitive information.

WebMatrix
Note For information about installation issues for
WebMatrix, see WebMatrix Installation Issues earlier in this document.

This section of the document describes known issues for the
WebMatrix development environment.
Issue: Changes in the username or password of a database connection string in a web.config file are not reflected in the Databases workspace

Workaround
1. In the web.config file, change the database name in the connection string (for example, add "1" to it).
2. Save the web.config file.
3. Click Databases and refresh.
4. Change the database name in the connection string in the web.config file back to the original database name.
5. Save the web.config file.
6. Click Databases and refresh.

Issue: Folders created by
WebMatrix cannot be deleted

If
WebMatrix is running using elevated permissions (that is, you started WebMatrix using the Run as Administrator option in Windows), folders that are created by WebMatrix cannot be deleted using Windows Explorer.

Workaround
Run Windows Explorer using elevated permissions. Follow these steps:

1. In Windows, click Start.
2. Enter "Windows Explorer" and right-click the entry for Windows Explorer.
3. Click Run as Administrator. You can then delete the folders.

Issue:
WebMatrix 1.0 is unable to perform certain tasks that require elevation

WebMatrix 1.0 is unable to perform certain tasks that require elevation, such as installing additional components in the following situations:

  • On Windows Vista or Windows 7, you are logged in with an account that does not have administrative privileges and User Account Control (UAC) is disabled.You are using Microsoft Windows XP or Microsoft Windows Server 2003.

Workaround
Most tasks in
WebMatrix 1.0 do not require administrative permission. For those that do, you can perform the operation as an administrator, or follow these steps:
  • On Windows Vista or Windows 7, enable UAC.
  • On Windows XP, add the user to the Administrators security group.

Issue: "Site from Web Gallery" is disabled

The Site from Web Gallery option is disabled if the Web Platform Installer 3.0 is not installed.

Workaround
Install the Microsoft Web Platform Installer 3.0.

Issue: Google Chrome is not available as a Run option

Google Chrome is not displayed in the list of browsers under Run on the Home tab.

Workaround
Some versions of Google Chrome do not register themselves correctly with the Default Programs feature in Windows. As a workaround, start Google Chrome, click the Customize and control Google Chrome menu, click Options, and then click Make Google Chrome my default browser.

Issue: The "Foreign Key" dialog box doesn't allow entering a primary key

The Foreign Key dialog box does not allow you to enter the primary key name from the primary key table.

Workaround
This is intentional. You do not need to enter the name of the primary key from the primary key table.

Issue: IntelliSense is not available in WebMatrix for Razor syntax, C#, or Visual Basic

IntelliSense is supported in WebMatrix for HTML and CSS. However, it is not available for other languages.

Workaround
None.

Issue: IntelliSense for HTML and CSS suggests elements that are not contextually appropriate

IntelliSense for markup in
WebMatrix supports HTML using the XHTML 1.0 Transitional schema and CSS using the CSS 2.1 schema. Because IntelliSense is based on these specific schemas, certain tags, attributes, or properties might be suggested that are not appropriate for the current page or style definition. For HTML, it can also lead to unexpected suggestions in content that might be interpreted as malformed XHTML (for example, when tags are not closed). This issue might be more noticeable if the insertion point is inside an incomplete tag; in that case, IntelliSense might suggest new opening tags or offer other incorrect suggestions.

Workaround
For HTML, make sure that you are working within a well-formed, complete XHTML page. For CSS, there is no workaround.

Issue: IntelliSense is not invoked while you type

At times, IntelliSense might not be invoked as HTML or CSS is being entered in the editor. In particular, this might happen when the insertion point is directly next to another element or at the end of a file.

Workaround
Make sure that there is whitespace around the insertion point and that the insertion point is not at the end of a file. You can also invoke IntelliSense manually by pressing Ctrl+Space.

Issue: No UI is available for disabling IntelliSense

WebMatrix 1.0 provides no UI or gesture for disabling IntelliSense.

Workaround
Start
WebMatrix using the following command, which includes a switch that disables IntelliSense:
WebMatrix.exe #ExecuteCommand# EditorIntelliSense off


IIS Express

IIS Express has its own readme file, which is available at the following URL:

http://go.microsoft.com/fwlink/?LinkID=207675&clcid=0x409
SQL Server Compact

SQL Server Compact has its own readme file, which is available at the following URL:

http://go.microsoft.com/fwlink/?LinkID=208545

For information about issues that involve installing SQL Server Compact as part of
WebMatrix, see WebMatrix Installation Issues earlier in this document.

Installing Applications
Issue: Installing an application can take a long time if the user's My Documents folder is redirected to a network share

Workaround
None. The application might take a while to install, but will install correctly.

Publishing Applications
Issue: "Required permissions cannot be acquired" error when publishing a SQL Compact Database

WebMatrix does not fully support deploying supporting binaries for SQL Server Compact to a server that is running .NET Framework version 3.5 with a medium trust configuration.

Workaround
The preferred workaround is to install the .NET Framework 4 on the server. Alternatively, do the following:

1. Add the following elements to the SecurityClasses section in Web_MediumTrust.config file:

2. Create a new permission set in the Web_MediumTrust.config file with the following required permissions:

3. Apply the permission set to SQL Server Compact by putting the following elements in the 

    Web_MediumTrust.config file:

Issue: Gallery and PhpBB web applications display a "Service is unavailable" error after publishing

Under some circumstances, publishing an application causes a "service is unavailable" error.

Workaround
In WebMatrix, add a backslash (\) to the end of the server name in the Publish Settings window and then publish the application again.

Issue: Moodle website layout and links are broken after publishing

After you publish a Moodle application, the application does not work correctly.

Workaround
In WebMatrix, add a slash (/) to the end of the Site Name field in the Publish Settings window and then publish the application again.

Issue: Publishing nopCommerce fails with a database error

Publishing nopCommerce fails and reports a database error like "Insert into the nop_log table failed."

Workaround

1. In WebMatrix, click Run to launch nopCommerce locally.
2. Log into the administration page.
3. Click the System menu.
4. Click the Log option.
5. Click the Clear Log button.
6. Publish nopCommerce again.

Issue: Silverstripe CMS displays a "HTTP 500 PHP FCGI Error" when you download a published site

Workaround

After you click Download published site, skip silverstripe-cache/manifest_main in Publish Preview. This file is used for caching purposes and is specific to each computer.

Issue: Subtext displays "Server Error in '/' Application" when you download a published site

Workaround
Open the site's web.config file and replace the user ID and password in the database connection string with the SQL Server administrator credentials (the "sa" credentials).

Alternatively, follow these steps in order to give the user account you are logged in with db_owner permissions:

1. Install SQL Server Management Studio using the Web Platform Installer.
2. Connect to the local SQL Server Express instance (by default, .\SQLEXPRESS).
3. Click Databases > [localSubtextDatabase] > Security > Users > [localSubtextUser] (default is subtextuser], right-click, and click Properties.
4. Select db_owner in the role membership section.

Issue: Site might not work after publishing if the "Destination URL" field is not prefixed with http:// or https://

In the Publishing Settings dialog box, if the destination URL does not begin with http:// or https://, the site might not work after deployment.

Workaround
Make sure that before you publish a site, the destination URL in the Publish Settings dialog box starts with http:// or https://.

Issue: Publishing a MySQL database fails with the error "Failed to publish the database. This can happen if the remote database cannot run the script."

The error can occur for a number of reasons. One reason you can see this error is if the database script contains a single quotation character (') and the destination MySQL database's default character set is not to UTF-8.

Workaround
Set the default character set for the remote MySQL database to UTF-8.

Issue: Some links are not visible in DotNetNuke after publishing or downloading the site

If you publish or download a DotNetNuke site, you might need to clear the cache to get the new links to appear on the site.

Workaround
1. Log in as "Host".
2. Go to the host menu and select Host Settings.
3. Scroll down and under Advanced Settings, expand Performance Settings.
4. Click the Clear Cache link for pages.
5. Go to the bottom of the page and restart the application.

Issue: Some links in AtomSite are broken after you download a published site

Workaround
In the service.config file, users.config file, and all .xml files, replace the URL string (for example, http://myhost.com/atomsite) with the local one (for example, http://localhost:1239).

Issue: MySQL-based applications like WordPress fail to publish and report a database error

By default, WebMatrix installs MySQL with the UTF-8 character set. If you install MySQL on your own, and the character set is not UTF-8 (for example, it is Latin1), the publish process for databases might fail.

Workaround
1. Change the character set for MySQL to UTF-8. (For details, see Server Character Set and Collation 

    on  the MySQL website.)
2. Reinstall the application.
3. Republish the application.

Issue: "Download published site" fails for applications that have browser-based setup

Some applications (for example, Kentico CMS) require you to launch them in the browser in order to perform post-installation setup such as creating a database. If you publish an application like this without completing the browser-based setup, attempting to download the same site from a remote server will fail.

Workaround
Finish browser-based setup before publishing the site.

Issue: "Download published site" fails with a database error for DotNetNuke and Kooboo CMS

If you try to download an application from a server and you have administrator credentials in the database connection string in the Publish Settings dialog, you might see the following error in the publish log:

1:28:29 PM: An error occurred during execution of the database script. The approximate location of the error was between lines '3260' and '3262' of the script. The verbose log may have more information about the error. The command started with:
1:28:29 PM: CREATE LOGIN [MACHINE\Administrator] FROM WINDOW
1:28:29 PM: http://go.microsoft.com/fwlink/?LinkId=178587.

Workaround
If practical, republish the site (or have it published) using non-administrator credentials for the database.

Monday, February 2, 2004

WebMatrix and ASP.NET



WebMatrix and ASP.NET

Microsoft WebMatrix Beta is a free web development stack that installs in minutes. It integrates a web server with database and programming frameworks to create a single, integrated experience. You can use WebMatrix Beta to streamline the way you code, test, and publish your own ASP.NET or PHP website, or you can use WebMatrix Beta to start a new website using popular open-source apps like DotNetNuke, Umbraco, WordPress, or Joomla. WebMatrix Beta uses the same powerful web server, database engine, and frameworks environment that will run your website on the internet, which makes the transition from development to production smooth and seamless.

Installation

To install WebMatrix Beta 3, you use Microsoft Web Platform Installer 3.0. After you've installed the Web Platform Installer, you can use it to install WebMatrix Beta 3.

If you have problems during installation, refer to Troubleshooting Problems with Microsoft Web Platform Installer.

Instructions for Publishing Applications

See Step-by-Step Instructions for Publishing Applications

New Features, Changes, and Known Issues
WebMatrix Beta 3 Installation
Issue: WebMatrix Beta 3 is only available on platforms that support Microsoft .NET Framework 4

The .NET Framework version 4 is required for WebMatrix Beta. In certain cases, the WebMatrix Beta installer will let you try to install on a platform that is not part of the supported configuration set. In particular, Windows Vista without the SP1 update will let you begin the installation of WebMatrix Beta, but the .NET Framework 4 component will fail and block your installation.

Workaround
Install on a supported platform, which includes:

  •  Windows 7
  •  Windows Server 2008
  •  Windows Server 2008 R2
  •  Windows Vista SP1 or later
  •  Windows XP SP3
  •  Windows Server 2003 SP2

Issue: Cannot install WebMatrix Beta 3 if Microsoft Visual Studio 2008 is installed without Microsoft Visual Studio 2008 SP1

Workaround
Install Microsoft Visual Studio 2008 SP1 from the Microsoft Download Center.

Issue: Some assemblies for SQL Server Compact 4.0 are not installed in the GAC

The managed assemblies for SQL Server Compact 4.0 are not placed in the global assembly cache (GAC) when you install SQL Server Compact 4.0 on a 64-bit computer and the computer has only the .NET Framework 3.5 SP1 Client Profile installed. The managed assemblies that are not installed in the GAC are:
  • System.Data.SqlServerCe.dll (ADO.NET provider)
  • System.Data.SqlServerCe.Entity.dll (ADO.NET Entity Framework )

Workaround
Uninstall SQL Server Compact 4.0. Download and install the full version of .NET Framework 3.5 SP1 from the following location:
Microsoft .NET Framework 3.5 Service pack 1 (Full Package)
Then reinstall SQL Server Compact 4.0.

Issue: Cannot uninstall SQL Server Compact using the command line

Uninstallation of SQL Server Compact using command-line options does not work in this release.

Workaround
Use Programs and Features in the Windows Control Panel to uninstall Microsoft SQL Server Compact 4.0.

ASP.NET Web Pages

This section of the document describes new features, changes, and known issues with the Beta 3 release of ASP.NET Web Pages with Razor syntax.

  • New features
  • Changes
  • Issues

New Features in Beta 3 for ASP.NET Web Pages with Razor Syntax
New: "Html.Raw" method renders unencoded markup

The new Html.Raw method lets you render HTML markup as markup instead of rendering encoded output. (By default, ASP.NET Razor encodes strings before rendering them.) The syntax is:

Html.Raw(value)

The following example shows how to use Html.Raw:

@* Inserts literal markup into the page as specified in the value string. *@
@Html.Raw("
Hello world!
")

Changes in Beta 3 for ASP.NET Web Pages with Razor Syntax
Change: "HrefAttribute" method removed

The HrefAttribute method of the WebPage class has been removed. This helper was used to encode unsafe characters in URLs. It is no longer required because ASP.NET Razor automatically encodes strings. (Use the new Html.Raw method to render unencoded strings.)

Change: Syntax for declarative "@helper" helpers changed

In the Beta 3 release, ASP.NET changes how it parses helpers that are created using the@helper syntax. In essence, the @helper syntax is now parsed as a code block instead of as a block of markup that can include code. Therefore, code inside the helper does not need to be enclosed in @{ } blocks. Conversely, markup inside the helper has to be explicitly included in HTML elements or in ASP.NET Razor tags.

For example, the following @helper syntax works in the Beta 3 release:

@helper ThumbnailLink(string imagePath, int width, int height) {
@{
string newFileName = "";
WebImage thumbnail = new WebImage(imagePath);
if(thumbnail != null){
thumbnail.Resize(width, height, true, true);
newFileName = @"~\thumb_" + Path.GetFileName(thumbnail.FileName);
thumbnail.Save(newFileName);
}
}

}

In the Beta 3 release, this helper must be changed to look like the following example:

@helper ThumbnailLink(string imagePath, int width, int height) {
string newFileName = "";
WebImage thumbnail = new WebImage(imagePath);
if(thumbnail != null){
thumbnail.Resize(width, height, true, true);
newFileName = @"~\thumb_" + Path.GetFileName(thumbnail.FileName);
thumbnail.Save(newFileName);
}

}

Notice that the @{ } characters around the initial code in the helper is no longer used. This is because the contents of the helpers are treated as a code block by default. The helper renders markup, which starts with the opening tag. If the helper must render plain text or tags that do not include a closing tag (for example, tags), the content to be rendered must be in tags.

Change: "WebMatrixContext.HttpContext" removed

The WebMatrixContext.HttpContext property has been removed. UseHttpContext.Current instead. (The WebMatrixContext.HttpContext property simply wrapped this.)

Change: "Facebook" helper moved to new package

The Facebook helper has been moved to the Facebook.Helper library, which includes the Facebook helper and additional functionality. You must install this library as a separate package, as described in "Installing Helpers with Package Manager" in the tutorial Getting Started with ASP.NET Pages.

Change: Membership, Role, and Security types moves to new assembly

The following types were moved to the WebMatrix.WebData assembly:

  •  ExtendedMembershipProvider
  •  SimpleMembershipProvider
  •  SimpleRoleProvider
  •  WebSecurity

Change: "TagBuilder" class moved to System.Web.WebMatrix.dll assembly

The TagBuilder class has been moved to the System.Web.WebMatrix.dll assembly. Previously, this was in an assembly that was part of ASP.NET MVC. This change means that you do not have to install ASP.NET MVC in order to use the TagBuilder class.

However, the class is still in the System.Web.Mvc namespace. In order to use the TagBuilderclass (for example, in a custom ASP.NET Razor helper), you must reference the namespace (for example, by adding @using System.Web.Mvc to your code).

Change: Request validation syntax changed; "Validation" class removed

In the Beta 3 release, to disable validation for an individual field or set of fields, you can call theValidation.Exclude method, passing in the name or names of the fields to exclude from validation. A new syntax is available in the Beta 3 release for bypassing validation. TheValidation method used in Beta 3 has been removed.

Note If you do not disable request validation, if users try to upload HTML markup (for example, by using a rich text editor on a page), the website will report an error like A potentially dangerous Request.Form value was detected from the client and the user input is not accepted. If you disable request validation, you must manually check user input to make sure that it does not contain potentially dangerous markup or script using something like the Microsoft Anti-Cross Site Scripting Library V4.0.

To disable automatic request validation, call the Request.Unvalidated method, passing it the name of the field or other post object that you want to bypass request validation for. You can use this method to bypass validation for any items in the Form, Query String, Cookies, and Server Variables collections. The following examples show how to use the Unvalidated method:

Request["userInput"]; // Validated
Request.Unvalidated("userInput"); // Validation bypassed
Request.Unvalidated().Form["userInput"]; // Validation bypassed

Request.QueryString["userPreference"]; // Validated
Request.Unvalidated().QueryString["userPreference"]; // Validation bypassed

Known Issues for ASP.NET Web Pages with Razor Syntax
Issue: Unexpected behavior when using a custom user table for membership

To initialize the membership provider for an ASP.NET Razor website, you call theWebMatrix. Initialize Database Connection method. (In WebMatrix, the Starter Site template includes a call to this method in the _AppStart.cshtml file.) If the auto Create Tables parameter of this method is set to true (by default, it is set to true in the Starter Site template), and if an unrecognized table name is passed to the method (the second parameter), the method does not throw an error. Instead, it automatically creates the table.

This can be a problem if you intend to use a custom user table for membership but pass the wrong table name to the WebSecurity.Initialize Database Connection method. Because the method does not by default raise an error if the table you specify does not exist, and because it instead creates a new table, the application can appear to be working. However, application code that relies on your custom user table (and on fields in it) can eventually fail with unexpected errors.

Workaround
Make sure that the name passed in the Initialize Database Connection method matches the user profile table in the membership database, or make sure that the auto Create Tables parameter is set to false.

Issue: "Failed to generate a user instance of SQL Server" error

If a WebMatrix Web application uses SQL Server Express and is running IIS 7.5 on Windows 7 or Windows Server 2008 R2, you might see an error that indicates that SQL Server cannot retrieve the user's local application path at run time.

Workaround
Make sure that the Windows account that the application runs under (typically NETWORK SERVICE) has read/write permissions for root folders of the application and for subfolders such asApp_Data. More detailed information is available in the Knowledge Base article Problems with SQL Server Express user instancing and ASP.net Web Application Projects.

Issue: In Visual Studio, namespaces for custom assemblies (DLLs) are not imported automatically

If you use custom assemblies in a project in Visual Studio, the namespaces declared in those assemblies are not automatically imported at design time. As a result, references to custom types might not be recognized at design time and are marked as not recognized in Visual Studio (using a "squiggle"). This problem occurs only at design time in Visual Studio; the application itself runs properly.

Workaround
Include a using statement (imports in Visual Basic) that references the entities that are not recognized at design time.

Issue: Visual Studio IntelliSense and project templates available only in ASP.NET MVC version 3

Installing ASP.NET Web Pages does not also install tools for Visual Studio such as IntelliSense and project templates for ASP.NET Web Pages applications.


Workaround
To use IntelliSense and project templates for ASP.NET Web Pages applications in Visual Studio, install ASP.NET MVC 3 RC either through the Web Platform Installer or the stand-alone installer.

Issue: " class cannot be found" error

After you upgrade to Beta 3, you might see an error that a helper class (for example, theFacebook class) cannot not be found. Starting in Beta 2 and continuing in Beta 3, helpers have been moved to packages that you must explicitly install. Existing sites are not upgraded to include these packages; this includes sites in the \My Documents\IISExpress or \My Documents\My Web Sites folders. In particular, you will see this error if you use the default site in My Sites(WebSite1), which includes a reference to the Twitter helper.

Workaround
Comment out calls to any helpers in the site, run the _Admin page, and install the package or packages that include the helpers that you want to use. (For details, see New: Package support added for ASP.NET Web Pages later in this document.) After you've installed the package, you can uncomment the lines that reference helpers.

Issue: Deploying Beta 3 ASP.NET Razor assemblies to the Bin folder might not work on hosting sites

If you deploy an ASP.NET Web Pages website to a hosting site, and if you deploy the ASP.NET Razor Beta 3 assemblies to the site's Bin folder, you might experience errors, including the following:

Could not load type 'Microsoft.Web.Infrastructure.DynamicModuleHelper.DynamicModuleUtility' from assembly 'Microsoft.Web.Infrastructure, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.

This can happen if the hosting provider has installed the ASP.NET Web Pages Beta 1 assemblies into the server's global application cache (GAC). Assemblies in the GAC get precedence over assemblies installed locally in the Bin folder.

Workaround Contact your hosting provider to confirm that the errors you are seeing are due to a conflict between the provider's versions of the assemblies and yours. If so, request that the hosting provider update the assemblies in the server's GAC.

Issue: Reading feeds or other external data via a proxy server

If the server running the site is behind a proxy server, you might need to configure proxy information in the Web.config file in order to be able to read information that comes from outside your site. For example, if you use the ReCaptcha helper, the helper communicates with the reCAPTCHA service, but might be blocked by your proxy server. Similarly, feeds that are used in ASP.NET Web Pages, such as the feed used by the package manager, might require proxy configuration.

If you experience problems in working with an external service or working with the package feed, put the following elements into your application's root Web.config file:


For more information about configuring a proxy server, see Element (Network Settings)on the MSDN Web site.

Issue: "Microsoft.Web.Infrastructure.dll cannot be loaded" error

If you previously installed the Beta 1 version of ASP.NET Web Pages with Razor syntax and then install the Beta 3 version, all appropriate assemblies are installed in the GAC exceptMicrosoft.Web.Infrastructure.dll. As a consequence, when you run ASP.NET Razor pages, you see an error that indicates that Microsoft.Web.Infrastructure.dll could not be loaded.

This issue does not occur if you loaded the Beta 3 release on a clean computer.

Workaround
In Control Panel, uninstall ASP.NET Web Pages. Then reinstall the Beta 3 release.

Issue: Uninstalling the .NET Framework version 4 disables ASP.NET Web Pages with Razor Syntax

If you uninstall the .NET Framework version 4 and then reinstall it, ASP.NET Web Pages with Razor syntax is disabled. Pages with the .cshtml extension do not run correctly. ASP.NET Web Pages registers an assembly in the machine root Web.config file, and removing the .NET Framework removes that file. Reinstalling the .NET Framework installs a new version of the configuration file, but does not add the reference for the ASP.NET Web Pages assembly.

Workaround After reinstalling the .NET Framework, reinstall ASP.NET Web Pages with Razor syntax. This adds the following element to the Web.config file in the machine root, which is typically in the following location:
C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config (32-bit)
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Config (64-bit)


<-- Additional assemblies here. -->


Issue: Applications previously deployed with ASP.NET assemblies in the Bin folder experience errors

During deployment, copies of the ASP.NET Web Pages assemblies (for example,Microsoft.WebPages.dll) to the Bin folder of the website on the server. (This might have happened automatically during deployment or because the developer explicitly copied the assemblies.) However, when the Beta 3 release is installed, errors occurs, such as errors that certain types cannot be found. This occurs because a number of ASP.NET Web Pages types were moved into different namespaces for the Beta 3 release.

Workaround
Clear the Bin folder of the deployed application, copy the new assemblies to the folder (or redeploy the application), and then restart the application.

Issue: Extensionless URLs do not find .cshtml/.vbhtml files on IIS 7 or IIS 7.5

On IIS 7 or IIS 7.5, requests with a URL like the following are not able to find pages that have the.cshtml or .vbhtml extension:
http://www.example.com/ExampleSite/ExampleFile
The issue arises because URL rewriting is not enabled by default for IIS 7 or IIS 7.5. The likeliest scenario is that you do not see the problem when testing locally using IIS Express, but you experience it when you deploy your website to a hosting website.


Workaround

  • If you have control over the server computer, on the server computer install the update that is described in A update is available that enables certain IIS 7.0 or IIS 7.5 handlers to handle requests whose URLs do not end with a period.
  • If you do not have control over the server computer (for example, you are deploying to a hosting website), add the following to the website's Web.config file:

Issue: Using Web Application Project or ASP.NET MVC and ASP.NET Web pages in the same application

If you were using ASP.NET Web Pages in a Web Application project or ASP.NET MVC application, you might see an error that WebPage Http Application cannot be found.

Workaround
If you get this error, change the base class from which the application derives. In the Global.asaxfile, change the following line:

public class MvcApplication : WebPageHttpApplication { ... }

To this:

public class MvcApplication : HttpApplication { ... }

This in effect reverses a change that was introduced for the Beta 1 release of ASP.NET Web Pages with Razor syntax.

Issue: Deploying an application to a computer that does not have SQL Server Compact installed

Applications that include SQL Server Compact databases can run on a computer where SQL Server Compact is not installed. Microsoft WebMatrix Beta 3 automatically copies these binaries for you and performs the appropriate Web.config file transforms.

Workaround
If you need to copy these files and make the Web.config file changes manually, do the following :

1. Copy the database engine assemblies to the Bin folder (and subfolders) of the application on the target
    computer:
    Copy C:\Program Files\Microsoft SQL Server Compact Edition\v4.0\Desktop
    \System.Data.SqlServerCe.dll to \Bin
    Copy C:\Program Files\Microsoft SQL Server Compact Edition\v4.0\Private\x86\* to\Bin\x86
    Copy C:\Program Files\Microsoft SQL Server Compact Edition\v4.0\Private\amd64\*to \Bin\amd64
2. In the root folder of the website, create or open a Web.config file. (In WebMatrix Beta 3, this file type is
    available if you click All in the Choose a File Type dialog box.)
3. Add the following element as a child of the element (not inside the element):


Issue: Database and WebGrid helpers do not work in Medium Trust in Visual Basic

If you are using Visual Basic (creating .vbhtml files), the Database and WebGrid helpers will not work if the application is set to use Medium Trust.

Workaround
Temporarily set the application to use Full Trust.

SQL Server Compact
Issue: "Encrypt" property is not recognized

SQL Server Compact 4.0 does not recognize the Encrypt property of the SqlCeConnection class. You should not use this property to encrypt database files. The Encrypt property was deprecated in SQL Server Compact 3.5 release and was retained only for backward compatibility.

Workaround
Use the Encryption Mode property of the SqlCeConnection class to encrypt SQL Server Compact 4.0 database files. The following example shows how to create an encrypted SQL Server Compact 4.0 database using the Encryption Mode property:

C#

SqlCeEngine engine = new SqlCeEngine("Data Source=Northwind.sdf;encryption mode=platform default;Password=;");
engine.CreateDatabase();

Visual Basic

Dim engine As SqlCeEngine = New SqlCeEngine("Data Source=Northwind.sdf;encryption mode=platform default;Password=;")
engine.CreateDatabase()

To change the encryption mode of an existing SQL Server Compact 4.0 database, do the following:

C#

SqlCeEngine engine = new SqlCeEngine("Data Source=Northwind.sdf;Password=;");
engine.Compact("Data Source=Northwind.sdf;encryption mode=ppc2003 compatibility;Password=;");

Visual Basic

Dim engine As SqlCeEngine = New SqlCeEngine("Data Source=Northwind.sdf;Password=;")
engine.Compact("Data Source=Northwind.sdf;encryption mode=ppc2003 compatibility;Password=;")

To encrypt an unencrypted SQL Server Compact 4.0 database, do the following:

C#

SqlCeEngine engine = new SqlCeEngine("Data Source=Northwind.sdf");
engine.Compact("Data Source=Northwind.sdf;encryption mode=platform default;Password=;");

Visual Basic

Dim engine As SqlCeEngine = New SqlCeEngine("Data Source=Northwind.sdf;")
engine.Compact("Data Source=Northwind.sdf;encryption mode=platform default;Password=;")

Issue: Microsoft Visual C++ 2008 runtime libraries are required

The native DLLs of SQL Server Compact 4.0 need the Microsoft Visual C++ 2008 Runtime Libraries (x86, IA64, and x64), Service Pack 1.

Workaround
Install the .NET Framework 3.5 SP1. This also installs the Visual C++ 2008 Runtime Libraries SP1. You can download the libraries from the following location:
Microsoft Visual C++ 2008 Service Pack 1 Redistributable Package ATL Security Update

Note that installing the .NET Framework 2.0, 3.0, or 4 does not install the Visual C++ 2008 Runtime Libraries SP1.

Issue: If SQL Server Compact is installed prior to installing .NET Framework on the computer, its provider invariant name is not registered in the .NET Framework machine.config file

SQL Server Compact can be installed on a machine that does not have .NET Framework installed because SQL Server Compact does require the .NET framework. If neither .NET Framework version 3.5 nor 4 is installed before you install SQL Server Compact, the SQL Server Compact Setup does not register its provider invariant name in the machine.config file. Any application that relies on the SQL Server Compact entry in the machine.config file will fail. The invariant name registration entry in machine.config looks like the following example:


Workaround
Uninstall SQL Server Compact 4.0 CTP1. Download and install the full versions of the .NET Framework from the following location:

Microsoft .NET Framework 3.5 Service pack 1 (Full Package)
Microsoft .NET Framework 4.0 Release (Full Package)

Then reinstall SQL Server Compact 4.0 CTP1.

Installing Applications
Issue: Installing an application can take a long time if the user's My Documents folder is redirected to a network share

Workaround
None. The application might take a while to install, but will install correctly.

Publishing Applications
Issue: Site might not work after publishing if the "Destination URL" field is not prefixed with http:// or https://

In the Publishing Settings dialog box, if the destination URL does not begin with http:// orhttps://, the site might not work after deployment.

Workaround
Make sure that before you publish a site, the destination URL in the Publish Settings dialog box starts with http:// or https://.

Issue: Publishing a MySQL database fails with the error "Failed to publish the database. This can happen if the remote database cannot run the script."

The error can occur for a number of reasons. One reason you can see this error is if the database script contains a single quotation character (') and the destination MySQL database's default character set is not to UTF-8.

Workaround
Set the default character set for the remote MySQL database to UTF-8.

Other Issues
Issue: Search/Filter does not work in Reports for Group By: Issue Type

When you run a report for a site, if you enter text in the Filter by URL box and click Search, nothing happens. This is because this control is not functional while the Group By state of the report is set to Issue Type, which is the default.

Workaround
In the Group By tab of ribbon, click URL to group the entries by their source URL. The text box and button to filter the entries are functional while in this state.

Issue: WCF applications fail to run with IIS Express

Browsing to a WCF application results in an error like the following one:

Could not load file or assembly 'Microsoft.Web.Administration, Version=7.0.0.0, Culture=neutral,PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.

This occurs because IIS Express Beta release doesn’t support WCF by default.

Workaround
Use any one of the following workarounds (workaround #2 requires Microsoft Windows Vista or higher):

1. Copy the Microsoft.Web.dll and Microsoft.Web.Administration.dll assemblies from the WebMatrix
     installation location to the bin directory of the WCF application. By default, WebMatrix is installed in the
     Microsoft WebMatrix subfolder under the system's Program Files folder.

2.  On Microsoft Windows Vista or higher, create a symlink to the assemblies in the bindirectory using the
     following commands. (This approach has the advantage that it does not create a copy of the assemblies.)
     mklink Microsoft.Web.Administration.dll "c:\Program Files (x86)\Microsoft
     WebMatrix\Microsoft.Web.Administration.dll"
      mklink Microsoft.Web.dll "c:\Program Files (x86)\Microsoft WebMatrix\Microsoft.Web.dll"

3.   Install the two assemblies in the GAC. From an elevated prompt, run the following commands:

gacutil /i "c:\Program Files (x86)\Microsoft WebMatrix\Microsoft.Web.Administration.dll"
gacutil /i "c:\Program Files (x86)\Microsoft WebMatrix\Microsoft.Web.dll"

Issue: WebMatrix Beta 3 is unable to perform certain tasks that require elevation

WebMatrix Beta 3 is unable to perform certain tasks that require elevation, such as installing additional components in the following situations:

  • On Windows Vista or Windows 7, you are logged in with an account that does not have administrative privileges and User Account Control (UAC) is disabled.
  • You are using Microsoft Windows XP or Microsoft Windows Server 2003.

Workaround
Most tasks in WebMatrix Beta 3 do not require administrative permission. For those that do, you can perform the operation as an administrator, or follow these steps:
  • On Windows Vista or Windows 7, enable UAC.
  • On Windows XP, add the user to the Administrators security group.

Issue: "Site from Web Gallery" is disabled

The Site from Web Gallery option is disabled if the Web Platform Installer 3.0 is not installed.

Workaround
Install the Microsoft Web Platform Installer 3.0.

Issue: On Windows Server 2003, IIS Express does not start for a non-administrative user

On Windows Server 2003, when you launch a page or start IIS Express, IIS Express does not start. For Web pages, an error is displayed that indicates that the application has been started by a non-administrative user.

Workaround
Start WebMatrix Beta 3 as an administrative user. For more details, see the following KnowledgeBase article:
An application that is started by a non-administrative user cannot listen to the HTTP traffic of the computer on which the application is running in Windows Vista, Windows Server 2003, or Windows XP.

Issue: Google Chrome is not available as a Run option

Google Chrome is not displayed in the list of browsers under Run on the Home tab.

Workaround
Some versions of Google Chrome do not register themselves correctly with the Default Programs feature in Windows. As a workaround, start Google Chrome, click the Customize and control Google Chrome menu, click Options, and then click Make Google Chrome my default browser.

Issue: The "Foreign Key" dialog box doesn't allow entering a primary key

The Foreign Key dialog box does not allow you to enter the primary key name from the primary key table.

Workaround
This is intentional. You do not need to enter the name of the primary key from the primary key table.

Issue: The "Relationships" button is disabled

The Relationships button under the Table tab in the Databases workspace is disabled for SQL Server Compact databases.

Workaround
None. SQL Server Compact does not support relationships between tables.

Issue: Parameterized SQL queries throw exceptions

In SQL Server Compact 4.0, if you do not specify a data type such as SqlDbType or DbType for parameters in parameterized queries, an exception is thrown when the query runs.

Workaround
Explicitly set the data type for parameters such as SqlDbType or DbType. This is critical in the case of BLOB data types (image and ntext). Use code like the following:

C#

SqlCeEngine engine = new SqlCeEngine(connString);
engine.CreateDatabase();
engine.Dispose();
SqlCeConnection conn = new SqlCeConnection(connString);
conn.Open();
SqlCeCommand cmd = conn.CreateCommand();
cmd.CommandText = "CREATE TABLE BlobTable(name nvarchar(128), blob ntext);";
cmd.ExecuteNonQuery();
cmd.CommandText = "INSERT INTO BlobTable(name, blob) VALUES (@name, @blob);";
SqlCeParameter paramName = cmd.Parameters.Add("name", SqlDbType.NVarChar, 128);
SqlCeParameter paramBlob = cmd.Parameters.Add("blob", SqlDbType.NText);
paramName.Value = "Name1";
paramBlob.Value = "Name1".PadLeft(4001);
cmd.ExecuteNonQuery();

Visual Basic

Dim engine As SqlCeEngine = New SqlCeEngine(connString)
engine.CreateDatabase()
engine.Dispose()
Dim conn As SqlCeConnection = New SqlCeConnection(connString)
conn.Open()
Dim cmd As SqlCeCommand = conn.CreateCommand()
cmd.CommandText = "CREATE TABLE BlobTable(name nvarchar(128), blob ntext);"
cmd.ExecuteNonQuery()
cmd.CommandText = "INSERT INTO BlobTable(name, blob) VALUES (@name, @blob);"
Dim paramName As SqlCeParameter
Dim paramBlob As SqlCeParameterparamName = cmd.Parameters.Add("name", SqlDbType.NVarChar, 128)
paramName.Value = "Name1"
paramBlob = cmd.Parameters.Add("blob", SqlDbType.NText)
paramBlob.Value = "Name1".PadLeft(4001)
cmd.ExecuteNonQuery()

Twitter Delicious Facebook Digg Stumbleupon Favorites More