PowerShell Visual Studio project creates duplicate assembly attributes

Will Pittenger 311 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.

Windows for business | Windows Server | User experience | PowerShell
Developer technologies | Visual Studio | Other
Developer technologies | C#
0 comments No comments
{count} votes

3 answers

Sort by: Most helpful
  1. Rich Matheisen 47,901 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 311 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 31,056 Reputation points Microsoft External Staff
    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

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.