0

I am using VS 2015 Update 3. I added reference in my .net core project but I can't access to methods/members/classes. enter image description here

enter image description here

enter image description here

2
  • 1
    Did you tried like this- #if NET40 Service4.Test.PrintHi(); #endif Commented Feb 12, 2017 at 15:12
  • Thanks a lot @Sanket it is working now Commented Feb 12, 2017 at 15:42

1 Answer 1

2

Since you have added Service4 class library reference only in .NET 4.0 dependencies section (refer below snapshot), You need to use Conditional Compilation.

NET40 dependencies

To access, Service4 members, you need to do like this-

#if NET40 
    Service4.Test.PrintHi(); 
#endif

These are list of preprocessor symbols used in #if directives:

.NET Framework 2.0 --> NET20

.NET Framework 3.5 --> NET35

.NET Framework 4.0 --> NET40

.NET Framework 4.5 --> NET45

.NET Framework 4.5.1 --> NET451

.NET Framework 4.5.2 --> NET452

.NET Framework 4.6 --> NET46

.NET Framework 4.6.1 --> NET461

.NET Framework 4.6.2 --> NET462

.NET Standard 1.0 --> NETSTANDARD1_0

.NET Standard 1.1 --> NETSTANDARD1_1

.NET Standard 1.2 --> NETSTANDARD1_2

.NET Standard 1.3 --> NETSTANDARD1_3

.NET Standard 1.4 --> NETSTANDARD1_4

.NET Standard 1.5 --> NETSTANDARD1_5

.NET Standard 1.6 --> NETSTANDARD1_6

For more details, refer this article

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.