Манифест библиотечной сборки, которую пытаюсь подключить:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net7.0-windows</TargetFramework>
<Nullable>enable</Nullable>
<UseWindowsForms>true</UseWindowsForms>
<ImplicitUsings>enable</ImplicitUsings>
<Platforms>x86</Platforms>
<EnablePreviewFeatures>true</EnablePreviewFeatures>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\Lib.Common\Lib.Common.csproj" />
<ProjectReference Include="..\Lib.Controls\Lib.Controls.csproj" />
<ProjectReference Include="..\Lib.Providers.Database\Lib.Providers.Database.csproj" />
<ProjectReference Include="..\Lib.Providers\Lib.Providers.csproj" />
</ItemGroup>
<ItemGroup>
<Compile Update="Forms\PostgresConnectionForm.cs" />
<Compile Update="Properties\Resources.Designer.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Update="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
</ItemGroup>
</Project>
Манифест приложения, к которому хочу подключить библиотеку:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net7.0-windows</TargetFramework>
<Nullable>enable</Nullable>
<UseWindowsForms>true</UseWindowsForms>
<ImplicitUsings>enable</ImplicitUsings>
<Platforms>AnyCPU;x86</Platforms>
<EnablePreviewFeatures>true</EnablePreviewFeatures>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\Lib.Controls.WinForms\Lib.Controls.WinForms.csproj" />
</ItemGroup>
</Project>
При попытке добавить любой из контролов этой библиотеки, получаю ошибку:
Пробую добавить контрол вручную:
private void InitializeComponent()
{
button1 = new Button();
button2 = new ImageButtonControl();
SuspendLayout();
//
// button1
//
button1.Location = new Point(222, 254);
button1.Name = "button1";
button1.Size = new Size(75, 23);
button1.TabIndex = 0;
button1.Text = "button1";
button1.UseVisualStyleBackColor = true;
//
// button2
//
button2.Location = new Point(250, 230);
button2.Name = "button2";
button2.Size = new Size(75, 23);
button2.TabIndex = 0;
button2.Text = "button2";
button2.UseVisualStyleBackColor = true;
//
// Form1
//
AutoScaleDimensions = new SizeF(7F, 15F);
AutoScaleMode = AutoScaleMode.Font;
ClientSize = new Size(800, 450);
Controls.Add(button1);
Name = "Form1";
Text = "Form1";
ResumeLayout(false);
}
Теперь получаю ошибку, как будто сборка отсутствует:
При этом в другом приложении с точно таким же манифестом ошибок не возникает.
В каком направлении двигаться, чтобы решить проблему?
UPD. Попробовал загрузить сборку из проекта, который собирается и в нем ошибок нет. Второй же проект выдает ошибку при попытке загрузки по той же ссылке: