3
3
4
4
using System ;
5
5
using System . Diagnostics ;
6
- using System . IO ;
7
- using System . Linq ;
8
- using System . Reflection ;
9
- using System . Text ;
10
6
using System . Text . RegularExpressions ;
11
7
using System . Threading . Tasks ;
12
8
using Microsoft . AspNetCore . Internal ;
@@ -19,7 +15,6 @@ public class WebsiteProcess : IDisposable
19
15
private readonly Process _process ;
20
16
private readonly ProcessEx _processEx ;
21
17
private readonly TaskCompletionSource < object > _startTcs ;
22
- private readonly StringBuilder _consoleOut = new StringBuilder ( ) ;
23
18
private static readonly Regex NowListeningRegex = new Regex ( @"^\s*Now listening on: .*:(?<port>\d*)$" ) ;
24
19
25
20
public string ServerPort { get ; private set ; }
@@ -58,7 +53,6 @@ private void Process_OutputDataReceived(object sender, DataReceivedEventArgs e)
58
53
var data = e . Data ;
59
54
if ( data != null )
60
55
{
61
- _consoleOut . AppendLine ( data ) ;
62
56
var m = NowListeningRegex . Match ( data ) ;
63
57
if ( m . Success )
64
58
{
@@ -74,19 +68,6 @@ private void Process_OutputDataReceived(object sender, DataReceivedEventArgs e)
74
68
75
69
public void Dispose ( )
76
70
{
77
- var attributes = Assembly . GetExecutingAssembly ( )
78
- . GetCustomAttributes < AssemblyMetadataAttribute > ( ) ;
79
- var serverLogPath = attributes . SingleOrDefault ( a => a . Key == "ServerLogPath" ) ? . Value ;
80
- if ( ! string . IsNullOrEmpty ( serverLogPath ) )
81
- {
82
- File . WriteAllText ( serverLogPath , _consoleOut . ToString ( ) ) ;
83
- }
84
- else
85
- {
86
- var logDir = Path . Combine ( Directory . GetCurrentDirectory ( ) , "artifacts" , "logs" ) ;
87
- Directory . CreateDirectory ( logDir ) ;
88
- File . WriteAllText ( Path . Combine ( logDir , "InteropServer.log" ) , _consoleOut . ToString ( ) ) ;
89
- }
90
71
_processEx . Dispose ( ) ;
91
72
}
92
73
}
0 commit comments