Skip to content

Non-optimized dependency #1585

Closed
Closed
@timcassell

Description

@timcassell

I'm getting this error when I run the benchmarks.

Assembly AsynchronousBenchmarks which defines benchmarks references non-optimized ProtoPromise
        If you own this dependency, please, build it in RELEASE.
        If you don't, you can disable this policy by using 'config.With(ConfigOptions.DisableOptimizationsValidator)'.

I don't want to disable the optimizations validator, but I can't figure out why I'm getting this error. I'm referencing another csproj directly (so I have all the source code) instead of a dll.

This is what the referenced csproj looks like, with the configuration set to Release Without Progress:

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

  <PropertyGroup>
    <TargetFrameworks>netcoreapp3.1;netstandard2.1;netstandard2.0</TargetFrameworks>
    <RootNamespace>ProtoPromise</RootNamespace>
    <Configurations>Debug With Progress;Release Without Progress;Release With Progress;Debug Without Progress</Configurations>
  </PropertyGroup>

  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release With Progress|AnyCPU'">
    <DefineConstants>CSHARP_7_3_OR_NEWER;CSHARP_7_OR_LATER</DefineConstants>
  </PropertyGroup>

  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release Without Progress|AnyCPU'">
    <DefineConstants>CSHARP_7_3_OR_NEWER;CSHARP_7_OR_LATER;PROTO_PROMISE_PROGRESS_DISABLE</DefineConstants>
  </PropertyGroup>

  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug With Progress|AnyCPU'">
    <DefineConstants>DEBUG;CSHARP_7_3_OR_NEWER;CSHARP_7_OR_LATER</DefineConstants>
  </PropertyGroup>

  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug Without Progress|AnyCPU'">
    <DefineConstants>DEBUG;CSHARP_7_3_OR_NEWER;CSHARP_7_OR_LATER;PROTO_PROMISE_PROGRESS_DISABLE</DefineConstants>
  </PropertyGroup>

  <ItemGroup>
    <Compile Remove="ProtoPromise\Promises\Unity\**" />
    <EmbeddedResource Remove="ProtoPromise\Promises\Unity\**" />
    <None Remove="ProtoPromise\Promises\Unity\**" />
  </ItemGroup>

  <ItemGroup>
    <Compile Remove="ProtoPromise\Utilities\AggregateException.cs" />
    <Compile Remove="ProtoPromise\Utilities\ValueTuple.cs" />
  </ItemGroup>

  <ItemGroup>
    <None Remove=".gitignore" />
    <None Remove="DeveloperNotes.txt" />
    <None Remove="ProtoPromise\ProtoPromise.asmdef" />
    <None Remove="ProtoPromise\ProtoPromise.asmdef.meta" />
  </ItemGroup>

</Project>

What am I doing wrong? I have 2 other csproj references that work fine. I tried adding another configuration for just Release, but it's still the same error. It also works if I build the dll and reference that, but I'd rather use the csproj for convenience.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions