You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add ContosoUniversity Web Forms sample with local setup
Add the ContosoUniversity ASP.NET Web Forms sample project as a reference
application for BWFC migration testing. Includes:
- Full Web Forms source (5 pages: Home, About, Students, Courses, Instructors)
- Connection strings updated from SQLEXPRESS to LocalDB
- AjaxControlToolkit HintPath fixed to use NuGet packages folder
- Empty Directory.Build.props to block repo-root NBGV inheritance
- Screenshots of all 5 pages running on IIS Express
- Setup guide documenting prerequisites and reproduction steps
Controls observed: GridView, DetailsView, DropDownList, AutoCompleteExtender,
Master Page navigation menu. Database uses EF6 Database-First (.edmx).
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
> **Note:** MSBuild from VS 2017 BuildTools (v15.0) lacks `Microsoft.WebApplication.targets` and cannot build this project. Use MSBuild from Visual Studio 18 Insiders (or any VS edition that includes web workloads).
16
+
17
+
## Step-by-Step Reproduction
18
+
19
+
### 1. Start LocalDB and Attach the Database
20
+
21
+
```powershell
22
+
sqllocaldb start MSSQLLocalDB
23
+
24
+
sqlcmd -S "(localdb)\MSSQLLocalDB" -Q "
25
+
CREATE DATABASE ContosoUniversity
26
+
ON (FILENAME = 'D:\BlazorWebFormsComponents\samples\ContosoUniversity\ContosoUniversity\App_Data\ContosoUniversity.mdf')
27
+
FOR ATTACH_REBUILD_LOG;
28
+
"
29
+
```
30
+
31
+
The `.mdf` ships from an older SQL Server version (internal version 782). LocalDB auto-upgrades it to version 998 and creates a new log file.
|`instructors.png`| Instructors.aspx |**GridView** (7 instructors with sortable columns) |
83
+
84
+
## Issues Encountered & Fixes
85
+
86
+
### 1. Duplicate AssemblyVersion Attributes
87
+
88
+
**Problem:** The repo-root `Directory.Build.props` injects `Nerdbank.GitVersioning 3.9.50` into all projects. For this legacy .NET Framework 4.5.2 project with a manual `AssemblyInfo.cs`, the auto-generated attributes conflict with the hand-coded ones.
89
+
90
+
**Fix:** Created an empty `samples/ContosoUniversity/Directory.Build.props` to block inheritance from the repo root.
91
+
92
+
### 2. Missing AjaxControlToolkit Assembly
93
+
94
+
**Problem:** The `.csproj` HintPath pointed to a non-existent `Documents\ASP.NET AJAX Control Toolkit\` folder.
95
+
96
+
**Fix:** Installed `AjaxControlToolkit 16.1.1` via NuGet and updated the HintPath in the `.csproj` to `packages\AjaxControlToolkit.16.1.1.0\lib\net40\AjaxControlToolkit.dll`.
97
+
98
+
### 3. Connection String Update
99
+
100
+
**Problem:** Original `Web.config` connection strings referenced `.\SQLEXPRESS`, which is not available on the build machine.
101
+
102
+
**Fix:** Updated both connection strings (`SchoolContext` and `DefaultConnection`) to use `(localdb)\MSSQLLocalDB`.
103
+
104
+
### 4. Database Version Upgrade
105
+
106
+
**Problem:** The shipped `.mdf` is from an older SQL Server version (internal version 782). The original `.ldf` log file was not included.
107
+
108
+
**Fix:** Used `FOR ATTACH_REBUILD_LOG` which upgrades the data file and creates a fresh log file automatically.
<AddPattern="(YottaaMonitor|BrowserMob|HttpMonitor|YandexBot|BingPreview|PagePeeker|ThumbShotsBot|WebThumb|URL2PNG|ZooShot|GomezA|Catchpoint bot|Willow Internet Crawler|Google SketchUp|Read%20Later|KTXN|Pingdom|AlwaysOn)"/>
0 commit comments