C
C#ā€¢15mo ago
Serene Sphinx

ā” Error CS0579

Error CS0579 Duplicate 'System.Reflection.AssemblyVersionAttribute' attribute PacktLibraryNetStandard2 C:\cs11dotnet7\Chapter05\PacktLibraryNetStandard2\obj\Debug\net7.0\PacktLibraryNetStandard2.AssemblyInfo.cs
40 Replies
Pobiega
Pobiegaā€¢15mo ago
Read the message. It says you have two assembly version attributes in the same assembly, and that's not allowed
Serene Sphinx
Serene SphinxOPā€¢15mo ago
what is mean assembly version? Actually I'm learning C# using markjprice's book and stuck here.
Pobiega
Pobiegaā€¢15mo ago
That's not really important atm. What is important is that you have two of them. An attribute looks like this: [assembly: AssemblyVersion()]
Serene Sphinx
Serene SphinxOPā€¢15mo ago
Pobiega
Pobiegaā€¢15mo ago
It's not in the csproj files. Check your .cs files
Serene Sphinx
Serene SphinxOPā€¢15mo ago
I have only this one cs file
Pobiega
Pobiegaā€¢15mo ago
You also have a directory called classlib What's in there?
Serene Sphinx
Serene SphinxOPā€¢15mo ago
bin and obj folder can you join meet or zoom?
Pobiega
Pobiegaā€¢15mo ago
What? But it's included in your project source, according to your screenshot No I cant
Serene Sphinx
Serene SphinxOPā€¢15mo ago
Please help me I'm trying since last 3 days So why showing this error
Pobiega
Pobiegaā€¢15mo ago
Something is fucked with your project setup, I suggest starting from scratch Especially since you have no code written yet I'm on a buss right now typing on my phone, I can not join a screen share ATM ;p
Serene Sphinx
Serene SphinxOPā€¢15mo ago
I have not written any single line yet
Serene Sphinx
Serene SphinxOPā€¢15mo ago
Following this
Pobiega
Pobiegaā€¢15mo ago
Ok so start over with a fresh project Because you seem to have included the child project in your primary project And that is not allowed In fact, if you just delete the classlib project entirely, then delete the classlib folder It will probably worn Work
Serene Sphinx
Serene SphinxOPā€¢15mo ago
Maybe you have to say I don't have to add classlib project in PacktLibraryNetStandard2. I have to make it saperate
Pobiega
Pobiegaā€¢15mo ago
Yeah in a way You can't have a project live inside another projects folder They need to be separate And reference eachother via csproj instead
Serene Sphinx
Serene SphinxOPā€¢15mo ago
Then why in this book written like this? Is this book saying wrong
Pobiega
Pobiegaā€¢15mo ago
Without checking, I think you misunderstood the book They can live next to eachother, but not one inside the other
Serene Sphinx
Serene SphinxOPā€¢15mo ago
Okay I'm trying all again It's just worked Thanks a lot brother I was trying since last 2-3 days. So grateful for you šŸ™ šŸ™ šŸ™ šŸ™
Pobiega
Pobiegaā€¢15mo ago
.
ā”œā”€ā”€ src
ā”‚ ā”œā”€ā”€ YourProject
ā”‚ ā”‚ ā”œā”€ā”€ Class1.cs
ā”‚ ā”‚ ā””ā”€ā”€ YourProject.csproj
ā”‚ ā””ā”€ā”€ YourProject.Lib
ā”‚ ā”œā”€ā”€ Class1.cs
ā”‚ ā””ā”€ā”€ YourProject.Lib.csproj
ā”œā”€ā”€ test
ā”‚ ā”œā”€ā”€ YourProject.Tests
ā”‚ ā”‚ ā”œā”€ā”€ Class1Tests.cs
ā”‚ ā”‚ ā””ā”€ā”€ YourProject.Tests.csproj
ā”‚ ā””ā”€ā”€ YourProject.Perf
ā”‚ ā”œā”€ā”€ Program.cs
ā”‚ ā””ā”€ā”€ YourProject.Perf.csproj
ā”œā”€ā”€ YourProject.sln
ā”œā”€ā”€ .gitignore
ā”œā”€ā”€ .editorconfig
ā””ā”€ā”€ README
.
ā”œā”€ā”€ src
ā”‚ ā”œā”€ā”€ YourProject
ā”‚ ā”‚ ā”œā”€ā”€ Class1.cs
ā”‚ ā”‚ ā””ā”€ā”€ YourProject.csproj
ā”‚ ā””ā”€ā”€ YourProject.Lib
ā”‚ ā”œā”€ā”€ Class1.cs
ā”‚ ā””ā”€ā”€ YourProject.Lib.csproj
ā”œā”€ā”€ test
ā”‚ ā”œā”€ā”€ YourProject.Tests
ā”‚ ā”‚ ā”œā”€ā”€ Class1Tests.cs
ā”‚ ā”‚ ā””ā”€ā”€ YourProject.Tests.csproj
ā”‚ ā””ā”€ā”€ YourProject.Perf
ā”‚ ā”œā”€ā”€ Program.cs
ā”‚ ā””ā”€ā”€ YourProject.Perf.csproj
ā”œā”€ā”€ YourProject.sln
ā”œā”€ā”€ .gitignore
ā”œā”€ā”€ .editorconfig
ā””ā”€ā”€ README
this is roughly the structure you should use for your projects šŸ˜› you can skip the src and test levels if you want, but the you MUST have a separate folder for each project they can never live under eachother
Serene Sphinx
Serene SphinxOPā€¢15mo ago
what is .Lib I am totally new for .net learning C# right now.
Pobiega
Pobiegaā€¢15mo ago
that would be your "classlib" project its pretty common for larger codebases to be split into several projects
Serene Sphinx
Serene SphinxOPā€¢15mo ago
What is you current profession?
Pobiega
Pobiegaā€¢15mo ago
I'm a senior developer for a healthcare software firm, specializing in .NET development and I also help out with devops/ops, meaning taking care of our kubernetes cluster.
Serene Sphinx
Serene SphinxOPā€¢15mo ago
I'm student first learned Python Django. and understood My interest is more in Software dev than ML & AI. SO, learning C#, .NET do we use .net for IOS, Android and MacOS developnment? what is the meaning of alias? I am confused about it.
Pobiega
Pobiegaā€¢15mo ago
You can but I've never personally made a serious multi-platform mobile app. I tend to use kotlin when I make android stuff (for myself, for fun). for macOS, .NET is perfectly fine. same with linux can you provide some more context? the word "alias" just means "another word for the same thing"
Serene Sphinx
Serene SphinxOPā€¢15mo ago
Okay. This word used so many in C# book did you developed any UI using .NET
Pobiega
Pobiegaā€¢15mo ago
Yes, mostly using WPF but never anything for a professional product, only in-house tooling UI is not my strong suit šŸ™‚
Serene Sphinx
Serene SphinxOPā€¢15mo ago
this can shine in your Resume
Pobiega
Pobiegaā€¢15mo ago
what? I'm not showing you my CV, no. Not really. On my local job market, .NET is almost exclusively used for backend web development
Serene Sphinx
Serene SphinxOPā€¢15mo ago
Ohh!
Pobiega
Pobiegaā€¢15mo ago
so if you have WPF experience, great for you, but its really not going to help much for MOST jobs for the ones that are desktop client work, its a HUGE boost ofc
Serene Sphinx
Serene SphinxOPā€¢15mo ago
Maybe .NET don't have big market How big is your org?
Pobiega
Pobiegaā€¢15mo ago
it does. How big varies by where you are, but its way bigger than Java where I am for example Small, we're... 19 devs atm. I much prefer a smaller company over a huge one
Serene Sphinx
Serene SphinxOPā€¢15mo ago
How much yrs is your experience
Pobiega
Pobiegaā€¢15mo ago
~11-12 or so professional, but I've coded for 25 years or so
Serene Sphinx
Serene SphinxOPā€¢15mo ago
so experienced The aliases represent pointers to the integer value in memory, which is why their .NET names are IntPtr and UIntPtr. alias
Pobiega
Pobiegaā€¢15mo ago
.. why are you reading about IntPtr? its almost never used in C# outside of lowlevel or interop with C/C++
Serene Sphinx
Serene SphinxOPā€¢15mo ago
I don't know it's given in the book Actually I don't have anyone to discuss except you and that book Even I don't know why this IntPtr used Do you know anything about MSSQL sever I am learning MSSQL I am unable to join my server with database
Accord
Accordā€¢15mo ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.
Want results from more Discord servers?
Add your server