PowerShell Visual Studio project creates duplicate assembly attributes

Will Pittenger 281 Reputation points
2021-11-27T12:06:19.237+00:00

I created a C# PowerShell project in VS 2019. Originally this project was created using a project template from PowerShell Tools extension. But I need .NET Core. So I started looking for an extension that would provide .NET Core in a PowerShell template for Visual Studio. I found one, but projects created by it generate a file named projectname.assembly.cs with duplicate assembly attributes. The compiler then tries to compile that AND the real assembly attribute file. This causes it to complain about duplicate attributes. Since I've upgraded to VS 2022. The problem is still there. What's going on?

I started with https://ironmansoftware.com/powershell-pro-tools, but switched to https://bitbucket.org/dtewinkel/twia.powershell.visualstudio/wiki/Home.

Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
4,606 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,249 questions
Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,364 questions
0 comments No comments
{count} votes

3 answers

Sort by: Most helpful
  1. Rich Matheisen 44,776 Reputation points
    2021-11-27T15:44:15.683+00:00

    Both products are supplied "as is" according to their licensing agreements. If you're paying for the software you're entitled to updates and fixes. But neither of the two products are part of PowerShell.

    Contacting the 3rd-party supplier would be your best bet at getting a resolution. You may find more help in one of the on-line forums devoted to Visual Studio (perhaps on Microsoft's MSDN site?)

    0 comments No comments

  2. Will Pittenger 281 Reputation points
    2021-11-29T08:40:19.127+00:00

    One, once the project files are created, the extensions are no longer involved. It's just VS. Two, 2022 doesn't have any such extensions available in the store yet. All I have is what comes with it. Third, the old MSDN.com site now gets redirected here.


  3. Anna Xiu-MSFT 25,626 Reputation points Microsoft Vendor
    2021-12-01T08:36:41.483+00:00

    Hi @Will Pittenger ,

    Welcome to Microsoft Q&A!

    Please try to delete the bin, obj folders in project folder and re-launch your Visual Studio to check again.
    If the real assembly file is available, you can also delete the duplicated assembly.cs file.

    Sincerely,
    Anna

    • If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
      Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.
    0 comments No comments