XamlParseException after deploying WPF project

前端 未结 10 1109
心在旅途
心在旅途 2020-11-30 10:08

I have been trying to deploy my WPF app, I created a Setup Project using the Setup Wizard.The only Project Output I added was Primary. After building this and installing the

10条回答
  •  眼角桃花
    2020-11-30 10:39

    This is normally caused by not having all dependencies copied to the output. As you say the error message is not very helpful, but I would check that your application has all the necessary dependencies available to resolve the parsed types.

    Normally it is enough to set Copy Local to true for referenced assemblies, but I've experienced some cases where references themselves reference assemblies, so it can be necessary to explicitly add those references as well.

    Update:

    Important addition by @BENN1TH.

    If you want to see what an assembly is necessary:

    Was getting the same type of issue once i had published and installed my project (was working fine in debug VS2013 Desktop, no errors etc) but used the advice in from http://geekswithblogs.net/lbugnion/archive/2007/03/14/108728.aspx and wham! installed project was working..

    try
    
    {
      InitializeComponent();
    }
    catch ( Exception ex )
    {
      // Log error (including InnerExceptions!)
      // Handle exception
    }
    

提交回复
热议问题