0

I have created solution with two projects:

Project1.csproj (using C#):

<PropertyGroup>
    <TargetFrameworks>net7.0-maccatalyst;net7.0-ios;net7.0-android</TargetFrameworks>
    <TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net7.0-windows10.0.19041.0</TargetFrameworks>
    <OutputType>Exe</OutputType>
    <UseMaui>true</UseMaui>
    <SingleProject>true</SingleProject>
    <ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>

<ItemGroup>
  <ProjectReference Include="..\Smanager\Smanager.vbproj" />
</ItemGroup>

Project2.csproj (using visual basic):

<PropertyGroup>
    <RootNamespace>Smanager</RootNamespace>
    <TargetFramework>net7.0</TargetFramework>
</PropertyGroup>

Everything runs perfectly in debugging and release, my application works perfectly fine and breakpoints in both projects are triggered. However once I am trying to Publish my app, I am getting an error below. Before adding Project2, everything was also working fine and publishing succeeded every time. What might be wrong and how to fix it? I have already tried to clean solution, restart VS, rebuild, delete hidden .vs folder, set projects to build separately in solution properties, reinstall VS.

This is an output of publishing attempt:

1>1 of 2 projects are up-to-date for restore.
1>Cannot resolve Assembly or Windows Metadata file 'C:\Users\...\bin\Release\net7.0\Smanager.dll'
1>Metadata file 'C:\Users\...\bin\Release\net7.0\Smanager.dll' could not be found
========== Publish: 0 succeeded, 1 failed, 0 skipped ==========
========== Elapsed 00:18.234 ==========
========== Package: 0 succeeded, 1 failed ===========

1 Answer 1

1

Answer to this is to delete publishing profile. Even thought it is similar, just go to:

  1. Your Startup project
  2. Properties
  3. PublishProfiles
  4. Right click and delete all existing profiles
  5. Clean solution
  6. Start Publishing from the start

enter image description here

Sign up to request clarification or add additional context in comments.

1 Comment

Excellent!You can mark your answer to help more people with the same question.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.