Add externals dlls to Maui project through common class library

Dani_S 3,786 Reputation points
2023-04-27T10:36:08.9433333+00:00

Hi,

I have 4 projects:

1.Client maui.

2.Shared class library.

3.Worker service.

4.Test project

All projects have project reference to Shared project.

I have created folder in Shared project.

and imported all files as reference see sniped code:


<Reference Include="ComponentPro.Ftp">
      <HintPath>ComponentPro_Net2_0\ComponentPro.Ftp.dll</HintPath>
      <Private>True</Private>
    </Reference>
<R

Why the test project do reported on missing assembly while MAUI and worker service do not complian?

Is it the right way to share the dlls?

I also imported the files from test project to solve the problem is the way ?

 <Reference Include="ComponentPro.Ftp">
      <HintPath>..\AutomationClient.Shared\ComponentPro_Net2_0\ComponentPro.Ftp.dll</HintPath>
      <Private>True</Private>
    </Reference>
Visual Studio Testing
Visual Studio Testing
Visual Studio: A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.Testing: The act or process of applying tests as a means of analysis or diagnosis.
349 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.


    Comments have been turned off. Learn more

  2. Dani_S 3,786 Reputation points
    2023-05-02T08:30:02.29+00:00

    First is working.

    Second I have not used NuGet packages in this case in share project.

    I have client A has project reference to Shared

    <ItemGroup>
    
    	  <ProjectReference Include="..\AutomationClient.Shared\AutomationClient.Shared.csproj" />
    
    	</ItemGroup
    

    and Shared folder has project reference to AutomationClient.API

    <ItemGroup>
        <ProjectReference Include="..\AutomationClient.API\AutomationClient.API.csproj" />
      </ItemGroup>
    

    and service worker has two reference types AutomationClient.API & Shared

    <ItemGroup>
    		<ProjectReference Include="..\AutomationClient.API\AutomationClient.API.csproj" />
    		<ProjectReference Include="..\AutomationClient.Shared\AutomationClient.Shared.csproj" />
    	</ItemGroup>
    

    If i put the dlls in client A or service worker the dlls will be duplicated.

    Any solution ?


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.