update project files

May 7, 2010 at 6:48 PM

currently most of my projects have an import for the 4.3 StyleCop targets file:

<Import Project="$(ProgramFiles)\MSBuild\Microsoft\StyleCop\v4.3\Microsoft.StyleCop.targets" />

Now that I have 4.4 installed, this path is no longer valid.  Is there a good way to update all of these project files?

May 7, 2010 at 7:11 PM

With your current setup you’d have to go edit each csproj file one by one. A better way to set this up is the create a new MyStyleCop.targets file and then set up every one of your .csproj files to import the MyStyleCop.targets file instead. Within the MyStyleCop.targets file you will actually include the import that you have listed in your original post, where you import the actual Microsoft.StyleCop.targets files.

This this in place it becomes easy to upgrade to new versions since you only have to update the version number in a single place.

From: BryanKelly [mailto:notifications@codeplex.com]
Sent: Friday, May 07, 2010 10:48 AM
To: Jason Allor
Subject: update project files [stylecop:211947]

From: BryanKelly

currently most of my projects have an import for the 4.3 StyleCop targets file:

<Import Project="$(ProgramFiles)\MSBuild\Microsoft\StyleCop\v4.3\Microsoft.StyleCop.targets" />

Now that I have 4.4 installed, this path is no longer valid. Is there a good way to update all of these project files?

Read the full discussion online.

To add a post to this discussion, reply to this email (stylecop@discussions.codeplex.com)

To start a new discussion for this project, email stylecop@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe or change your settings on codePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at codeplex.com

May 7, 2010 at 7:21 PM

Thanks, that is a good suggestion.  Turns out the Notepad++ did a pretty good job replacing the line in the files.  Although, I had to manually go to each of the projects files and check them out of TFS.