-
Notifications
You must be signed in to change notification settings - Fork 303
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
CS0579 - Duplicate 'System.Reflection.Assembly[something]Attribute Errors #29
Comments
Going through the second time, I think I know "where" the issue started. In section 2, "Building a Data Access Service" intellisense is not finding the class "Restaurant" in OdeToFood.Core. The error Note that this is where these reference errors begin. Good Fortune, |
I right-clicked on each project adding project references to both "OdeToFood" and "OdeToFood.Core" in the "OdeToFood.Data.csproj" file. Then I also added a single project reference to "OdeToFood" in the "OdeToFood.Core.csproj" file. I removed the problem line:
And did a build on the solution. Everything works up to that point. But reading the line above, I can't seem to get this project to use the Restaurant class in "OdeToFood.Core". Good Fortune, |
Note: to move on with the lesson, I moved the files in the OdeToFood.Core and OdeToFood.Data projects into folders under OdeToFood/Pages/.. and now intelisense easily finds the class and I'm able to move on. I would still appreciate any advice about why I couldn't reference the class from the separate projects. Good Fortune, |
Unfortunately, Mr. Scott Allen has passed away recently. |
I just ran into the same Problem and needed to reference them manually. Also when trying to add them via Intellisense my Visual Studio went into an (probably) infinite loop. Solution was also just to right click on the Projects and add the References manually. I think there are some shenanigans going on with IntelliSense. Rip Mr. Scott |
Hi Scott,
I'm enjoying the instruction, but I must have missed an instruction, or "fixed" something I should not have fixed along the way through your ASP.Net Core lesson, but I've run upon this CS0579 error twice now getting up to section 3.8 "linking to the details."
The first time I ran into this error, I was able to add a series of "false"
<GenerateAssembly[something]Attribute>
statements to the .csproj file and the duplication error cleared itself. The errors started popping up again around section 3.8 and even though I back out of the changes for several modules, I keep getting the error.Originally I thought the problem was caused because I created the OdeToFood project with the target framework of ".Net Core 2.1" and then failed to do the same for the "OdeToFood.Core" and "OdeToFood.Data" projects. And I switched all three to 2.1, and then to 3.1 trying to see if there was some reason why the compiler is trying to build these assemblies multiple times. Setting the "generate" flags to false for all of them in each .csproj file doesn't seem to eliminate the errors either.
I'm just going to archive the solution and start over again and not try to be clever by using 2.1, and follow the added instructions for 3.0+ here on github. But, I figured I would pass this along in case others were having the same problem.
Good Fortune,
Richard
The text was updated successfully, but these errors were encountered: