lauch.json:
{
??"version":?"0.2.0",
??"configurations":?[
???????{
???????????"name":?"MyLauncher",
???????????"type":"clr",
???????????"request":?"launch",
???????????"preLaunchTask":?"mybuild",
???????????"program":?"${workspaceFolder}/bin/Debug/test.exe",
???????????"args":[],
???????????"console":?"internalConsole",
???????????"stopAtEntry":?false,
???????????"internalConsoleOptions":?"openOnSessionStart"
???????},
???,]
}
task.json:
{
"version": "2.0.0",
"tasks": [
{
"label": "mybuild",
"command":"C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\MSBuild\\Current\\Bin\\MSBuild.exe",
"type":"shell",
"args":[
"test.csproj",
"/t:Build",
"/p:Configuration=Debug",
"/p:Platform=\"AnyCPU\""
]
}
]
}
Program.cs:
using System;
namespace DemoProject
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Hello World!");
Console.WriteLine("你好");
}
}
}
test.csproj:
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<RuntimeIdentifiers>win-x64;win7-x64</RuntimeIdentifiers>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>x64</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>portable</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>x64</PlatformTarget>
<DebugType>portable</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Compile Include="Program.cs" />
</ItemGroup>
<ItemGroup>
<Reference Include="mscorlib" />
<Reference Include="System.Core" />
<Reference Include="System.Windows" />
<Reference Include="System.ServiceModel" />
<Reference Include="System.Net" />
<Reference Include="System.Xml" />
<Reference Include="System" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
|