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

Issues with Project references #6671

Closed
gretro opened this issue Jul 23, 2016 · 1 comment
Closed

Issues with Project references #6671

gretro opened this issue Jul 23, 2016 · 1 comment

Comments

@gretro
Copy link

gretro commented Jul 23, 2016

I'm currently trying to build an ASP.NET Core application that will be hosted inside a Windows Forms application. I'm trying to split the business logic from the host because I want to also have the freedom of changing the host in the future.

However, it seems creating Project references does not work between the new project format and the old one. The types created inside the ClassLibrary (new project style) are not visible inside the old project format.

Steps to reproduce

  1. Create empty solution in Visual Studio 2015 Update 3.
  2. Create a project of type Class Library (.NET Core) named ClassLibrary1.
  3. Go in the project.json and modify it to make it look like below.
{
  "version": "1.0.0-*",

  "dependencies": {

  },

  "frameworks": {
    "net452": {
    }
  }
}
  1. Create a project of type Console Application (not .NET Core) named ConsoleApplication1.
  2. Right-click in References under ConsoleApplication1 and add ClassLibrary1 as a Project reference.
  3. Refer to a type that exists in ClassLibrary1.
  4. Build the solution.

Expected behavior

The types inside the ClassLibrary1 project should be recongnized and available to the classic Console application. The solution should build correctly and should output the correct files.

Actual behavior

This will lead the a Build failure in the ConsoleApplication1 project with the code error CS0246: The type or namespace name 'ClassLibrary1' could not be found (are you missing a using directive or an assembly reference?). If instead of adding the reference as a Project reference I go and browse to the bin folder and refer the dll directly, everything builds without an issue. However, this is not a solution since the Build target may change, so the path will change as well.

Environment data

dotnet --info output:

.NET Command Line Tools (1.0.0-preview2-003121)

Product Information:
Version: 1.0.0-preview2-003121
Commit SHA-1 hash: 1e9d529

Runtime Environment:
OS Name: Windows
OS Version: 10.0.10586
OS Platform: Windows
RID: win10-x64

capture

@TheRealPiotrP
Copy link
Contributor

Moved to aspnet/Tooling

@msftgits msftgits transferred this issue from dotnet/cli Jan 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants