msbuild - Packages not restored when building on CI queue under TFS (VS Online VS2015) -


i've asked question build errors , continued investigating issue further desperate self.

i have guesstimation issue packages fetched not placed correctly. looking through painfully boring logs gave me this.

2016-01-15t21:50:40.8680146z
target "beforegenerateprojectprifile" listed in beforetargets attribute @ "c:\program files (x86)\msbuild\microsoft\nuget\microsoft.nuget.targets (186,61)" not exist in project, , ignored.

shortly thereafter, can see first sign of going sideways.

2016-01-15t21:50:43.9631666z ##[warning]
c:\program files (x86)\msbuild\14.0\bin\microsoft.common.currentversion.targets(1819,5): warning msb3245: not resolve reference. not locate assembly "microsoft.codedom.providers.dotnetcompilerplatform, version=1.0.0.0, culture=neutral, publickeytoken=31bf3856ad364e35, processorarchitecture=msil". check make sure assembly exists on disk. if reference required code, may compilation errors.
2016-01-15t21:50:43.9631666z 2>
c:\program files (x86)\msbuild\14.0\bin\microsoft.common.currentversion.targets(1819,5): warning msb3245: not resolve reference. not locate assembly "microsoft.codedom.providers.dotnetcompilerplatform, version=1.0.0.0, culture=neutral, publickeytoken=31bf3856ad364e35, processorarchitecture=msil". check make sure assembly exists on disk. if reference required code, may compilation errors. [c:\a\1\s\mystuff\mystuff.csproj]

and continues lot considering stuff aren't existing.

2016-01-15t21:50:43.9661661z
considered "..\packages\microsoft.codedom.providers.dotnetcompilerplatform.1.0.0\lib\net45\microsoft.codedom.providers.dotnetcompilerplatform.dll", didn't exist.
2016-01-15t21:50:43.9671655z
searchpath "{targetframeworkdirectory}". 2016-01-15t21:50:43.9681655z
considered "c:\program files (x86)\reference assemblies\microsoft\framework.netframework\v4.5.2\microsoft.codedom.providers.dotnetcompilerplatform.winmd", didn't exist.
...

i'm not familiar ci on tfs nor vs online tells me little strike on problem. i've googled myself half death , tested gazillion of different settings on portal. no luck. can cause other errors (when know i'm typing in wrong stuff etc.) 1 way or other, revolve one.

any hints appreciated.

starting version vs2015, there's no need nuget folder, contrary guides i've seen. in fact, file that's needed config packages. there's common deceitful work-around check in packages , executables can create lot of issues down road. wouldn't recommend because it's hiding problem, not resolving it.

first, verify build restores packages. noticed in error logs, looks if that's pitfall. it's attempt restore, not success. if encounter warning (and same goes nunit, webgrease, newtonsoft or other package under nuget's control):

warning msb3245: not resolve reference. not locate assembly "entityframework". check make sure assembly exists on disk.

start verifying logs contain following passages:

prepareforbuild:
creating directory "obj\debug\".
...
restorepackages:
"c:\a\src\src.nuget\nuget.exe" install "c:\a\src\src\xxxx.entities\packages.config"
-source -requireconsent -o "c:\a\src\src\packages"
...
installed "entityframework 6.3.1". resolveassemblyreferences:
primary reference "entityframework".

keep in mind when through log files, search partial strings, since directories, versions, packages' names etc. can vary slightly. if can't find it, there's chance packages aren't restored on build server. compiling locally proves there's difference between environments, file packages.config isn't available. it's tricky error because failed logs won't tell it's missing. in fact, haven't mentioned @ in logs.

  1. first, created brand new project auto , checked in. build succeeded.
  2. then, added entity framework , build failed same warning yours.
  3. finally, checked in packages.config file. build succeeded.

enter image description here

the problem occurs because initial check-in selects number of files ignore. it's bin, obj etc. packages.config. needs selected not-ignored. if checks in files (not wise, in view), gets file needed , appears if they're doing right. please note should add file version control first. way, it's being checked in @ each change. otherwise, issues start reappear if add new package locally or if update existing one.

if warning packages restored (the logs have lines listed), try update package locally or reinstall it. finally, refresh installation package manager console running update-package -reinstall.

  • similar issue older version of package manager here.
  • incorrect advice on files need checked in (since vs 2015) here.
  • outdated description of file layout (valid vs 2013 , earlier) here.
  • more info on how nuget files structure built here.
  • very blog on issue (strange doesn't come @ top in google) here.

Comments

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

css - Make div keyboard-scrollable in jQuery Mobile? -

ruby on rails - Seeing duplicate requests handled with Unicorn -