1

Dll difference

Hello, I am facing a problem with a WPF project that I am working on. The application works perfectly when I build it on my local machine, but when built on TFS server, it fails at runtime with an exception 'Cannot find HomePage/HomePageView.xaml'. Attached is a screenshot of the difference between the dll built on build server & the one built on local machine. Build server gets rid of the 'HomePage' folder path for some reason. Any help on why this might be happening would be appreciated.

Also attached is a screenshot of my project layout.

Project Layout

wraith
  • 391
  • 1
  • 14
  • Sounds like your build server *might* not be running the XAML build tasks required to properly embed your XAML into your assemblies. – Federico Berasategui Jul 09 '14 at 18:20
  • How are these tasks defined? Is there any configuration parameter that I can change? Also, it is embedding the XAML, not in the correct location though. It is embedding it in the root of the assembly, instead of the folder structure that gets created when built on local machine. – wraith Jul 09 '14 at 20:54

1 Answers1

5

Based on the screenshot You provided, it seems that some files in this project are in fact added as links and the real files exist somewhere else (the little arrows on files icons indicate this).

Please make sure that TFS build server can actually access those files in their original location while building the project.

You mentioned that the build works on Your local machine, but it's not clear if You have only rebuilt the application or use Publish option. If not, please verify if publishing the project locally works correctly.

I also saw some article describing issue when using linked files and MSBuild, but it was rather related with web applications. You can find some information about it here.

Lukasz M
  • 5,635
  • 2
  • 22
  • 29
  • 2
    To add to this, right click on your HomePageView.xaml and ensure that the build action is set to Content – Just TFS Jul 10 '14 at 09:18
  • 1
    Thanks for help Lukasz. I verified that the build server does have access to all the files. Also verified that publishing the project locally works. I'll research further on problems caused by linking the files. That might be the problem as you suggested. Will check out the links. – wraith Jul 10 '14 at 18:26
  • You can also check *Workspace* tab in the build definition to make sure folder mappings are set correctly or maybe even try to map source folders specifically for the files to put them in appropriate locations. Some information about the *Workspace* tab can be found here: http://msdn.microsoft.com/en-us/library/hh190721.aspx#specify. Please let me know if this helped and whether You need more help with the issue. – Lukasz M Jul 10 '14 at 18:40
  • I have also found some information and hints about building WPF applications. You can check them out here: http://stackoverflow.com/questions/1839019/building-a-wpf-application-with-xaml-through-msbuild, here: http://msdn.microsoft.com/en-us/library/aa970678%28VS.85%29.aspx#Build_a_WPF_Application_Using_MSBuild and here: http://msdn.microsoft.com/en-us/library/aa970678.aspx#Building_a_WPF_Application_using_Command_Line. – Lukasz M Jul 10 '14 at 19:00
  • Thanks for the links Lukasz ..@JustTFS mine build action is set to Page .. what is the difference between setting it as Page & Content? – wraith Jul 11 '14 at 17:37
  • Have any of the things mentioned allow You to fix the issue? You can find some explanation of different *Build action* types here: http://stackoverflow.com/questions/145752/what-are-the-various-build-action-settings-in-vs-net-project-properties-and-wh – Lukasz M Jul 11 '14 at 21:56