Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build warnings after update to 0.9.5 #161

Closed
ig-sinicyn opened this issue May 4, 2016 · 6 comments
Closed

Build warnings after update to 0.9.5 #161

ig-sinicyn opened this issue May 4, 2016 · 6 comments
Labels
Milestone

Comments

@ig-sinicyn
Copy link
Contributor

Real-world repro: https://ci.appveyor.com/project/andrewvk/codejam/build/1.0.514#L28

Steps to reproduce:

  1. Create a new project that targets 4.6 or higher

  2. Install BenchmarkDotNet 0.9.5. packages.

  3. Rebuild the project. There will be a warning:

    Found conflicts between different versions of the same dependent assembly that could not be resolved.  These reference conflicts are listed in the build log when log verbosity is set to detailed
    
  4. Check the versions of the Microsoft.Build and the Microsoft.Build.Framework assemblies in the project references. These are resolved as v4.0.
    To fix the warnings the references should include exact versions of the assemby, like this.

@AndreyAkinshin
Copy link
Member

@ig-sinicyn, thanks for the report.

@adamsitnik, can you take a look?

@AndreyAkinshin AndreyAkinshin added this to the v0.9.x milestone May 6, 2016
@adamsitnik
Copy link
Member

It is really weird. The project references 14.0.0.0 dlls. But if you rebuild the solution and go to artifacts\bin\BenchmarkDotNet\Release\BenchmarkDotNet.0.9.5-develop.nupkg extract it and open nuspec file, then you can see that versions are not set!!

<frameworkAssemblies>
            <frameworkAssembly assemblyName="Microsoft.Build" targetFramework=".NETFramework4.0" />
            <frameworkAssembly assemblyName="Microsoft.Build.Framework" targetFramework=".NETFramework4.0" />
            <frameworkAssembly assemblyName="Microsoft.Build.Utilities.v4.0" targetFramework=".NETFramework4.0" />
            <frameworkAssembly assemblyName="System.Management" targetFramework=".NETFramework4.0" />
            <frameworkAssembly assemblyName="mscorlib" targetFramework=".NETFramework4.0" />
            <frameworkAssembly assemblyName="System" targetFramework=".NETFramework4.0" />
            <frameworkAssembly assemblyName="System.Core" targetFramework=".NETFramework4.0" />
            <frameworkAssembly assemblyName="Microsoft.CSharp" targetFramework=".NETFramework4.0" />
            <frameworkAssembly assemblyName="Microsoft.Build" targetFramework=".NETFramework4.5" />
            <frameworkAssembly assemblyName="Microsoft.Build.Framework" targetFramework=".NETFramework4.5" />
            <frameworkAssembly assemblyName="Microsoft.Build.Utilities.v12.0" targetFramework=".NETFramework4.5" />
            <frameworkAssembly assemblyName="System.Management" targetFramework=".NETFramework4.5" />
            <frameworkAssembly assemblyName="mscorlib" targetFramework=".NETFramework4.5" />
            <frameworkAssembly assemblyName="System" targetFramework=".NETFramework4.5" />
            <frameworkAssembly assemblyName="System.Core" targetFramework=".NETFramework4.5" />
            <frameworkAssembly assemblyName="Microsoft.CSharp" targetFramework=".NETFramework4.5" />
            <frameworkAssembly assemblyName="Microsoft.Build" targetFramework=".NETFramework4.6" />
            <frameworkAssembly assemblyName="Microsoft.Build.Framework" targetFramework=".NETFramework4.6" />
            <frameworkAssembly assemblyName="Microsoft.Build.Utilities.Core" targetFramework=".NETFramework4.6" />
            <frameworkAssembly assemblyName="System.Management" targetFramework=".NETFramework4.6" />
            <frameworkAssembly assemblyName="mscorlib" targetFramework=".NETFramework4.6" />
            <frameworkAssembly assemblyName="System" targetFramework=".NETFramework4.6" />
            <frameworkAssembly assemblyName="System.Core" targetFramework=".NETFramework4.6" />
            <frameworkAssembly assemblyName="Microsoft.CSharp" targetFramework=".NETFramework4.6" />
            <frameworkAssembly assemblyName="System" targetFramework="DNX4.5.1" />
            <frameworkAssembly assemblyName="System.Runtime" targetFramework="DNX4.5.1" />
            <frameworkAssembly assemblyName="System.Management" targetFramework="DNX4.5.1" />
            <frameworkAssembly assemblyName="mscorlib" targetFramework="DNX4.5.1" />
            <frameworkAssembly assemblyName="System" targetFramework="DNX4.5.1" />
            <frameworkAssembly assemblyName="System.Core" targetFramework="DNX4.5.1" />
            <frameworkAssembly assemblyName="Microsoft.CSharp" targetFramework="DNX4.5.1" />
        </frameworkAssemblies>

I will google further

@adamsitnik
Copy link
Member

@AndreyAkinshin

Ok, I have removed the dependencies to MSBuild from BenchmarkDotNet package by setting "type": "build".

How does it work now:

  1. User installs BenchmarkDotNet. VS does not add any references to MSBuild dlls as it used to do since 0.9.2, when we switched to project.json and generated nuspec file had changed.
  2. Users runs some benchmarks: CLR is loading the mehod that references MSBuild and starts looking for all required dlls. For the explicit version of MSBuild files: 4 or 12 or 15. GAC is the first place to search. If MSBuild is installed, which was so far mandatory, then these dlls are loaded from GAC.
  3. If user has no required MSBuild installed (let's say VS 2015 and .NET 4.5 target when we want MSBuild 12 but only MSBuild 14 is installed) then ClassicBuilder try block executes, fails to catch block with FileLoadException/FileNotFoundException and falls back to the bat-file.

It is still not perfect but should cover 99% windows cases. I tested it with local nuget feed and our development package and it works (see below).

image

Does anybody know how does it work for Mono?

@adamsitnik adamsitnik modified the milestones: v0.9.6, v0.9.x May 8, 2016
@AndreyAkinshin
Copy link
Member

I think, we should migrate to Roslyn asap (see #149). There are too many problems with MSBuild.

P.S. Develop version (with my recent magic commit) works fine with Mono on my machine.

@adamsitnik
Copy link
Member

I think, we should migrate to Roslyn asap (see #149). There are too many problems with MSBuild.

@AndreyAkinshin I totally agree. If I only had some time to dig in the roslyn package..

P.S. Develop version (with my recent magic commit) works fine with Mono on my machine.

I saw it! Impressive fix for a crazy runtime bug!

@AndreyAkinshin
Copy link
Member

If I only had some time to dig in the roslyn package..

It should be a simple issue. We should just execute csc.exe with correct arguments. =)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants