diff --git a/Blazor.sln b/Blazor.Core.sln similarity index 82% rename from Blazor.sln rename to Blazor.Core.sln index 880f0e0a..2b9202f3 100644 --- a/Blazor.sln +++ b/Blazor.Core.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 15 -VisualStudioVersion = 15.0.26430.6 +VisualStudioVersion = 15.0.26711.1 MinimumVisualStudioVersion = 10.0.40219.1 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{202CAAE3-4937-4BE3-96E8-C16BF9C216F6}" ProjectSection(SolutionItems) = preProject @@ -25,12 +25,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "DNA", "DNA", "{0FCBC715-108 EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "corlib", "src\DNA\corlib\corlib.csproj", "{C8506C7D-2026-46A6-80CB-7AC11A19F053}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "template", "template", "{EAD66C22-40EE-43C6-B0C3-B1A6B13DD5A3}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MyApplication", "template\MyApplication\MyApplication.csproj", "{C2B140E5-384F-4304-8870-0E3D4682A846}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Blazor.VSExtension", "src\Blazor.VSExtension\Blazor.VSExtension.csproj", "{315CDAF0-09E2-46B6-BF9A-600E9E987F05}" -EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "samples", "samples", "{B5DFF11D-B4B8-4727-90C8-66F5B6C9574B}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ClientServerApp", "ClientServerApp", "{D3E21340-9A52-4849-915D-3E04891C3C53}" @@ -78,18 +72,6 @@ Global {C8506C7D-2026-46A6-80CB-7AC11A19F053}.LocalTest|Any CPU.Build.0 = Release|Any CPU {C8506C7D-2026-46A6-80CB-7AC11A19F053}.Release|Any CPU.ActiveCfg = Release|Any CPU {C8506C7D-2026-46A6-80CB-7AC11A19F053}.Release|Any CPU.Build.0 = Release|Any CPU - {C2B140E5-384F-4304-8870-0E3D4682A846}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {C2B140E5-384F-4304-8870-0E3D4682A846}.Debug|Any CPU.Build.0 = Debug|Any CPU - {C2B140E5-384F-4304-8870-0E3D4682A846}.LocalTest|Any CPU.ActiveCfg = Debug|Any CPU - {C2B140E5-384F-4304-8870-0E3D4682A846}.LocalTest|Any CPU.Build.0 = Debug|Any CPU - {C2B140E5-384F-4304-8870-0E3D4682A846}.Release|Any CPU.ActiveCfg = Release|Any CPU - {C2B140E5-384F-4304-8870-0E3D4682A846}.Release|Any CPU.Build.0 = Release|Any CPU - {315CDAF0-09E2-46B6-BF9A-600E9E987F05}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {315CDAF0-09E2-46B6-BF9A-600E9E987F05}.Debug|Any CPU.Build.0 = Debug|Any CPU - {315CDAF0-09E2-46B6-BF9A-600E9E987F05}.LocalTest|Any CPU.ActiveCfg = Release|Any CPU - {315CDAF0-09E2-46B6-BF9A-600E9E987F05}.LocalTest|Any CPU.Build.0 = Release|Any CPU - {315CDAF0-09E2-46B6-BF9A-600E9E987F05}.Release|Any CPU.ActiveCfg = Release|Any CPU - {315CDAF0-09E2-46B6-BF9A-600E9E987F05}.Release|Any CPU.Build.0 = Release|Any CPU {110A0EC6-44C1-4C73-BE9C-E2E7EDE6611A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {110A0EC6-44C1-4C73-BE9C-E2E7EDE6611A}.Debug|Any CPU.Build.0 = Debug|Any CPU {110A0EC6-44C1-4C73-BE9C-E2E7EDE6611A}.LocalTest|Any CPU.ActiveCfg = Debug|Any CPU @@ -119,11 +101,12 @@ Global {7BACABC2-CDF1-4ACA-8C6F-2A94A8E61DC0} = {2FB55188-2625-4A89-8642-83C18FA2A362} {0FCBC715-108E-49BA-A5C6-CF21D22874B1} = {2FB55188-2625-4A89-8642-83C18FA2A362} {C8506C7D-2026-46A6-80CB-7AC11A19F053} = {0FCBC715-108E-49BA-A5C6-CF21D22874B1} - {C2B140E5-384F-4304-8870-0E3D4682A846} = {EAD66C22-40EE-43C6-B0C3-B1A6B13DD5A3} - {315CDAF0-09E2-46B6-BF9A-600E9E987F05} = {2FB55188-2625-4A89-8642-83C18FA2A362} {D3E21340-9A52-4849-915D-3E04891C3C53} = {B5DFF11D-B4B8-4727-90C8-66F5B6C9574B} {110A0EC6-44C1-4C73-BE9C-E2E7EDE6611A} = {D3E21340-9A52-4849-915D-3E04891C3C53} {DA6D77C9-F101-45C0-A4CD-634F87D3A1DF} = {D3E21340-9A52-4849-915D-3E04891C3C53} {AAC0A945-F535-4716-AB73-4D193FA08844} = {D3E21340-9A52-4849-915D-3E04891C3C53} EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {70729D6F-492C-4E7C-8C0F-D3D0EA7544AB} + EndGlobalSection EndGlobal diff --git a/Blazor.ProjectTemplate.sln b/Blazor.ProjectTemplate.sln new file mode 100644 index 00000000..16177ccf --- /dev/null +++ b/Blazor.ProjectTemplate.sln @@ -0,0 +1,36 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 15 +VisualStudioVersion = 15.0.26711.1 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Blazor.VSExtension", "template\Blazor.VSExtension\Blazor.VSExtension.csproj", "{315CDAF0-09E2-46B6-BF9A-600E9E987F05}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MyApplication", "template\MyApplication\MyApplication.csproj", "{49C6A338-C946-42D1-A2C7-A1436679313E}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "SolutionItems", "SolutionItems", "{B84AADE3-D82B-4E03-9C39-6D882E59D69D}" + ProjectSection(SolutionItems) = preProject + build-vsextension.cmd = build-vsextension.cmd + EndProjectSection +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {315CDAF0-09E2-46B6-BF9A-600E9E987F05}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {315CDAF0-09E2-46B6-BF9A-600E9E987F05}.Debug|Any CPU.Build.0 = Debug|Any CPU + {315CDAF0-09E2-46B6-BF9A-600E9E987F05}.Release|Any CPU.ActiveCfg = Release|Any CPU + {315CDAF0-09E2-46B6-BF9A-600E9E987F05}.Release|Any CPU.Build.0 = Release|Any CPU + {49C6A338-C946-42D1-A2C7-A1436679313E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {49C6A338-C946-42D1-A2C7-A1436679313E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {49C6A338-C946-42D1-A2C7-A1436679313E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {49C6A338-C946-42D1-A2C7-A1436679313E}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {58DF0713-610A-47A0-951A-C8D9C24722A8} + EndGlobalSection +EndGlobal diff --git a/NuGet.config b/NuGet.config index 9626d6fe..7bb1b165 100644 --- a/NuGet.config +++ b/NuGet.config @@ -3,8 +3,6 @@ - - diff --git a/README.md b/README.md index aa5b6d3b..21f2b074 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ The programming model will be familiar to anyone who's worked with Razor (the C# ## Getting started -**VS2017 users**: Install [the VS extension](https://github.com/SteveSanderson/Blazor/releases/download/v0.2.0/Blazor.VSExtension.vsix), then use *File->New project*, and choose *Blazor Application* from the *Web* category. +**VS2017 users**: Install [the VS extension](https://github.com/SteveSanderson/Blazor/releases/download/v0.2.1/Blazor.VSExtension.vsix), then use *File->New project*, and choose *Blazor Application* from the *Web* category. To start the application in VS, just press F5 or Ctrl+F5 as usual. diff --git a/build-packages.cmd b/build-packages.cmd index 4872d40f..3a94f7f1 100644 --- a/build-packages.cmd +++ b/build-packages.cmd @@ -1,39 +1,12 @@ @echo off -@rem -- Restoring/building corlib first because of this issue: https://github.com/Microsoft/msbuild/issues/2065 -@rem -- -@rem -- Other projects have to be built in a specific order, because they mostly consume each other via package -@rem -- references rather than project references. This is necessary because regular project references aren't -@rem -- included transitively for things shipped as packages (i.e., it's not clear what the .NET Core MSBuild -@rem -- equivalent to IncludeReferencedProjects is), and also because the template app can only obtain the -@rem -- dotnet custom tool and MSBuild targets by consuming the framework projects as actual packages. -@rem -- -@rem -- Unfortunately this also means that whenever you edit and rebuild a framework project, you have to manually -@rem -- "dotnet restore" in any other projects that consume it. -for %%s in ( - "src\DNA\corlib" - "src\AngleSharp" - "src\Blazor.Runtime" - "src\Blazor.Compiler" - "src\Blazor.Host" - "template\MyApplication" - "samples\ClientServerApp\ClientServerApp.Shared" - "samples\ClientServerApp\ClientServerApp.Client" - "samples\ClientServerApp\ClientServerApp.Server" -) do ( - dotnet restore %%s - if ERRORLEVEL 1 goto :fail - - dotnet build %%s - if ERRORLEVEL 1 goto :fail -) - -:done -@echo --- -@echo Build succeeded -@exit /b 0 - -:fail -@echo --- -@echo Build failed -@exit /b %ERRORLEVEL% +setlocal +for /f %%a in ('wmic os get LocalDateTime ^| findstr \.') do set tmp=%%a +set timestamp=%tmp:~0,14% +endlocal & set versionsuffix=t-%timestamp% + +echo Building packages with version suffix %versionsuffix%... +dotnet build --no-restore ^ + src\Blazor.Host\Blazor.Host.csproj ^ + /property:GeneratePackageOnBuild=true ^ + /property:VersionSuffix=%versionsuffix% diff --git a/build-vsextension.cmd b/build-vsextension.cmd index 65735f9a..1bc686b9 100644 --- a/build-vsextension.cmd +++ b/build-vsextension.cmd @@ -4,15 +4,15 @@ rem It's important to clean the template dir first, otherwise we'll include thin git clean -xdf .\template rem Restore NuGet packages for SideWaffle so it can build the template -build\nuget.exe restore src\Blazor.VSExtension\ -SolutionDirectory . +build\nuget.exe restore template\Blazor.VSExtension\ -SolutionDirectory . rem Replace launchSettings.json (which VS keeps editing) with sw-launchSettings.json (which remains clean) rem Note that file whose name starts "sw-" are automatically omitted from the project template copy /y .\template\MyApplication\Properties\sw-launchSettings.json .\template\MyApplication\Properties\launchSettings.json rem Actually build the VSIX -SET msbuildExePath="C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin\MSBuild.exe" -%msbuildExePath% src\Blazor.VSExtension\Blazor.VSExtension.csproj +SET msbuildExePath="C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\15.0\Bin\MSBuild.exe" +%msbuildExePath% template\Blazor.VSExtension\Blazor.VSExtension.csproj rem Move launchSettings.json back to clean state git checkout .\template\MyApplication\Properties\launchSettings.json \ No newline at end of file diff --git a/global.json b/global.json deleted file mode 100644 index f992be3d..00000000 --- a/global.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "sdk": { - "version": "1.0.4" - } -} \ No newline at end of file diff --git a/samples/ClientServerApp/ClientServerApp.Client/ClientServerApp.Client.csproj b/samples/ClientServerApp/ClientServerApp.Client/ClientServerApp.Client.csproj index 6344bfeb..c8703a60 100644 --- a/samples/ClientServerApp/ClientServerApp.Client/ClientServerApp.Client.csproj +++ b/samples/ClientServerApp/ClientServerApp.Client/ClientServerApp.Client.csproj @@ -3,10 +3,8 @@ netcoreapp1.0 exe - - - + \ No newline at end of file diff --git a/samples/ClientServerApp/ClientServerApp.Server/ClientServerApp.Server.csproj b/samples/ClientServerApp/ClientServerApp.Server/ClientServerApp.Server.csproj index c7aad703..ce6b72db 100644 --- a/samples/ClientServerApp/ClientServerApp.Server/ClientServerApp.Server.csproj +++ b/samples/ClientServerApp/ClientServerApp.Server/ClientServerApp.Server.csproj @@ -1,22 +1,19 @@  - netcoreapp1.0 + netcoreapp2.0 - - $(PackageTargetFallback);portable-net45+win8+wp8+wpa81; - - - - - - - - + + + + + + + false diff --git a/src/AngleSharp/AngleSharp.Core.csproj b/src/AngleSharp/AngleSharp.Core.csproj index 9f57b11c..560888d6 100644 --- a/src/AngleSharp/AngleSharp.Core.csproj +++ b/src/AngleSharp/AngleSharp.Core.csproj @@ -7,9 +7,7 @@ AngleSharp AngleSharp netstandard1.3 - Blazor.AngleSharp - true $(MSBuildThisFileDirectory)../../artifacts/ - - false - - @@ -30,10 +21,14 @@ - - - - + + + + + + false + + \ No newline at end of file diff --git a/src/Blazor.Host/Host/Prerendering.cs b/src/Blazor.Host/Host/Prerendering.cs index 810db5f3..09f93423 100644 --- a/src/Blazor.Host/Host/Prerendering.cs +++ b/src/Blazor.Host/Host/Prerendering.cs @@ -5,7 +5,6 @@ using Blazor.Components; using Blazor.Routing; using Blazor.VirtualDom; -using MiniJSON; using System.Collections.Generic; using System; using System.Runtime.Loader; @@ -13,7 +12,6 @@ using Blazor.Sdk.Host; using Blazor.Runtime.Components; using Microsoft.AspNetCore.Http; -using System.Diagnostics; namespace Blazor.Host { @@ -28,7 +26,7 @@ internal static class Prerendering internal static void EnablePrerendering(string clientBinDir, string assemblyName) { var clientAppAssemblyPath = Path.Combine(clientBinDir, assemblyName); - var entrypointAssembly = AssemblyLoadContext.Default.LoadFromAssemblyPath(clientAppAssemblyPath); + var entrypointAssembly = LoadAssemblyFromPath(clientAppAssemblyPath); var entrypoint = entrypointAssembly.EntryPoint; entrypoint.Invoke(null, new[] { new string[0] }); var envField = typeof(Blazor.Runtime.Env) @@ -211,5 +209,15 @@ private static Assembly GetCompiledViewsAssembly(string rootPath, string appAsse return AssemblyLoadContext.Default.LoadFromStream(ms); } } + + private static Assembly LoadAssemblyFromPath(string path) + { + // Load from stream to avoid locking the file on disk + // Unfortunately that also prevents debugging into this assembly + using (var fs = File.OpenRead(path)) + { + return AssemblyLoadContext.Default.LoadFromStream(fs); + } + } } } diff --git a/src/Blazor.Runtime/Blazor.Runtime.csproj b/src/Blazor.Runtime/Blazor.Runtime.csproj index 56f7c68f..23fad3e5 100644 --- a/src/Blazor.Runtime/Blazor.Runtime.csproj +++ b/src/Blazor.Runtime/Blazor.Runtime.csproj @@ -4,8 +4,6 @@ Library netstandard1.3 - - true $(MSBuildThisFileDirectory)../../artifacts/ \ No newline at end of file diff --git a/src/DNA/corlib/System.Reflection/MethodInfo.cs b/src/DNA/corlib/System.Reflection/MethodInfo.cs index 29c437c9..83877eb7 100644 --- a/src/DNA/corlib/System.Reflection/MethodInfo.cs +++ b/src/DNA/corlib/System.Reflection/MethodInfo.cs @@ -8,9 +8,11 @@ public abstract class MethodInfo : MethodBase public abstract class MethodBase : MemberInfo { +#pragma warning disable 0169, 0649 private readonly Type _ownerType; private readonly string _name; private readonly IntPtr _methodDef; +#pragma warning restore 0169, 0649 public override string Name => _name; diff --git a/src/DNA/corlib/System.Reflection/PropertyInfo.cs b/src/DNA/corlib/System.Reflection/PropertyInfo.cs index 06f7540e..f3c764ab 100644 --- a/src/DNA/corlib/System.Reflection/PropertyInfo.cs +++ b/src/DNA/corlib/System.Reflection/PropertyInfo.cs @@ -2,9 +2,11 @@ { public abstract class PropertyInfo : MemberInfo { +#pragma warning disable 0649 private readonly Type _ownerType; private readonly string _name; private readonly Type _propertyType; +#pragma warning restore 0649 public override string Name => _name; diff --git a/src/DNA/corlib/System.Threading/Thread.cs b/src/DNA/corlib/System.Threading/Thread.cs index e2524dc9..57c04aab 100644 --- a/src/DNA/corlib/System.Threading/Thread.cs +++ b/src/DNA/corlib/System.Threading/Thread.cs @@ -27,11 +27,11 @@ namespace System.Threading { public sealed class Thread { // These member vars MUST be synced with C code. -#pragma warning disable 0169, 0649 +#pragma warning disable 0169, 0414, 0649 private int managedThreadID = 0; private MulticastDelegate threadStart = null; -#pragma warning restore 0169, 0649 - private object param = null; +#pragma warning restore 0169, 0414, 0649 + private object param = null; private ThreadState threadState = ThreadState.Unstarted; private CultureInfo currentCulture; diff --git a/src/DNA/corlib/System/Boolean.cs b/src/DNA/corlib/System/Boolean.cs index 99ce00d8..56edc562 100644 --- a/src/DNA/corlib/System/Boolean.cs +++ b/src/DNA/corlib/System/Boolean.cs @@ -26,9 +26,11 @@ public struct Boolean : IComparable, IComparable, IEquatable { public static readonly string TrueString = "True"; public static readonly string FalseString = "False"; - internal bool m_value; +#pragma warning disable 0649 + internal bool m_value; +#pragma warning disable 0649 - public override string ToString() { + public override string ToString() { return this.m_value ? TrueString : FalseString; } diff --git a/src/DNA/corlib/System/Char.cs b/src/DNA/corlib/System/Char.cs index 5e3c8651..cfab4af3 100644 --- a/src/DNA/corlib/System/Char.cs +++ b/src/DNA/corlib/System/Char.cs @@ -38,10 +38,11 @@ public struct Char : IComparable, IComparable, IEquatable { (char) 0x2006, (char) 0x2007, (char) 0x2008, (char) 0x2009, (char) 0x200A, (char) 0x200B, (char) 0x3000, (char) 0xFEFF }; +#pragma warning disable 0649 + internal char m_value; +#pragma warning restore 0649 - internal char m_value; - - public override string ToString() { + public override string ToString() { return new string(m_value, 1); } diff --git a/src/DNA/corlib/System/Int64.cs b/src/DNA/corlib/System/Int64.cs index 93ca8782..068f9a05 100644 --- a/src/DNA/corlib/System/Int64.cs +++ b/src/DNA/corlib/System/Int64.cs @@ -27,9 +27,11 @@ public struct Int64 : IFormattable, IComparable, IComparable, IEquatabletrue false true + 0 \ No newline at end of file diff --git a/src/Blazor.VSExtension/Blazor.VSExtension.csproj b/template/Blazor.VSExtension/Blazor.VSExtension.csproj similarity index 98% rename from src/Blazor.VSExtension/Blazor.VSExtension.csproj rename to template/Blazor.VSExtension/Blazor.VSExtension.csproj index db12a850..e121da65 100644 --- a/src/Blazor.VSExtension/Blazor.VSExtension.csproj +++ b/template/Blazor.VSExtension/Blazor.VSExtension.csproj @@ -58,7 +58,7 @@ - ../../template/MyApplication/MyApplication.csproj + ../MyApplication/MyApplication.csproj diff --git a/src/Blazor.VSExtension/Properties/AssemblyInfo.cs b/template/Blazor.VSExtension/Properties/AssemblyInfo.cs similarity index 100% rename from src/Blazor.VSExtension/Properties/AssemblyInfo.cs rename to template/Blazor.VSExtension/Properties/AssemblyInfo.cs diff --git a/src/Blazor.VSExtension/Properties/template-builder.props b/template/Blazor.VSExtension/Properties/template-builder.props similarity index 100% rename from src/Blazor.VSExtension/Properties/template-builder.props rename to template/Blazor.VSExtension/Properties/template-builder.props diff --git a/src/Blazor.VSExtension/packages.config b/template/Blazor.VSExtension/packages.config similarity index 100% rename from src/Blazor.VSExtension/packages.config rename to template/Blazor.VSExtension/packages.config diff --git a/src/Blazor.VSExtension/source.extension.vsixmanifest b/template/Blazor.VSExtension/source.extension.vsixmanifest similarity index 100% rename from src/Blazor.VSExtension/source.extension.vsixmanifest rename to template/Blazor.VSExtension/source.extension.vsixmanifest diff --git a/version.props b/version.props index 988982c4..2f211b55 100644 --- a/version.props +++ b/version.props @@ -1,6 +1,6 @@ 0.2.1 - build$([System.DateTime]::Now.ToString('yyyyMMdd-HHmmss')) + preview