locked
Project Reference works fine but Package Reference fails RRS feed

  • Question

  • Hi,

    We have several projects as part of the single solution file and the projects reference other projects in the same solution through the "ProjectReference" in the csproj file. So, lets say there are 3 projects; A, B and C. B is referencing C and A is referencing both B and C using project reference.

    We wanted to introduce Package Reference instead of Project Reference. So, we used "dotnet pack" to package all the above 3 projects (A,B and C) so that they can be used as package reference for another project, D which was previously referencing them through Project Reference. The package is created and stored in the TFS Package URL. Ideally, this should work as we are referencing the same project using package reference which was previously referenced as project reference.

    So, the only change to the CSPROJ file is as below:

    <ItemGroup>
        <PackageReference Include="packageName" Version="1.0.0" />

    </ItemGroup>

    The project reference for the same is removed from the CSPROJ file.

    While building the project D (which is referencing the packages) we are getting the below error.

    "The type or namespace name 'someClass/someFolder' does not exist in the namespace 'someProject(A/B/C)' (are you missing an assembly reference?)"

    The packages were built with no arguments so the project would have been first built and then packaged.

    I am not sure what are we missing here and why is it not able to find the assembly. Any insight/guidance will be highly appreciated.

    Thank you.


    Tuesday, September 22, 2020 6:13 AM

Answers

All replies

  • Hi AnanyoBAzDOps,

    Many forums in msdn have moved to Q&A forum, you may need to post your question there.

    In order to help you find the correct forum to go ask the question, I move the thread to 'where is the forum for' forum.

    Thank you for your understanding.

    Best Regards,

    Xingyu Zhao


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Tuesday, September 22, 2020 8:41 AM
  • I'd try asking for help over here.

    https://social.technet.microsoft.com/Forums/projectserver/en-US/home?category=project

     

     



    Regards, Dave Patrick ....
    Microsoft Certified Professional
    Microsoft MVP [Windows Server] Datacenter Management

    Disclaimer: This posting is provided "AS IS" with no warranties or guarantees, and confers no rights.

    Tuesday, September 22, 2020 2:04 PM
  • Hi Dave,

    I have posted the question in the suggested forum. Thank you.

    Tuesday, September 22, 2020 7:14 PM
  • Sounds good, you're welcome.

     

     



    Regards, Dave Patrick ....
    Microsoft Certified Professional
    Microsoft MVP [Windows Server] Datacenter Management

    Disclaimer: This posting is provided "AS IS" with no warranties or guarantees, and confers no rights.

    Tuesday, September 22, 2020 7:22 PM