Skip to content

New .csproj cannot reference GAC assemblies #987

@davkean

Description

@davkean

From @jnm2 on March 13, 2017 20:31

You can no longer reference some GAC assemblies without specifying a HintPath, at which point there isn't much point in using the GAC at all.

Class1.cs:

using System;
using Microsoft.SolverFoundation.Services;

public class Class1
{
    public static readonly Type X = typeof(ISolver);
}

Old .csproj, working:

<Project ToolsVersion="15.0">
  <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" />
  <PropertyGroup>
    <OutputType>Library</OutputType>
    <TargetFrameworkVersion>v4.6.2</TargetFrameworkVersion>
    <OutputPath>bin\$(Configuration)\</OutputPath>
  </PropertyGroup>
  <ItemGroup>
    <Reference Include="Microsoft.Solver.Foundation" />
  </ItemGroup>
  <ItemGroup>
    <Compile Include="*.cs" />
  </ItemGroup>
  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

New .csproj fails to find the reference:

<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <TargetFramework>net462</TargetFramework>
  </PropertyGroup>

  <ItemGroup>
    <Reference Include="Microsoft.Solver.Foundation" />
  </ItemGroup>

</Project>

This also does not work: <Reference Include="Microsoft.Solver.Foundation, Version=3.0.2.10889, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />.

Why is this broken?

Copied from original issue: dotnet/project-system#1739

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions