Update Runtime versions to 5.0/3.0

This commit is contained in:
phenning 2013-02-08 14:23:53 -08:00
Родитель 8d409f2151
Коммит 7a359a9e0b
10 изменённых файлов: 46 добавлений и 52 удалений

Просмотреть файл

@ -1,11 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<repositories>
<repository path="..\src\Microsoft.AspNet.Mvc.Facebook\packages.config" />
<repository path="..\src\Microsoft.Web.Http.Data.EntityFramework\packages.config" />
<repository path="..\src\Microsoft.Web.Http.Data.Helpers\packages.config" />
<repository path="..\src\Microsoft.Web.Http.Data\packages.config" />
<repository path="..\src\Microsoft.Web.WebPages.OAuth\packages.config" />
<repository path="..\src\System.Net.Http.Formatting.NetCore\packages.config" />
<repository path="..\src\System.Net.Http.Formatting\packages.config" />
<repository path="..\src\System.Web.Http.OData\packages.config" />
<repository path="..\src\System.Web.Http.SelfHost\packages.config" />
@ -22,8 +18,6 @@
<repository path="..\test\Microsoft.AspNet.Mvc.Facebook.Test\packages.config" />
<repository path="..\test\Microsoft.TestCommon\packages.config" />
<repository path="..\test\Microsoft.Web.Helpers.Test\packages.config" />
<repository path="..\test\Microsoft.Web.Http.Data.Helpers.Test\packages.config" />
<repository path="..\test\Microsoft.Web.Http.Data.Test\packages.config" />
<repository path="..\test\Microsoft.Web.Mvc.Test\packages.config" />
<repository path="..\test\Microsoft.Web.WebPages.OAuth.Test\packages.config" />
<repository path="..\test\System.Net.Http.Formatting.Test\packages.config" />

Просмотреть файл

@ -22,12 +22,12 @@ using System.Runtime.InteropServices;
#if ASPNETMVC && ASPNETWEBPAGES
#error Runtime projects cannot define both ASPNETMVC and ASPNETWEBPAGES
#elif ASPNETMVC
[assembly: AssemblyVersion("4.1.0.0")] // ASPNETMVC
[assembly: AssemblyFileVersion("4.1.0.0")] // ASPNETMVC
[assembly: AssemblyVersion("5.0.0.0")] // ASPNETMVC
[assembly: AssemblyFileVersion("5.0.0.0")] // ASPNETMVC
[assembly: AssemblyProduct("Microsoft ASP.NET MVC")]
#elif ASPNETWEBPAGES
[assembly: AssemblyVersion("2.1.0.0")] // ASPNETWEBPAGES
[assembly: AssemblyFileVersion("2.1.0.0")] // ASPNETWEBPAGES
[assembly: AssemblyVersion("3.0.0.0")] // ASPNETWEBPAGES
[assembly: AssemblyFileVersion("3.0.0.0")] // ASPNETWEBPAGES
[assembly: AssemblyProduct("Microsoft ASP.NET Web Pages")]
#else
#error Runtime projects must define either ASPNETMVC or ASPNETWEBPAGES

Просмотреть файл

@ -19,6 +19,6 @@ Imports System.Runtime.InteropServices
' Version numbers are automatically generated based on regular expressions.
' ===========================================================================
<Assembly: AssemblyVersion("4.1.0.0")> 'ASPNETMVC
<Assembly: AssemblyFileVersion("4.1.0.0")> 'ASPNETMVC
<Assembly: AssemblyVersion("5.0.0.0")> 'ASPNETMVC
<Assembly: AssemblyFileVersion("5.0.0.0")> 'ASPNETMVC
<Assembly: AssemblyProduct("Microsoft ASP.NET MVC")>

Просмотреть файл

@ -9,7 +9,7 @@ namespace System.Web.Mvc.Test
{
public static ISetup<HttpContextBase> ExpectMvcVersionResponseHeader(this Mock<HttpContextBase> mock)
{
return mock.Setup(r => r.Response.AppendHeader(MvcHandler.MvcVersionHeaderName, "4.1"));
return mock.Setup(r => r.Response.AppendHeader(MvcHandler.MvcVersionHeaderName, "5.0"));
}
}
}

Просмотреть файл

@ -18,7 +18,7 @@ namespace System.Web.WebPages.Deployment.Test
var assemblies = new[]
{
new AssemblyName("System.Web.WebPages.Deployment, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"),
new AssemblyName("System.Web.WebPages.Deployment, Version=2.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"),
new AssemblyName("System.Web.WebPages.Deployment, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"),
new AssemblyName("System.Web.WebPages.Deployment, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35")
};
@ -26,7 +26,7 @@ namespace System.Web.WebPages.Deployment.Test
var maxVersion = AssemblyUtils.GetMaxWebPagesVersion(assemblies);
// Assert
Assert.Equal(new Version("2.1.0.0"), maxVersion);
Assert.Equal(new Version("3.0.0.0"), maxVersion);
}
[Fact]
@ -39,14 +39,14 @@ namespace System.Web.WebPages.Deployment.Test
new AssemblyName("System.Web.WebPages.Development, Version=2.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"),
new AssemblyName("System.Web.WebPages.Deployment, Version=2.2.0.0, Culture=neutral, PublicKeyToken=7777777777777777"),
new AssemblyName("System.Web.WebPages.Deployment, Version=2.3.0.0, Culture=en-US, PublicKeyToken=31bf3856ad364e35"),
new AssemblyName("System.Web.WebPages.Deployment, Version=2.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35")
new AssemblyName("System.Web.WebPages.Deployment, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35")
};
// Act
var maxVersion = AssemblyUtils.GetMaxWebPagesVersion(assemblies);
// Assert
Assert.Equal(new Version("2.1.0.0"), maxVersion);
Assert.Equal(new Version("3.0.0.0"), maxVersion);
}
[Fact]
@ -86,13 +86,13 @@ namespace System.Web.WebPages.Deployment.Test
var binDirectory = @"X:\test\project";
TestFileSystem fileSystem = new TestFileSystem();
fileSystem.AddFile(Path.Combine(binDirectory, "System.Web.WebPages.Deployment.dll"));
Func<string, AssemblyName> getAssembyName = _ => new AssemblyName("System.Web.WebPages.Deployment, Version=2.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35");
Func<string, AssemblyName> getAssembyName = _ => new AssemblyName("System.Web.WebPages.Deployment, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35");
// Act
var binVersion = AssemblyUtils.GetVersionFromBin(binDirectory, fileSystem, getAssembyName);
// Assert
Assert.Equal(new Version("2.1.0.0"), binVersion);
Assert.Equal(new Version("3.0.0.0"), binVersion);
}
[Fact]
@ -159,17 +159,17 @@ namespace System.Web.WebPages.Deployment.Test
var expectedAssemblies = new[]
{
"Microsoft.Web.Infrastructure, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35",
"System.Web.Razor, Version=2.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35",
"System.Web.Helpers, Version=2.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35",
"System.Web.WebPages, Version=2.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35",
"System.Web.WebPages.Administration, Version=2.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35",
"System.Web.WebPages.Razor, Version=2.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35",
"WebMatrix.Data, Version=2.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35",
"WebMatrix.WebData, Version=2.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35",
"System.Web.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35",
"System.Web.Helpers, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35",
"System.Web.WebPages, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35",
"System.Web.WebPages.Administration, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35",
"System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35",
"WebMatrix.Data, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35",
"WebMatrix.WebData, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35",
};
// Act
var assemblies = AssemblyUtils.GetAssembliesForVersion(new Version("2.1.0.0"))
var assemblies = AssemblyUtils.GetAssembliesForVersion(new Version("3.0.0.0"))
.Select(c => c.ToString())
.ToArray();

Просмотреть файл

@ -46,7 +46,7 @@ namespace System.Web.WebPages.Deployment.Test
// Arrange
Version loadedVersion = null;
bool registeredForChangeNotification = false;
IEnumerable<AssemblyName> loadedAssemblies = GetAssemblies("1.12.123.1234", "2.1.0.0");
IEnumerable<AssemblyName> loadedAssemblies = GetAssemblies("1.12.123.1234", "3.0.0.0");
Version webPagesVersion = new Version("1.12.123.1234");
var fileSystem = new TestFileSystem();
@ -73,7 +73,7 @@ namespace System.Web.WebPages.Deployment.Test
Version loadedVersion = null;
bool registeredForChangeNotification = false;
Version webPagesVersion = AssemblyUtils.ThisAssemblyName.Version;
IEnumerable<AssemblyName> loadedAssemblies = GetAssemblies("2.1.0.0");
IEnumerable<AssemblyName> loadedAssemblies = GetAssemblies("3.0.0.0");
var fileSystem = new TestFileSystem();
var buildManager = new TestBuildManager();
@ -97,7 +97,7 @@ namespace System.Web.WebPages.Deployment.Test
// Arrange
Version loadedVersion = null;
bool registeredForChangeNotification = false;
IEnumerable<AssemblyName> loadedAssemblies = GetAssemblies("2.1.0.0");
IEnumerable<AssemblyName> loadedAssemblies = GetAssemblies("3.0.0.0");
var fileSystem = new TestFileSystem();
var buildManager = new TestBuildManager();
@ -122,7 +122,7 @@ namespace System.Web.WebPages.Deployment.Test
Version loadedVersion = null;
bool registeredForChangeNotification = false;
var v1Version = new Version("1.0.0.0");
IEnumerable<AssemblyName> loadedAssemblies = GetAssemblies("1.0.0.0", "2.1.0.0");
IEnumerable<AssemblyName> loadedAssemblies = GetAssemblies("1.0.0.0", "3.0.0.0");
var binDirectory = DeploymentUtil.GetBinDirectory();
@ -151,7 +151,7 @@ namespace System.Web.WebPages.Deployment.Test
Version loadedVersion = null;
bool registeredForChangeNotification = false;
var v1Version = new Version("1.0.0.0");
IEnumerable<AssemblyName> loadedAssemblies = GetAssemblies("1.0.0.0", "2.1.0.0");
IEnumerable<AssemblyName> loadedAssemblies = GetAssemblies("1.0.0.0", "3.0.0.0");
var binDirectory = DeploymentUtil.GetBinDirectory();
@ -212,7 +212,7 @@ namespace System.Web.WebPages.Deployment.Test
bool registeredForChangeNotification = false;
var webPagesVersion = AssemblyUtils.ThisAssemblyName.Version;
var v1Version = new Version("1.0.0.0");
IEnumerable<AssemblyName> loadedAssemblies = GetAssemblies("1.0.0.0", "2.1.0.0");
IEnumerable<AssemblyName> loadedAssemblies = GetAssemblies("1.0.0.0", "3.0.0.0");
// Note: For this test to work with future versions we would need to create corresponding embedded resources with that version in it.
var fileSystem = new TestFileSystem();
@ -239,7 +239,7 @@ namespace System.Web.WebPages.Deployment.Test
Version loadedVersion = null;
bool registeredForChangeNotification = false;
var webPagesVersion = AssemblyUtils.ThisAssemblyName.Version;
IEnumerable<AssemblyName> loadedAssemblies = GetAssemblies("2.1.0.0");
IEnumerable<AssemblyName> loadedAssemblies = GetAssemblies("3.0.0.0");
// Note: For this test to work with future versions we would need to create corresponding embedded resources with that version in it.
var fileSystem = new TestFileSystem();
@ -265,7 +265,7 @@ In order to use this site, specify a version in the sites web.config file. Fo
// Arrange
Version loadedVersion = null;
bool registeredForChangeNotification = false;
IEnumerable<AssemblyName> loadedAssemblies = GetAssemblies("2.1.0.0", "8.0.0.0");
IEnumerable<AssemblyName> loadedAssemblies = GetAssemblies("3.0.0.0", "8.0.0.0");
var binDirectory = DeploymentUtil.GetBinDirectory();
@ -296,7 +296,7 @@ In order to use this site, specify a version in the sites web.config file. Fo
bool registeredForChangeNotification = false;
// Hopefully we'd have figured out a better way to load Plan9 by v8.
var webPagesVersion = new Version("8.0.0.0");
IEnumerable<AssemblyName> loadedAssemblies = GetAssemblies("1.0.0.0", "2.1.0.0", "8.0.0.0");
IEnumerable<AssemblyName> loadedAssemblies = GetAssemblies("1.0.0.0", "3.0.0.0", "8.0.0.0");
var fileSystem = new TestFileSystem();
fileSystem.AddFile("Index.cshtml");
@ -321,7 +321,7 @@ In order to use this site, specify a version in the sites web.config file. Fo
// Arrange
Version loadedVersion = null;
bool registeredForChangeNotification = false;
IEnumerable<AssemblyName> loadedAssemblies = GetAssemblies("2.1.0.0");
IEnumerable<AssemblyName> loadedAssemblies = GetAssemblies("3.0.0.0");
var fileSystem = new TestFileSystem();
fileSystem.AddFile("Index.cshtml");
@ -329,7 +329,7 @@ In order to use this site, specify a version in the sites web.config file. Fo
var content = "1.0.0.0" + Environment.NewLine;
buildManager.Stream = new MemoryStream(Encoding.Default.GetBytes(content));
var nameValueCollection = GetAppSettings(enabled: null, webPagesVersion: new Version("2.1.0.0"));
var nameValueCollection = GetAppSettings(enabled: null, webPagesVersion: new Version("3.0.0.0"));
Action<Version> loadWebPages = (version) => { loadedVersion = version; };
Action registerForChange = () => { registeredForChangeNotification = true; };
@ -342,7 +342,7 @@ In order to use this site, specify a version in the sites web.config file. Fo
Assert.Equal("Changes were detected in the Web Pages runtime version that require your application to be recompiled. Refresh your browser window to continue.", ex.Message);
Assert.Equal(ex.Data["WebPages.VersionChange"], true);
Assert.False(registeredForChangeNotification);
VerifyVersionFile(buildManager, new Version("2.1.0.0"));
VerifyVersionFile(buildManager, new Version("3.0.0.0"));
Assert.True(fileSystem.FileExists(@"site\bin\WebPagesRecompilation.deleteme"));
}
@ -352,7 +352,7 @@ In order to use this site, specify a version in the sites web.config file. Fo
// Arrange
Version loadedVersion = null;
bool registeredForChangeNotification = false;
IEnumerable<AssemblyName> loadedAssemblies = GetAssemblies("2.1.0.0", "5.0.0.0");
IEnumerable<AssemblyName> loadedAssemblies = GetAssemblies("3.0.0.0", "5.0.0.0");
var fileSystem = new TestFileSystem();
fileSystem.AddFile("Index.cshtml");
@ -380,7 +380,7 @@ In order to use this site, specify a version in the sites web.config file. Fo
// Arrange
Version loadedVersion = null;
bool registeredForChangeNotification = false;
IEnumerable<AssemblyName> loadedAssemblies = GetAssemblies("1.0.0.0", "2.1.0.0");
IEnumerable<AssemblyName> loadedAssemblies = GetAssemblies("1.0.0.0", "3.0.0.0");
var binDirectory = DeploymentUtil.GetBinDirectory();
@ -391,7 +391,7 @@ In order to use this site, specify a version in the sites web.config file. Fo
var content = AssemblyUtils.ThisAssemblyName.Version + Environment.NewLine;
buildManager.Stream = new MemoryStream(Encoding.Default.GetBytes(content));
var nameValueCollection = GetAppSettings(enabled: null, webPagesVersion: new Version("2.1.0"));
var nameValueCollection = GetAppSettings(enabled: null, webPagesVersion: new Version("3.0.0"));
Action<Version> loadWebPages = (version) => { loadedVersion = version; };
Action registerForChange = () => { registeredForChangeNotification = true; };
Func<string, AssemblyName> getAssembyName = _ => new AssemblyName("System.Web.WebPages.Deployment, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35");
@ -399,7 +399,7 @@ In order to use this site, specify a version in the sites web.config file. Fo
// Act and Assert
Assert.Throws<InvalidOperationException>(() =>
PreApplicationStartCode.StartCore(fileSystem, "", binDirectory, nameValueCollection, loadedAssemblies, buildManager, loadWebPages, registerForChange, getAssembyName),
@"Conflicting versions of ASP.NET Web Pages detected: specified version is ""2.1.0.0"", but the version in bin is ""1.0.0.0"". To continue, remove files from the application's bin directory or remove the version specification in web.config."
@"Conflicting versions of ASP.NET Web Pages detected: specified version is ""3.0.0.0"", but the version in bin is ""1.0.0.0"". To continue, remove files from the application's bin directory or remove the version specification in web.config."
);
Assert.False(registeredForChangeNotification);

Просмотреть файл

@ -291,18 +291,18 @@ namespace System.Web.WebPages.Deployment.Test
public void ObsoleteGetVersionReturnsVersionFromConfigIfDisabled()
{
// Arrange
var maxVersion = new Version("2.1.3.4");
var maxVersion = new Version("3.0.3.4");
var fileSystem = new TestFileSystem();
var configuration = new NameValueCollection();
configuration["webPages:Enabled"] = "False";
configuration["webPages:Version"] = "2.0";
configuration["webPages:Version"] = "3.0";
var path = "blah";
// Act
var version = WebPagesDeployment.GetObsoleteVersionInternal(path, configuration, fileSystem);
// Assert
Assert.Equal(new Version("2.0.0.0"), version);
Assert.Equal(new Version("3.0.0.0"), version);
}
private static string GetTempPath()

Просмотреть файл

@ -1,9 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<sectionGroup name="system.web.webPages.razor" type="System.Web.WebPages.Razor.Configuration.RazorWebSectionGroup, System.Web.WebPages.Razor, Version=2.1.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
<section name="host" type="System.Web.WebPages.Razor.Configuration.HostSection, System.Web.WebPages.Razor, Version=2.1.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" />
<section name="pages" type="System.Web.WebPages.Razor.Configuration.RazorPagesSection, System.Web.WebPages.Razor, Version=2.1.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" />
<sectionGroup name="system.web.webPages.razor" type="System.Web.WebPages.Razor.Configuration.RazorWebSectionGroup, System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
<section name="host" type="System.Web.WebPages.Razor.Configuration.HostSection, System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" />
<section name="pages" type="System.Web.WebPages.Razor.Configuration.RazorPagesSection, System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" />
</sectionGroup>
</configSections>
<system.web.webPages.razor>

Просмотреть файл

@ -11,7 +11,7 @@
<dependentAssembly>
<!-- Need this because the BinarySerializer uses the TypeForwardedFrom attribute and deserializes to the original assembly (MVC 2.0) for the HttpAntiForgeryException test -->
<assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0-4.1.0.0" newVersion="4.1.0.0" />
<bindingRedirect oldVersion="1.0.0.0-5.0.0.0" newVersion="5.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>

Просмотреть файл

@ -120,7 +120,7 @@ namespace System.Web.WebPages.Test
webPageHttpHandler.ProcessRequestInternal(context.Object);
// Assert
Assert.Equal("2.1", headers[WebPageHttpHandler.WebPagesVersionHeaderName]);
Assert.Equal("3.0", headers[WebPageHttpHandler.WebPagesVersionHeaderName]);
Assert.Equal("=?UTF-8?B?fi9pbmRleC5jc2h0bWx8fi9MYXlvdXQuY3NodG1s?=", headers["X-SourceFiles"]);
}
@ -178,7 +178,7 @@ namespace System.Web.WebPages.Test
public void VersionHeaderTest()
{
Mock<HttpResponseBase> mockResponse = new Mock<HttpResponseBase>();
mockResponse.Setup(response => response.AppendHeader("X-AspNetWebPages-Version", "2.1")).Verifiable();
mockResponse.Setup(response => response.AppendHeader("X-AspNetWebPages-Version", "3.0")).Verifiable();
Mock<HttpContextBase> mockContext = new Mock<HttpContextBase>();
mockContext.SetupGet(context => context.Response).Returns(mockResponse.Object);