Kirsten
Kirsten

Reputation: 18140

Feature 'global using directive is not available in c# 7.3

All the orojects in my solution have GenerateGlobalUsings false

However when I build I get an error

Feature 'global using directive' is not available in C# 7.3. Please use language version 10.0 or greater.

My startup project is

<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <OutputType>WinExe</OutputType>
    <TargetFramework>net48</TargetFramework>
    <LangVersion>7.3</LangVersion>
    <GenerateGlobalUsings>false</GenerateGlobalUsings>
    <UseWindowsForms>true</UseWindowsForms>
    <ImplicitUsings>enable</ImplicitUsings>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="MYOB.AccountRight.API.SDK" Version="2024.10.641" />
    <PackageReference Include="System.Security.AccessControl" Version="6.0.1" />
  </ItemGroup>

  <ItemGroup>
    <ProjectReference Include="..\SBD.MyobSync\DataModule\DataModule.csproj" />
    <ProjectReference Include="..\SBD.MyobSync\SBD.MyobApi\MYOBAPI\SBD.Myob.csproj" />
  </ItemGroup>

  <ItemGroup>
    <Reference Include="System.Configuration" />
  </ItemGroup>

  <ItemGroup>
    <None Update="appsettings.config">
      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
    </None>
    <None Update="connections.config">
      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
    </None>
  </ItemGroup>

</Project>

I have tried cleaning and rebuilding I have tried deleting the bin and obj folders I have tried exiting Visual Studio

I have tried deleting the context of the generated file I am using VS 17.12.4 I have looked at this ticket but since language 7.3 is the default for net48 I dont think the answer is to move away from it.

Upvotes: 0

Views: 54

Answers (1)

Kirsten
Kirsten

Reputation: 18140

I removed

<ImplicitUsings>enable</ImplicitUsings>

And was able to move to the next error.

Upvotes: 0

Related Questions