Steps to reproduce:
You may need to reload the solution and/or repeat the steps. Eventually, you should encounter this error.
After that, you won't be able to change the build action of any file in the project.
I'm unable to repro this using the latest build
Yep, can no longer repro this either.
Congrats on the release 馃槈
Just repro'd this with the RTM bits. It wasn't really about double extensions. No matter the file name, it fails. This time I added an empty txt file to the project and tried to change build action to _Content_ then set _Copy to Output Directory_ to _Copy if newer_.

Details:
An error has occurred while saving the edited properties listed below:
Copy to Output Directory
One or more values are invalid. Mismatched PageRule with the wrong ItemType.
@SomeAnon42 Thanks for following up.
@srivatsn Do you want this for 15.2 or 15.3?
Looks like the rename isn't propagating all the way through and this may be specifically related to shared projects.
Specifically, I did the following:
T.txt (I did this via the solution explorer)This results in a number of exceptions being thrown:
```
"Could not find project item with item type 'Content' and include value 'C:\Users\tagoo\documents\visual studio 2017\Projects\SharedProject1\SharedProject1\TextFile1.txt'."
and
An error has occurred while saving the edited properties listed below:
Copy to Output Directory
One or more values are invalid. Could not find project item with item type 'Content' and include value 'C:\Users\tagoo\documents\visual studio 2017\Projects\SharedProject1\SharedProject1\TextFile1.txt'.
```
The *.shproj is not modified (as expected), but the *.projitems is also not modified and still has <None Include="$(MSBuildThisFileDirectory)New Text Document.txt" />, not sure if that is expected (at the very least, I would expect Content and not None, since Content is what is listed in the properties page by default).
@tannergooding I can reproduce this with other project types as well (specifically, .NET Core and .NET Standard projects). Recorded a video, just in case.

Ok, I am able to repro that as well.
It is interesting that we aren't setting the correct output type here, when it is defined in our ProjectItemsSchema.xaml to be:
<ContentType
Name="Text"
DisplayName="Text file"
ItemType="Content">
</ContentType>
and
<FileExtension Name=".txt" ContentType="Text" />
Yeah, this is happening to me in production. Did a port from VS2015 to VS2017 with the new .csproj .NETCore files. Everything changed. This is one of the mucky errors.
I'm adding a new JSON file to a test project, then trying to change Copy to Output Directory (to anything) and I get:
An error has occurred while saving the edited properties listed below:
Copy to Output Directory
One or more values are invalid. Mismatched PageRule with the wrong ItemType.
Is this the same issue?
Yes it's the same issue. @jviau is this one of the ones you fixed for 15.3?
@davkean yes this looks exactly like an issue I fixed for 15.3. Bug 397479
Thanks @jviau - @tannergooding mentioned that he isn't able to repro this anymore as well.
@srivatsn Humm. Would you mind letting me/us know what the above means, in terms of how/when we might get a fix we can install, please?
This fix will be in the next Preview of 15.3 which should be coming out soon.
When is this becoming available in a release? I am experiencing this issue right now with .NET Standard 2.0.
@azjerei What build do you have? This should be fixed in the current public release - if you are still hitting it, maybe there is something different about your repro?
@Pilchie Build of what?
Visual Studio - can you let us know the build number from "Help - About"?
Visual Studio is at 15.4.3.
@azjerei - it sounds like you're hitting a slightly different bug with similar symptoms then. Can you share a repro project where this happens?
@Pilchie Check out this example application where the problem can be found: https://1drv.ms/u/s!Aiutb3QYc1ScmbBC0qC7WVzIXuECLw
@azjerei Both of the projects in that fail to load because of:
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), Standard.targets))\Standard.targets" />
for me:
D:\Dumps\1044\CodeAnalysis\CodeAnalysisLib\CodeAnalysisLib.csproj : error : The imported project "C:\Standard.targets" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk. D:\Dumps\1044\CodeAnalysis\CodeAnalysisLib\CodeAnalysisLib.csproj
@Pilchie Ah, that's unfortunate. But, I made a simple console app that should not have that problem, but that reproduces the problem in this thread: https://1drv.ms/u/s!Aiutb3QYc1ScmbBFYOjZrNCN_J1JUQ
Unfortunately, I'm not able to repro that with either the 15.4.5 build or the 15.5 Preview 5 build.
@davkean have you got ideas on how to figure out what's going on here?
Sound like @jviau refresh which he added in 15.3 isn't working, @azjerei can you record a video like @SomeAnon42 did to show exactly the steps that are occurring?
@davkean Here is a GIF showing the steps: https://1drv.ms/i/s!Aiutb3QYc1ScmbMFay50zRBbfVaJMQ
Thanks that perfectly describes why I couldn't repro it - I was using Properties tool window.
This has been fixed in 15.6 with: https://github.com/dotnet/project-system/pull/2984. As a workaround, use the Properties _tool window_ to change properties ( View -> Properties Window) instead of Properties pages.
Awesome! Thanks for everything.
This issues still exists. Mentioned issue by @SomeAnon42 (video) above is reproducible on my VS. Attached screenshot with VS version (15.6.0 Preview 2.0).
I came to this issue conversation while was searching for solution with properties window. Thanks, workaround with Properties tool window helped.


I am still experiencing the same thing with version 15.6.1 of Visual Studio Professional 2017.
Is there a workaround or something?
@tudorsibiu90 Change through the properties tool window, instead of the modal properties dialog. Select the file and press F4 to get the properties window.
Having the same issue here, can confirm the properties tool (F4) rather than the Properties dialog (Right Click > Properties) works.
I assume weirdly they are using different mechanisms
@wooderz i can reproduce the same situation.
As workaround i selected the file and pressed F4 and changed what i needed
We've fixed this inconsistently in 15.8. Only F4 properties now shows.
I'm still getting this with 15.8 - I added a .resx file to a core 2.0 project, set the build action to Embedded resource and the custom tool to ResXFileCodeGenerator. when I click ok, i get that error.
@jakesays Can you please file a new bug with the exact steps you took to get the error?
Most helpful comment
Having the same issue here, can confirm the properties tool (F4) rather than the Properties dialog (Right Click > Properties) works.
I assume weirdly they are using different mechanisms