1

I have a C# project in my local and it is working perfectly in my local machine. When I try to build the same project through Azure DevOps it gives the following build error

[error]d:\a\1\s\packages\System.Net.Imap4.0.1.0\System.Net.Imap4.sln.metaproj(0,0): Error MSB3202: The project file "d:\a\1\s\packages\System.Net.Imap4.0.1.0..\example\example.csproj" was not found. d:\a\1\s\packages\System.Net.Imap4.0.1.0\System.Net.Imap4.sln.metaproj : error MSB3202: The project file > "d:\a\1\s\packages\System.Net.Imap4.0.1.0..\example\example.csproj" was not found. [d:\a\1\s\packages\System.Net.Imap4.0.1.0\System.Net.Imap4.sln] Project "d:\a\1\s\packages\System.Net.Imap4.0.1.0\System.Net.Imap4.sln" (1) is building "d:\a\1\s\packages\System.Net.Imap4.0.1.0\System.Net.Imap4.csproj"

In the IMAP4 library, it specifically says that the following file was not found. When I added the package through Nuget Package Manager it installed perfectly but does not download the mentioned file example/example.csproj in the packages/System.Net.Imap4.0.1.0 folder.

d:\a\1\s\packages\System.Net.Imap4.0.1.0\System.Net.Imap4.sln.metaproj : error MSB3202: The project file "d:\a\1\s\packages\System.Net.Imap4.0.1.0..\example\example.csproj" was not found.

System.Net.Imap4.0.1.0 package structure

System.Net.Imap4.0.1.0 package structure

System.Net.Imap4.0.1.0/lib/net35 (inside the lib there are no files and it contains only net35 folder) System.Net.Imap4.0.1.0/lib/net35

System.Net.Imap4.0.1.0/properties

System.Net.Imap4.0.1.0/properties

What I am missing here to build the project successfully?

Note: I tried to view the hidden files also but the example.csproj file was not found.

Ashok kumar Ganesan
  • 1,098
  • 5
  • 20
  • 48

2 Answers2

1

Facing build error with System.Net.IMAP4 in Azure DevOps

This issue should comes from that nuget package. I have download that nuget package from nuget.org, then I unzip it, I found that the package did not contain the file example.csproj:

enter image description here

So, this issue related to the package, I am not sure if you are the Owners/Authors of that package, if yes, you need to re-create that package.

In addition, I have a long time to use/support nuget. According to my experience, this package is not correct. As we know, nuget:

An essential tool for any modern development platform is a mechanism through which developers can create, share, and consume useful code. Often such code is bundled into "packages" that contain compiled code (as DLLs) along with other content needed in the projects that consume these packages.

But that package packaged the entire project, which is not the correct way, it should only include the dll files.

You can check this document for some details.

Hope this helps.

Leo Liu
  • 71,098
  • 10
  • 114
  • 135
  • 1
    I am not the author of that **IMAP4** package. I do not have idea on the package re-creation. I could not remove the package since it is a mandatory one. How do I fix this one? – Ashok kumar Ganesan Oct 17 '19 at 03:56
  • 1
    I opened the issue in Github also to notify the owner. [IMAP4 Issue](https://github.com/bizzehdee/System.Net.Imap4/issues/2) – Ashok kumar Ganesan Oct 17 '19 at 04:40
  • 1
    @AshokkumarGanesan, The best solution is ask author to update the package, but you could to know, that package was the product of six years ago and there was no activation record. So, I suggest that you need double check if that package is mandatory to you. If yes, you have to re-create it, the new package just need to include the .dll file, check my other thread how to do it: https://stackoverflow.com/questions/43277715/create-nuget-package-from-dlls/43316056#43316056 – Leo Liu Oct 17 '19 at 06:47
  • Let me check that way, otherwise I have to search for the alternate on IMAP4. Do you have any idea? – Ashok kumar Ganesan Oct 17 '19 at 07:12
  • @AshokkumarGanesan, No better idea, Why this package is mandatory to you? Are you use it to develop scripts? If yes, what do you need? The IMAP4 reference or all files in that packages? I need to know what you want to do with it, I can give you a better change plan. – Leo Liu Oct 17 '19 at 07:24
  • 1
    With the IMAP4, I retrieve the email and verifying the *From, To, Subject, Body content.* – Ashok kumar Ganesan Oct 17 '19 at 07:30
1

The build error resolved with the following changes.

  1. Navigate to this folder path /../System.Net.Imap4.0.1.0

System.Net.Imap4.0.1.0

  1. Open the System.Net.Imap4.sln file and remove or comment the example/example.csproj line from the file. enter image description here

  2. Build the project

  3. Build is successful

Ashok kumar Ganesan
  • 1,098
  • 5
  • 20
  • 48
  • 1
    Ahah, Yes, this is the workaround for this issue, I used to use nuget, my first thought was to create a new nuget package instead of directly modifying the contents of the package. But this workaround requires you to modify the contents of your package locally each time. When you publish your package, you need to pay special attention to it. – Leo Liu Oct 17 '19 at 07:36
  • 1
    Sure I will be attentive during the publish – Ashok kumar Ganesan Oct 17 '19 at 07:38