Andrei Barbolin
Andrei Barbolin

Reputation: 435

Issue with reference class library to project

I have ASP.NET Core RC2 application which was migrated from RC1.

I had reference to class library (.net framework 4.5) and I want to add it to my RC2 application. So I changed project.json like this

{
"version": "1.0.0-*",
"buildOptions": {
    "emitEntryPoint": true
},
"frameworks": {
    "net45": {
            "dependencies": {
                "ExtConfig.PortalRepository": "1.0.0-*"
            }
    },
    "netcoreapp1.0": {
        "imports": [
            "dotnet5.6",
            "dnxcore50",
            "portable-net45+win8"
        ],
        "dependencies": {
            "Microsoft.NETCore.App": {
                "version": "1.0.0-rc2-3002702",
                "type": "platform"
            },
            "Microsoft.AspNetCore.StaticFiles": "1.0.0-rc2-final",
            "Microsoft.AspNetCore.Mvc": "1.0.0-rc2-final",
            "Microsoft.AspNetCore.Server.IISIntegration": "1.0.0-rc2-final",
            "Microsoft.AspNetCore.Server.WebListener": "0.1.0-rc2-final",
            "Microsoft.AspNetCore.Server.Kestrel": "1.0.0-rc2-final",
            "Microsoft.Extensions.Configuration.FileExtensions": "1.0.0-rc2-final",
            "Microsoft.Extensions.Configuration.Json": "1.0.0-rc2-final",
            "Microsoft.AspNet.Routing": "1.0.0-rc1-final",
            "Microsoft.Extensions.Configuration.EnvironmentVariables": "1.0.0-rc2-final"
        }
    }

},
"commands": {
    "web": "Microsoft.AspNetCore.Server.Kestrel"
},
"publishOptions": {
    "include": [
        "Views",
        "appsettings.json",
        "web.config"
    ]
}
}

And it is built ok, but for RC2 application it is not visible. I have advice from ReSharper, but it doesn't work. enter image description here

I tried to change net45 to diffirent dnx and netstandard statements, but it didn't help too. And I created nuget package from class library and tried to add it like nuget package and it didn't work.

Anyone else ran into this issue?

Upvotes: 2

Views: 808

Answers (1)

Eric Liu
Eric Liu

Reputation: 643

Isn't it ReSharper which trying to resolve references? Maybe it's not compatible with the new RC2 / SDK Preview yet, so...

Disable ReSharper's code analysis.

Resharper -> Options -> Code Inspection -> Settings -> General -> Enable code analysis

Untick it

Save

If still can't resolve references, try reinstall RC2 https://blogs.msdn.microsoft.com/dotnet/2016/05/16/announcing-net-core-rc2/

Or run visual studio in safe mode, maybe there is an extensions blow up things.

denenv.exe /safemode

https://msdn.microsoft.com/en-us/library/ms241278.aspx

Upvotes: 2

Related Questions