R# SDK nuget package dependencies fail on build

d.o.kozhevnikov's Avatar

d.o.kozhevnikov

20 Jan, 2014 07:00 AM

Hi.

I have used nuget package R# SDK for referencing instead of preinstalled SDK on app-veyor server. After that my project MockMetrics always builds with errors like this(from build log):

RestorePackages:
"d:\Builds\l3jg1b3x3e\src\MockMetrics.nuget\NuGet.exe" install "d:\Builds\l3jg1b3x3e\src\MockMetrics\MockMetrics.Eating\packages.config" -source "" -NonInteractive -RequireConsent -solutionDir "d:\Builds\l3jg1b3x3e\src\MockMetrics\ " Restoring NuGet packages... To prevent NuGet from downloading packages during build, open the Visual Studio Options dialog, click on the Package Manager node and uncheck 'Allow NuGet to download missing packages'. Installing 'HaveBox 1.6.0'. Installing 'JetBrains.ReSharper.SDK 8.1.555'. Successfully installed 'HaveBox 1.6.0'. Successfully installed 'JetBrains.ReSharper.SDK 8.1.555'. PrepareForBuild:
Creating directory "bin\Debug\". Creating directory "obj\Debug\". [.....] error CS0246: The type or namespace name 'JetBrains' could not be found (are you missing a using directive or an assembly reference?)

I see that, packages were succesfully installed. But then dependency on JetBrains namespace failed.

Kozhevnikov Dmitry.

  1. Support Staff 1 Posted by Feodor Fitsner on 20 Jan, 2014 05:59 PM

    Feodor Fitsner's Avatar

    Hi Dmitry,

    It should work now. Please let me know if it doesn't.

  2. 2 Posted by d.o.kozhevnikov on 21 Jan, 2014 12:45 AM

    d.o.kozhevnikov's Avatar

    Still have the same error report.

  3. Support Staff 3 Posted by Feodor Fitsner on 21 Jan, 2014 01:05 AM

    Feodor Fitsner's Avatar

    Oh, just noticed you reference Resharper SDK as a NuGet package. This is cool - no need to install it on build machines.

    Regarding the problem - make sure you are not referencing specific assembly of the SDK. Open project file contents and check assembly references.

    - Feodor

  4. 4 Posted by d.o.kozhevnikov on 21 Jan, 2014 02:55 AM

    d.o.kozhevnikov's Avatar

    Hi.

    I have checked out. All sdk references are imported with tips:

      "<Import Project="..\packages\JetBrains.ReSharper.SDK.8.1.555\build\JetBrains.ReSharper.SDK.Props" Condition="Exists('..\packages\JetBrains.ReSharper.SDK.8.1.555\build\JetBrains.ReSharper.SDK.Props')" />
      <Import Project="..\packages\JetBrains.ReSharper.SDK.8.1.555\build\JetBrains.ReSharper.SDK.Targets" Condition="Exists('..\packages\JetBrains.ReSharper.SDK.8.1.555\build\JetBrains.ReSharper.SDK.Targets')" />"

    Thanks.

  5. Support Staff 5 Posted by Feodor Fitsner on 24 Jan, 2014 03:16 AM

    Feodor Fitsner's Avatar

    Dmitry,

    Is it the latest version: https://github.com/KozhevnikovDmitry/MockMetrics or you roll-backed? I can't see ReSharper package there...

  6. 6 Posted by d.o.kozhevnikov on 24 Jan, 2014 03:24 AM

    d.o.kozhevnikov's Avatar

    Feodor,

    Look into 'trunk' branch.

  7. Support Staff 7 Posted by Feodor Fitsner on 24 Jan, 2014 03:46 AM

    Feodor Fitsner's Avatar

    OK, I see. I've cloned trunk to my dev machine and after running 'nuget restoreeverything built OK with few warnings. However, I noticed restoringJetBrains.ReSharper.SDK` took some time.

    My guess would be something's wrong with restoring that package on AppVeyor build machine. Perhaps, it requires some permissions or trying to access GAC...

    Next week we are releasing beta of the new release - I'm sure your project will work there just fine as it uses for builds clean VMs with admin access.

  8. 8 Posted by d.o.kozhevnikov on 24 Jan, 2014 04:03 AM

    d.o.kozhevnikov's Avatar

    SDK consists of huge number of packages, maybe later I will be able to reduce it. In order SDK via nuget was intended specially for CI. But even on dev machine project sometimes(first time, on update sdk package)builds with errors. Anyway thanks for great support! Look foward for next release.

  9. Support Staff 9 Posted by Feodor Fitsner on 04 Feb, 2014 05:22 PM

    Feodor Fitsner's Avatar

    Dmitry,

    It's time to try your project on a new release!

    Use this link to register for beta:
    https://ci-beta.appveyor.com/signup

    Let me know how it goes.

  10. 10 Posted by d.o.kozhevnikov on 05 Feb, 2014 06:01 AM

    d.o.kozhevnikov's Avatar

    Feodor,

    Unforutanetelly have the same errors with R# sdk dependencies . I have regathered all projects for eliminate any inconsistencies. According to build log R# sdk is downloaded from nuget correctly, but copying sdk files to bin\debug directory is performing after building assembly. In other word the sequence is: downloading packages => compiling(fails with errors) => copying sdk files to bin/debug. In the other hand nuget package HaveBox is downloading and copying in right order and its dependencies do not fail. May be the way of importing sdk to project is the cause of this behavior. SDK adds the next strings into csproj file:

      <Import Project="..\packages\JetBrains.ReSharper.SDK.8.1.555\build\JetBrains.ReSharper.SDK.Props" Condition="Exists('..\packages\JetBrains.ReSharper.SDK.8.1.555\build\JetBrains.ReSharper.SDK.Props')" />
      <Import Project="..\packages\JetBrains.ReSharper.SDK.8.1.555\build\JetBrains.ReSharper.SDK.Targets" Condition="Exists('..\packages\JetBrains.ReSharper.SDK.8.1.555\build\JetBrains.ReSharper.SDK.Targets')" />

    And the HaveBox adds:
        <Reference Include="HaveBox">
          <HintPath>..\packages\HaveBox.1.6.1\lib\net45\HaveBox.dll</HintPath>
        </Reference>

    SDK imports lead to catalog "packages\JetBrains.ReSharper.SDK.8.1.555\build" where particular props and targets files(that includes sdk references) are placed.

    Dmitry Kozhevnikov

  11. Support Staff 11 Posted by Feodor Fitsner on 05 Feb, 2014 06:04 AM

    Feodor Fitsner's Avatar

    OK, I see.

    What if you add "nuget restore" command into "Before build script" box - to restore all packages before build occurs? Would it help?

  12. 12 Posted by d.o.kozhevnikov on 05 Feb, 2014 06:48 AM

    d.o.kozhevnikov's Avatar

    Yes! The solution has builded succesfully! Thanks for great work.
    Now have a problem with running tests: Could not load JetNativeHooks.dll. This lib in two varies must be placed to bin\debug\x86 and bin\debug\x64.

    Dmitry Kozhevnikov.

  13. Support Staff 13 Posted by Feodor Fitsner on 05 Feb, 2014 07:00 AM

    Feodor Fitsner's Avatar

    Cool, you can just copy that assembly into both folders in "before test script" ;)

  14. 14 Posted by d.o.kozhevnikov on 05 Feb, 2014 07:02 AM

    d.o.kozhevnikov's Avatar

    I wil try.

  15. 15 Posted by d.o.kozhevnikov on 06 Feb, 2014 06:48 AM

    d.o.kozhevnikov's Avatar

    Everything works completelly amazing!

  16. Support Staff 16 Posted by Feodor Fitsner on 06 Feb, 2014 06:41 PM

    Feodor Fitsner's Avatar

    Told you! :)

  17. Ilya Finkelshteyn closed this discussion on 25 Aug, 2018 01:37 AM.

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

Keyboard shortcuts

Generic

? 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

Recent Discussions

21 Aug, 2019 11:06 PM
21 Aug, 2019 02:08 PM
21 Aug, 2019 01:37 PM
21 Aug, 2019 10:21 AM
21 Aug, 2019 09:10 AM

 

21 Aug, 2019 05:56 AM
21 Aug, 2019 03:08 AM
20 Aug, 2019 11:33 PM
20 Aug, 2019 08:07 PM
20 Aug, 2019 05:50 PM
20 Aug, 2019 12:35 PM