Build VSTS with error (Missing an Assembly Reference)

Asked

Viewed 30 times

0

Has anyone ever had this error running build on VSTS ?

I have a project C#, that runs locally and can publish on the server. I tried to check in the project on VSTS, to automate the build and always the error occurs below...

2018-05-02T14:13:58.6494940Z ##[error]XXXX.XXXX\XXXX\Entities\xxxxx.cs(3,45): Error CS0234: **The type or namespace name 'Schema' does not exist in the namespace 'System.ComponentModel.DataAnnotations' (are you missing an assembly reference?)**
2018-05-02T14:13:58.6502791Z XXXX\Entities\xxxx.cs(3,45): **error CS0234: The type or namespace name 'Schema' does not exist in the namespace 'System.ComponentModel.DataAnnotations' (are you missing an assembly reference?)** [D:\a\3\s\XXXX.XXXXX\XXX.XXXXX.csproj]

Build goes through Nuget Restore normally, only at build time it gives this error in several files.

  • Which agent is using to build?

  • Already tried Hosted and Hosted 2017, the application was developed in VS2015, already tried to use all possible settings, performing Clean, restoring packages, nothing, I will try to recreate an empty solution and add the files gradually, to see what gives ...

  • How are the dll references in your csproj? Are they relative path? are nuget packages?

1 answer

1

Good night,

Follow below a few steps:

1) Check in *.csproj that the reference does not have a fixed directory on your machine;

2) Check if you are recovering the Nugget packages in your build;

If the above steps do not solve the problem, you can install the agent on your local machine and debug it to try to find the problem.

Att,

Edson José Martins

Browser other questions tagged

You are not signed in. Login or sign up in order to post.