@@ -56,6 +56,9 @@ export function activate(context: vscode.ExtensionContext, reporter: TelemetryRe
5656 let installError = '' ;
5757
5858 writeInstallBeginFile ( ) . then ( function ( ) {
59+ installStage = 'writeProjectJson' ;
60+ return writeProjectJson ( ) ;
61+ } ) . then ( function ( ) {
5962 installStage = 'dotnetRestore'
6063 return spawnChildProcess ( 'dotnet' , [ '--verbose' , 'restore' , '--configfile' , 'NuGet.config' ] , _channel , _util . coreClrDebugDir ( ) )
6164 } ) . then ( function ( ) {
@@ -237,6 +240,66 @@ function ensureAd7EngineExists(channel: vscode.OutputChannel, outputDirectory: s
237240 } ) ;
238241}
239242
243+ function writeProjectJson ( ) : Promise < void > {
244+ return new Promise < void > ( function ( resolve , reject ) {
245+ var projectJson = createProjectJson ( CoreClrDebugUtil . getPlatformRuntimeId ( ) ) ;
246+
247+ fs . writeFile ( path . join ( _util . coreClrDebugDir ( ) , 'project.json' ) , JSON . stringify ( projectJson , null , 2 ) , { encoding : 'utf8' } , function ( err ) {
248+ if ( err ) {
249+ reject ( err . code ) ;
250+ }
251+ else {
252+ resolve ( ) ;
253+ }
254+ } ) ;
255+ } ) ;
256+ }
257+
258+ function createProjectJson ( targetRuntime : string ) : any
259+ {
260+ let projectJson = {
261+ name : "dummy" ,
262+ compilationOptions : {
263+ emitEntryPoint : true
264+ } ,
265+ dependencies : {
266+ "Microsoft.VisualStudio.clrdbg" : "14.0.25201-preview-2911579" ,
267+ "Microsoft.VisualStudio.clrdbg.MIEngine" : "14.0.30401-preview-1" ,
268+ "Microsoft.VisualStudio.OpenDebugAD7" : "1.0.20401-preview-1" ,
269+ "NETStandard.Library" : "1.5.0-rc2-23931" ,
270+ "Newtonsoft.Json" : "7.0.1" ,
271+ "Microsoft.VisualStudio.Debugger.Interop.Portable" : "1.0.1" ,
272+ "System.Collections.Specialized" : "4.0.1-rc2-23931" ,
273+ "System.Collections.Immutable" : "1.2.0-rc2-23931" ,
274+ "System.Diagnostics.Process" : "4.1.0-rc2-23931" ,
275+ "System.Diagnostics.StackTrace" : "4.0.1-rc2-23931" ,
276+ "System.Dynamic.Runtime" : "4.0.11-rc2-23931" ,
277+ "Microsoft.CSharp" : "4.0.1-rc2-23931" ,
278+ "System.Threading.Tasks.Dataflow" : "4.6.0-rc2-23931" ,
279+ "System.Threading.Thread" : "4.0.0-rc2-23931" ,
280+ "System.Xml.XDocument" : "4.0.11-rc2-23931" ,
281+ "System.Xml.XmlDocument" : "4.0.1-rc2-23931" ,
282+ "System.Xml.XmlSerializer" : "4.0.11-rc2-23931" ,
283+ "System.ComponentModel" : "4.0.1-rc2-23931" ,
284+ "System.ComponentModel.Annotations" : "4.1.0-rc2-23931" ,
285+ "System.ComponentModel.EventBasedAsync" : "4.0.11-rc2-23931" ,
286+ "System.Runtime.Serialization.Primitives" : "4.1.1-rc2-23931" ,
287+ "System.Net.Http" : "4.0.1-rc2-23931"
288+ } ,
289+ frameworks : {
290+ "netstandardapp1.5" : {
291+ imports : [ "dnxcore50" , "portable-net45+win8" ]
292+ }
293+ } ,
294+ runtimes : {
295+ }
296+ }
297+
298+ projectJson . runtimes [ targetRuntime ] = { } ;
299+
300+ return projectJson ;
301+ }
302+
240303function spawnChildProcess ( process : string , args : string [ ] , channel : vscode . OutputChannel , workingDirectory : string ) : Promise < void > {
241304 const promise = new Promise < void > ( function ( resolve , reject ) {
242305 const child = child_process . spawn ( process , args , { cwd : workingDirectory } ) ;
0 commit comments