3

This was a standard MVC5 project I copy/pasted and want to deploy to a new Azure Website and VSO. I went through an removed workspaces, and renamed all proj files, namespaces, etc to a different name, and everything runs great locally. I can either use IISExpress, or localhost, and when I build and run locally I get zero errors or warnings. However, when I enable Azure's CI builds, I get this error on all of my references:

C:\Program Files (x86)\MSBuild\12.0\bin\amd64\Microsoft.Common.CurrentVersion.targets (1696): Could not resolve this reference. Could not locate the assembly "Microsoft.Owin". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors.

I have made sure these dlls are in the paths they say they are, and I have tried:

  • Enable nuGet to Get all Packages on Build
  • Clean builds
  • Set 'copy resources to local' to false, build, set back to true, build again
  • some others I might have missed from SO

What else can I try? Thanks for any help or suggestions!

1 Answer 1

0

What's happening here is that the NuGet packages are not being restored before the build begins. This can be done by running:

nuget.exe restore MySolution.sln

It is also important that you are using NuGet Automatic Package Restore and not the MSBuild "infused" variety from the past (version 2.6 and before).

1
  • 1
    Thanks for the suggestion. To fix this, I re-created the entire CI build, so I am unable to test this to see if it works. I will keep this in mind though, in case I run into something like this again. Thanks!
    – password
    Commented May 1, 2015 at 16:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.