5

I have been stumped for about 3 days now trying to solve a MSBuild problem I have been having. In my solution I have 10 projects. 9 Projects are C# Class projects and 1 project which is the main EXE is a C# WPF Application project.

I created a gated MSBuild that gets triggered on a check in into the TFS server. Up to now only the 9 C# Class Projects have been included in the MSBuild because the C# WPF Application project was still being built. The C# WPF Application project is now done and fully working (run time and compile time) on multiple computers without issue.

I changed the build to include the new C# WPF Application project so that it could be checked in. The problem is with this C# WPF Application project now included, MSBuild fails with the following two errors:

 C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Microsoft.WinFX.targets (269): File 'Properties\DesignTimeResources.xaml' cannot be found.
 C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Microsoft.WinFX.targets (269): The project file contains a property value that is not valid.

Considering the entire solution builds and works on multiple computers it seems strange that the MSBuild is failing because of that. If I remove the C# WPF Application project from the MSBuild, everything is fine again so there is something weird with the C# WPF Application project that causes the MSBuild to fail.

I am getting desperate here, so any help is greatly appreciated. Thank you in advance for any help or insight you can give!

3
  • Did you verify you are submitting file 'Properties\DesignTimeResources.xaml' with your change? Commented Oct 4, 2012 at 19:59
  • We don't have any any file by that name. Commented Oct 4, 2012 at 21:54
  • Then check if you are pulling this file from your .csproj file or from other .XAML file. Open .csproj in notepad and search for it. Similarly for .XAML files. Commented Oct 5, 2012 at 1:01

5 Answers 5

3

That looks as if you are including the file 'Properties\DesignTimeResources.xaml' in your check in.

If you have previously just been copying or zipping the files around multiple machines, just check to make sure it is included in the files going into TFS.

Sign up to request clarification or add additional context in comments.

3 Comments

We don't have any any file by that name.
After doing a double check we did have that missing file, and no one knows where it came from. After removing check in was perfect and application still worked as expected. I always thought that was a server error. Thanks
Underrated answer. Head slapping and groans invariably will ensue. Honestly disappointing that Microsoft error messages on TFS build servers aren't good enough to indicate a crucial file is actually missing.
3

MS Expression Blend likes to add the Properties\DesignTimeResources.xaml file into your project so that it knows where to find common resources like your global styles.xaml file.

If you open a project in Expression Blend, it will add this file to the project but it may not add the file to source code control. The fix back in Visual Studio is to go the solution explorer, navigate to Properties then right click DesignTimeResources.xaml. If you won't use Blend again then just delete the file, otherwise add it to source code control.

Comments

1

I was having a similar error (BG1002: File not found) with a VS2017 WPF project which won't built because a certain icon file was missing despite the fact that I was no longer using that icon. I resolved this by manually editing the csproj file to rename the reference in notepad.

Comments

0

I run into this in a VS2017 WPF project with newest git 2.36. A collegues commit (other branch) a new file in a commit which I never checked out and somehow was just the project file changed to this commit I never used. Also git didn't noticed the change in first place in project file (I believe).

Comments

0

We found out that having the Properties\Resources.Designer.cs or Properties\Settings.Designer.cs in your version control also causes this issue. Since it is generated (and looks deprecated by now) it is not necessary to add it to version control.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.