-
Notifications
You must be signed in to change notification settings - Fork 427
ASP.NET 4.7.1 - The type 'Enum' is defined in an assembly that is not referenced #504
Comments
Are the problems here related to #481? - It doesn't mention 4.7.1, but the project is certainly working from UPDATE But, still giving the same issues as above. TO clarify, there are no issues with the |
You are correct that .NET 4.7.1 should contain all of .NET Standard 2.0 inbox and shouldn't even require a reference to NETStandard.Library package any longer. I suspect you are hitting this issue dotnet/msbuild#2567 where we aren't correctly detecting netstandard. |
@daveh101 Can you try adding the following property to your .csproj and let us know if it works around the issue? <_HasReferenceToSystemRuntime>true</_HasReferenceToSystemRuntime> |
@dsplaisted I ran into the same issue with a project targeting net471 and netstandard2.0 (it doesn't seem to occur with net471 only). |
@daveh101 - That CSProj property does not fix my project, unfortunately.
I've spent days moving my projects to netstandard2.0 and .Net Framework 4.7.1 where applicable. Frankly it was a painful process, pouring over GitHub to find all of the needed workarounds for the tooling and .Net Framework not being quite setup right for .Net 4.7.1 to be fully netstandard2.0 compatible. It's very demoralizing to see it not work in the end. I've tried both VS 15.4.2 and Preview VS 15.5.0 P2. I see two options left:
|
@AdamDotNet, we have stumbled upon same issue on recently released |
@AdamDotNet - there is another workaround that a bit help us - #542 (comment) |
@alfeg - I tried the web.config trick in a sample app and it indeed works! Thank you. Unfortunately, a while ago I decided on the net462 solution for my actual application, but this is good to know if I take another stab at moving forward to net471. Maybe it'll just work in net472? |
I have the same error message in .NET Standard project. I'm migrating project from .NET Framework and have multiple similar errors:
public static void WriteEntry(object Source, string Message, EventLogEntryType EntryType) // error in this line on EventLogEntryType
|
What happens if you explicitly add a reference to netstandard.dll? |
Closing for lack of traction, @daveh101 please re-open if you're still having trouble. |
This is likely a very similar issue to #391 & #489.
There is a big chance here that I am being an absolute idiot!! But, we are looking at migrating all of our code across to using .NET Standard 2.0 instead of PCL's - this is part of our work with UWP (#489).
The issue here is now when looking at one of our websites, I get the follow issue (see image)
There is an Enum that is in a .NET Standard 2.0 project that is being referenced
this.Links[i].Type
in theaspx
file.There is no problem with referencing this enum in the .cs file (or other items in the .NET Standard Projects).
What do I need to do to make this work on an ASPX file.
I have tried all the bits mentioned in the related issues, but none seem to help.
@weshaggard - I assume this might be one for you again?
The text was updated successfully, but these errors were encountered: