using System.Collections.Generic; using System.IO; using System.Linq; namespace AspNetCoreSdkTests.Templates { public class RazorClassLibraryTemplate : RazorBaseTemplate { public new static RazorClassLibraryTemplate Instance { get; } = new RazorClassLibraryTemplate(); protected RazorClassLibraryTemplate() { } public override string Name => "razorclasslib"; public override IEnumerable ExpectedObjFilesAfterBuild => Enumerable.Concat(base.ExpectedObjFilesAfterBuild, new[] { Path.Combine("Razor", "Areas", "MyFeature", "Pages", "Page1.g.cshtml.cs"), }.Select(p => Path.Combine(OutputPath, p))); // We set PreserveCompilationContext=true for all project types in the Razor.Sdk. This results in an refs directory to be created // in the build output directory which is undesirable. We should consider setting PreserveCompilationContext=true only if the // app's an executable. // https://github.com/aspnet/Razor/issues/2308 public override IEnumerable ExpectedBinFilesAfterBuild => Enumerable.Concat(base.ExpectedBinFilesAfterBuild, new[] { Path.Combine("refs", "Microsoft.Win32.Primitives.dll"), Path.Combine("refs", "mscorlib.dll"), Path.Combine("refs", "netstandard.dll"), Path.Combine("refs", "System.AppContext.dll"), Path.Combine("refs", "System.Collections.Concurrent.dll"), Path.Combine("refs", "System.Collections.dll"), Path.Combine("refs", "System.Collections.NonGeneric.dll"), Path.Combine("refs", "System.Collections.Specialized.dll"), Path.Combine("refs", "System.ComponentModel.Composition.dll"), Path.Combine("refs", "System.ComponentModel.dll"), Path.Combine("refs", "System.ComponentModel.EventBasedAsync.dll"), Path.Combine("refs", "System.ComponentModel.Primitives.dll"), Path.Combine("refs", "System.ComponentModel.TypeConverter.dll"), Path.Combine("refs", "System.Console.dll"), Path.Combine("refs", "System.Core.dll"), Path.Combine("refs", "System.Data.Common.dll"), Path.Combine("refs", "System.Data.dll"), Path.Combine("refs", "System.Diagnostics.Contracts.dll"), Path.Combine("refs", "System.Diagnostics.Debug.dll"), Path.Combine("refs", "System.Diagnostics.FileVersionInfo.dll"), Path.Combine("refs", "System.Diagnostics.Process.dll"), Path.Combine("refs", "System.Diagnostics.StackTrace.dll"), Path.Combine("refs", "System.Diagnostics.TextWriterTraceListener.dll"), Path.Combine("refs", "System.Diagnostics.Tools.dll"), Path.Combine("refs", "System.Diagnostics.TraceSource.dll"), Path.Combine("refs", "System.Diagnostics.Tracing.dll"), Path.Combine("refs", "System.dll"), Path.Combine("refs", "System.Drawing.dll"), Path.Combine("refs", "System.Drawing.Primitives.dll"), Path.Combine("refs", "System.Dynamic.Runtime.dll"), Path.Combine("refs", "System.Globalization.Calendars.dll"), Path.Combine("refs", "System.Globalization.dll"), Path.Combine("refs", "System.Globalization.Extensions.dll"), Path.Combine("refs", "System.IO.Compression.dll"), Path.Combine("refs", "System.IO.Compression.FileSystem.dll"), Path.Combine("refs", "System.IO.Compression.ZipFile.dll"), Path.Combine("refs", "System.IO.dll"), Path.Combine("refs", "System.IO.FileSystem.dll"), Path.Combine("refs", "System.IO.FileSystem.DriveInfo.dll"), Path.Combine("refs", "System.IO.FileSystem.Primitives.dll"), Path.Combine("refs", "System.IO.FileSystem.Watcher.dll"), Path.Combine("refs", "System.IO.IsolatedStorage.dll"), Path.Combine("refs", "System.IO.MemoryMappedFiles.dll"), Path.Combine("refs", "System.IO.Pipes.dll"), Path.Combine("refs", "System.IO.UnmanagedMemoryStream.dll"), Path.Combine("refs", "System.Linq.dll"), Path.Combine("refs", "System.Linq.Expressions.dll"), Path.Combine("refs", "System.Linq.Parallel.dll"), Path.Combine("refs", "System.Linq.Queryable.dll"), Path.Combine("refs", "System.Net.dll"), Path.Combine("refs", "System.Net.Http.dll"), Path.Combine("refs", "System.Net.NameResolution.dll"), Path.Combine("refs", "System.Net.NetworkInformation.dll"), Path.Combine("refs", "System.Net.Ping.dll"), Path.Combine("refs", "System.Net.Primitives.dll"), Path.Combine("refs", "System.Net.Requests.dll"), Path.Combine("refs", "System.Net.Security.dll"), Path.Combine("refs", "System.Net.Sockets.dll"), Path.Combine("refs", "System.Net.WebHeaderCollection.dll"), Path.Combine("refs", "System.Net.WebSockets.Client.dll"), Path.Combine("refs", "System.Net.WebSockets.dll"), Path.Combine("refs", "System.Numerics.dll"), Path.Combine("refs", "System.ObjectModel.dll"), Path.Combine("refs", "System.Reflection.dll"), Path.Combine("refs", "System.Reflection.Extensions.dll"), Path.Combine("refs", "System.Reflection.Primitives.dll"), Path.Combine("refs", "System.Resources.Reader.dll"), Path.Combine("refs", "System.Resources.ResourceManager.dll"), Path.Combine("refs", "System.Resources.Writer.dll"), Path.Combine("refs", "System.Runtime.CompilerServices.VisualC.dll"), Path.Combine("refs", "System.Runtime.dll"), Path.Combine("refs", "System.Runtime.Extensions.dll"), Path.Combine("refs", "System.Runtime.Handles.dll"), Path.Combine("refs", "System.Runtime.InteropServices.dll"), Path.Combine("refs", "System.Runtime.InteropServices.RuntimeInformation.dll"), Path.Combine("refs", "System.Runtime.Numerics.dll"), Path.Combine("refs", "System.Runtime.Serialization.dll"), Path.Combine("refs", "System.Runtime.Serialization.Formatters.dll"), Path.Combine("refs", "System.Runtime.Serialization.Json.dll"), Path.Combine("refs", "System.Runtime.Serialization.Primitives.dll"), Path.Combine("refs", "System.Runtime.Serialization.Xml.dll"), Path.Combine("refs", "System.Security.Claims.dll"), Path.Combine("refs", "System.Security.Cryptography.Algorithms.dll"), Path.Combine("refs", "System.Security.Cryptography.Csp.dll"), Path.Combine("refs", "System.Security.Cryptography.Encoding.dll"), Path.Combine("refs", "System.Security.Cryptography.Primitives.dll"), Path.Combine("refs", "System.Security.Cryptography.X509Certificates.dll"), Path.Combine("refs", "System.Security.Principal.dll"), Path.Combine("refs", "System.Security.SecureString.dll"), Path.Combine("refs", "System.ServiceModel.Web.dll"), Path.Combine("refs", "System.Text.Encoding.dll"), Path.Combine("refs", "System.Text.Encoding.Extensions.dll"), Path.Combine("refs", "System.Text.RegularExpressions.dll"), Path.Combine("refs", "System.Threading.dll"), Path.Combine("refs", "System.Threading.Overlapped.dll"), Path.Combine("refs", "System.Threading.Tasks.dll"), Path.Combine("refs", "System.Threading.Tasks.Parallel.dll"), Path.Combine("refs", "System.Threading.Thread.dll"), Path.Combine("refs", "System.Threading.ThreadPool.dll"), Path.Combine("refs", "System.Threading.Timer.dll"), Path.Combine("refs", "System.Transactions.dll"), Path.Combine("refs", "System.ValueTuple.dll"), Path.Combine("refs", "System.Web.dll"), Path.Combine("refs", "System.Windows.dll"), Path.Combine("refs", "System.Xml.dll"), Path.Combine("refs", "System.Xml.Linq.dll"), Path.Combine("refs", "System.Xml.ReaderWriter.dll"), Path.Combine("refs", "System.Xml.Serialization.dll"), Path.Combine("refs", "System.Xml.XDocument.dll"), Path.Combine("refs", "System.Xml.XmlDocument.dll"), Path.Combine("refs", "System.Xml.XmlSerializer.dll"), Path.Combine("refs", "System.Xml.XPath.dll"), Path.Combine("refs", "System.Xml.XPath.XDocument.dll"), }.Select(p => Path.Combine(OutputPath, p))); } }