Reference not found with NuGet auto restore

aleksandar.toplek's Avatar


19 Dec, 2014 01:35 PM

I get strange message from msbuild

C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets(1811,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "SharpDX". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors. [C:\projects\sharpdx-toolkit-game-direct2d\SharpDX.Toolkit.Direct2D\SharpDX.Toolkit.Direct2D.csproj]


  1. Support Staff 1 Posted by Feodor Fitsner on 19 Dec, 2014 05:21 PM

    Feodor Fitsner's Avatar

    Looks like references are broken: ($(SharpDXPackageBinDir) variable?)

  2. 2 Posted by aleksandar.topl... on 19 Dec, 2014 05:36 PM

    aleksandar.toplek's Avatar

    I was looking at that too. This is auto-generated via NuGet 3 for Visual Studio 2015 Preview. You can find variable definition here: ..\packages\SharpDX.Toolkit.2.6.3\build\SharpDX.Toolkit.targets But only when package is restored.

    <!--Root SharpDX SDK Directory where assemblies are stored. This variable should be set as a Global System Environement Variable -->
        <SharpDXPackageDir Condition="'$(SharpDXPackageDir)' == ''">$(MSBuildThisFileDirectory)..</SharpDXPackageDir>
        <!--SharpDX Directory to link against - based on platform-->
        <SharpDXPackageBinDir Condition="'$(SharpDXPackageBinDir)' == ''">$(SharpDXPackageDir)\Bin\$(SharpDXPlatform)</SharpDXPackageBinDir>
  3. Support Staff 3 Posted by Feodor Fitsner on 19 Dec, 2014 05:46 PM

    Feodor Fitsner's Avatar

    I see. It's the same chicken-egg problem as with BCL. It doesn't play well with .nuget folder.

    Add nuget restore to "Before build" script section on AppVeyor project settings. Going forward I'd get rid of .nuget folder

  4. 4 Posted by aleksandar.topl... on 19 Dec, 2014 05:49 PM

    aleksandar.toplek's Avatar

    I did try that, but NuGet seems to have a bug and refuses to restore my solution as it contains C++ Universal project where Shared project contains .vcxitems which is not supported as it seems.

  5. Support Staff 5 Posted by Feodor Fitsner on 19 Dec, 2014 05:53 PM

    Feodor Fitsner's Avatar

    How do you restore locally then?

  6. 6 Posted by aleksandar.topl... on 19 Dec, 2014 06:24 PM

    aleksandar.toplek's Avatar

    Looks like I was not using THE auto restore. I now ran migration scripts on both solutions and is works for first one. I still have to somehow avoid .vcxitems error.

    Great support.

  7. Support Staff 7 Posted by Feodor Fitsner on 19 Dec, 2014 08:34 PM

    Feodor Fitsner's Avatar
  8. Support Staff 8 Posted by Feodor Fitsner on 19 Dec, 2014 08:49 PM

    Feodor Fitsner's Avatar

    Right, I've checked nuget.exe and it references Microsoft.Build v4.0, not v12.0. This is the place where it loads solution for analyzing:

    Well, I can understand that - they can't take hard dependency on MSBuild 12.0 as there is no guarantee every developer has the latest VS already.

  9. aleksandar.toplek closed this discussion on 13 Feb, 2015 07:34 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts


? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac