dotnet / dotnet/vscode-csharp

Extension will generate 'launch.json' to debug 'net46*' apps even though they can't be debugged

Open
#1,365 9 comments 0 reactions 0 assignees View on GitHub
Debugger Launch and Task Assets OmniSharp
Dominant language
TypeScript
Stars
3.1k
Forks
737
Avg merge
17h 56m
Merged PRs (30d)
21

Description

_From @RoboBurned on April 5, 2017 6:22_

- VSCode Version: 1.10.2
- C# 1.8.1
- OS Version: Win7 x64

Steps to Reproduce:

1. Create project.json based project
project.json:
```
{
"version": "1.0.0-*",
"buildOptions": {
"debugType": "portable",
"emitEntryPoint": true
},
"dependencies": {
"Microsoft.Extensions.Configuration": "*"
},
"frameworks": {
"Net461": {}
}
}
```
2 Write Hello world program.cs:
```
using Microsoft.Extensions.Configuration;
using System;

namespace ConsoleApplication
{
public class Program
{
public static void Main(string[] args)
{
ConfigurationBuilder builder = new ConfigurationBuilder();
builder.Build();
Console.WriteLine("Hello World!");
}
}
}
```
2. Press F5 to debug

Actual results:
Application crashes with error in DEBUG CONSOLE
Unhandled Exception: System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.Extensions.Configuration, Version=1.1.1.0, Culture=neutral, PublicKeyToken=adb9793829ddae60' or one of its dependencies. The system cannot find the file specified.
at ConsoleApplication.Program.Main(String[] args)
The program '[22800] HelloWorld.exe' has exited with code -532462766 (0xe0434352).

If I run application by using dotnet run command application works as expected.

I suppose the issue with build process: After project is built I have the following file structure:
bin
bin\Debug
bin\Debug\net461
HelloWorld.exe
HelloWorld.pdb
bin\Debug\net461\win7-x64
HelloWorld.exe
HelloWorld.pdb
Microsoft.Extensions.Configuration.dll
System.Console.dll
19 more DLLs....

Debug executes exe in net461 directory and fails because of unresolved dependences..

_Copied from original issue: Microsoft/vscode#23914_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.