Yapmaya çalıştığım bir projem var. Bu C# 7.1 özellikleri kullanıyor, ben Visual Studio üzerinden çalıştırmak ancak ben ben hatayı olsun .exe almak için yayımlamak çalıştığınızdaYapı SpotNet Core 2.0 Exe C# 7.1
Agent.cs(8,30): error CS8107: Feature 'async main' is not available in C# 7.
Please use language version 7.1 or greater. [C:\Users\stuarts\Documents\Visual
Studio 2017\Projects\Agent\Agent\Agent.csproj]
CSC : error CS5001: Program does not contain a static 'Main' method suitable
for an entry point [C:\Users\stuarts\Documents\Visual Studio
2017\Projects\Agent\Agent\Agent.csproj]
csproj:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>netcoreapp2.0</TargetFramework>
<IsPackable>false</IsPackable>
<NetStandardImplicitPackageVersion>1.6.1</NetStandardImplicitPackageVersion>
<RuntimeFrameworkVersion>2.0.0-*</RuntimeFrameworkVersion>
<RuntimeIdentifier>win10-x64</RuntimeIdentifier>
<ApplicationIcon />
<StartupObject />
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<LangVersion>7.1</LangVersion>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="RabbitMQ.Client" Version="5.0.1" />
</ItemGroup>
</Project>
inşa ediyorum
dotnet publish -c Release -r win10-x64 Agent.csproj
Yine
ile bu her eserler VS ayıklarken Neden bir ConsoleApplication proje şablonundan basit bir .exe alıyorum bu kadar garip!
Bunun için teşekkürler! – Stuart
@Stuart: Benim için zevk. – Sefe
@Stuart Bunu Debug ve Sürüm için ayrı ayrı ayarlamak için belirli bir neden var mı? Tüm konfigürasyonlar için ilk 'PropertyGroup' bölümünde de ayarlanabilir. –