Application runs by visual studio, but does not run when executed

Asked

Viewed 180 times

0

I’m using visual studio 2017, I created an application with WPF, the application normally runs inside the visual studio in debug mode, but if I compile it and run from inside the release folder, it doesn’t even start.

Also does not start if trying to run from the debug folder. The dependencies are apparently correct.

Checking the windows error log. I got the following result. (Full log)

.NET Runtime
=======================================================================
Aplicativo: ColetaDigital.exe
Versão do Framework: v4.0.30319
Descrição: O processo foi terminado devido a uma exceção sem tratamento.
Informações da Exceção: System.IO.FileNotFoundException
   em ColetaDigital.View.PessoaWindow..ctor()
   em ColetaDigital.App..ctor()
   em ColetaDigital.App.Main()
=======================================================================

Application Error
=======================================================================
Nome do aplicativo com falha: ColetaDigital.exe, versão: 1.0.0.0, carimbo de data/hora: 0x5a870628
Nome do módulo com falha: KERNELBASE.dll, versão: 6.3.9600.17415, carimbo de data/hora: 0x54505737
Código de exceção: 0xe0434352
Deslocamento da falha: 0x0000000000008b9c
ID do processo com falha: 0x20e4
Hora de início do aplicativo com falha: 0x01d3a7442ad30549
Caminho do aplicativo com falha: C:\WorkspaceHumberto\Uzer\Projects\ColetaDigital\ColetaDigital\bin\x64\Release\ColetaDigital.exe
Caminho do módulo com falha: C:\WINDOWS\system32\KERNELBASE.dll
ID do Relatório: 689c2aa2-1337-11e8-82d0-641c67786bc9
Nome completo do pacote com falha: 
ID do aplicativo relativo ao pacote com falha: 
=======================================================================

Window Error Reporting
=======================================================================
Falha no bucket 1884401921137980673, tipo 5
Nome do Evento: CLR20r3
Resposta: Não disponível
ID do CAB: 0

Assinatura do problema:
P1: ColetaDigital.exe
P2: 1.0.0.0
P3: 5a870628
P4: ColetaDigital
P5: 1.0.0.0
P6: 5a870628
P7: 3
P8: 17
P9: System.IO.FileNotFoundException
P10: 

Arquivos anexados:
C:\Users\Pós Venda 02\AppData\Local\Temp\WER15A9.tmp.WERInternalMetadata.xml
C:\Users\Pós Venda 02\AppData\Local\Temp\WER1CFD.tmp.appcompat.txt
C:\Users\Pós Venda 02\AppData\Local\Temp\WER1D0D.tmp.dmp
C:\Users\Pós Venda 02\AppData\Local\Temp\WER1D5D.tmp.WERDataCollectionFailure.txt

Esses arquivos podem estar disponíveis em:
C:\Users\Pós Venda 02\AppData\Local\Microsoft\Windows\WER\ReportArchive\AppCrash_ColetaDigital.ex_4e653f8ba129975abac06dcb31b7db17f30cfa2_19a790df_27981d5a

Símbolo da análise: 
Verificando novamente solução: 0
ID do Relatório: 689c2aa2-1337-11e8-82d0-641c67786bc9
Status do Relatório: 4104
Bucket com hash: bff7b2f985abec0a5a26bd90337e3501
=======================================================================

Edited:

Code where windows points error (Collected class.View.Personal):

using ColetaDigital.ViewModel;
using System.Windows;
using System.Windows.Data;
using System.Windows.Input;
using Sagem.MorphoKit;
using System;
using System.Drawing;
using System.Drawing.Imaging;
using Models;
using DataAccess;
using System.Linq;
using System.Threading;
using System.Collections.Generic;

namespace ColetaDigital.View
{
    /// <summary>
    /// Interaction logic for PessoaWindow.xaml
    /// </summary>
    public partial class PessoaWindow : Window, IDisposable
    {
        private AcquisitionDevice mDevice;
        private System.Windows.Controls.TextBox mDeviceStatus;
        private System.Windows.Forms.PictureBox mDeviceDisplay;
        private System.Windows.Controls.ProgressBar mDeviceQuality;

        private PessoaPermanente mPessoaSelecionada;
        private DataContext mDataContext;

        private Thread mDeviceConnectMonitor;
        private bool mDeviceConnectionStatus;

        private App mApp;

        #region events
        public event EventHandler DeviceConnected;
        #endregion

        public PessoaWindow()
        {
            InitializeComponent();

            mApp = Application.Current as App;
            mDevice = new AcquisitionDevice();

            mDevice.FingerEvent += new FingerEventHandler(device_FingerEvent);
            mDevice.EnrolmentEvent += new EnrolmentEventHandler(device_EnrolmentEvent);
            mDevice.QualityEvent += new QualityEventHandler(_device_QualityEvent);
            mDevice.ImageEvent += new ImageEventHandler(device_ImageEvent);

            DeviceConnected += PessoaWindow_DeviceConnected;
            MonitorarLeitor();
        }

        private void MonitorarLeitor()
        {
            mDeviceConnectMonitor = new Thread(() =>
            {
                while (true)
                {
                    IAcquisitionDeviceInfo[] devices = null;

                    try
                    {
                        devices = mDevice.EnumerateDevices();
                    }
                    catch (Exception) { }

                    bool DeviceConnectionStatus = devices != null && devices.Count() > 0 && !devices[0].SerialNumber.Equals("");

                    if (DeviceConnectionStatus != mDeviceConnectionStatus)
                    {
                        mDeviceConnectionStatus = DeviceConnectionStatus;
                        DeviceConnected?.Invoke(this, null);
                    }

                    Thread.Sleep(1000);
                }
            });

            mDeviceConnectMonitor.Start();
        }

        delegate void DeviceConnectedHandlerDelegate(object sender, EventArgs e);
        private void PessoaWindow_DeviceConnected(object sender, EventArgs e)
        {
            if (!CheckAccess())
            {
                try
                {
                    Dispatcher.Invoke(() => PessoaWindow_DeviceConnected(sender, e));
                }
                catch (Exception)
                { }

                return;
            }

            lblPlugLeitor.Text = "Leitor " + (mDeviceConnectionStatus ? "conectado" : "desconectado");
        }

        void device_FingerEvent(int status)
        {
            FingerEventStatus feStatus = FingerEventStatus.UNKNOWN;

            if (Enum.IsDefined(typeof(FingerEventStatus), status))
            {
                feStatus = (FingerEventStatus)status;
            }

            String msg = "";

            switch (feStatus)
            {
                case FingerEventStatus.NO_FINGER_DETECTED:
                    msg = "Dedo não detectado";
                    break;
                case FingerEventStatus.MOVE_FINGER_UP:
                    msg = "Mova para cima";
                    break;
                case FingerEventStatus.MOVE_FINGER_DOWN:
                    msg = "Mova para baixo";
                    break;
                case FingerEventStatus.MOVE_FINGER_LEFT:
                    msg = "Mova para esquerda";
                    break;
                case FingerEventStatus.MOVE_FINGER_RIGHT:
                    msg = "Mova para direita";
                    break;
                case FingerEventStatus.PRESS_FINGER_HARDER:
                    msg = "Pressione mais";
                    break;
                case FingerEventStatus.LATENT:
                    msg = "Latente";
                    break;
                case FingerEventStatus.REMOVE_FINGER:
                    msg = "Remova o dedo";
                    break;
                case FingerEventStatus.OK:
                    msg = "Digital aceita";
                    break;
                case FingerEventStatus.FINGER_DETECTED:
                    msg = "Dedo detectado";
                    break;
                case FingerEventStatus.FINGER_MISPLACED:
                    msg = "Dedo mal posicionado";
                    break;
                case FingerEventStatus.LIVE_OK:
                    msg = "Não remova o dedo";
                    break;
                default:
                    msg = "Sem dedo";
                    break;
            }

            mDeviceStatus.Text = msg;
        }

        void device_EnrolmentEvent(int captureIndex)
        {
            mDeviceStatus.Text = String.Format("Captura {0}", captureIndex);
        }

        void _device_QualityEvent(byte quality)
        {
            mDeviceQuality.Value = quality < mDeviceQuality.Maximum ? quality : mDeviceQuality.Maximum;
        }

        void device_ImageEvent(byte[] buffer, int width, int height, int resolution)
        {

        }

        private Bitmap CreateGreyscaleBitmap(byte[] buffer, int width, int height)
        {
            Bitmap bmp = new Bitmap(width, height, System.Drawing.Imaging.PixelFormat.Format8bppIndexed);

            BitmapData bmpData = bmp.LockBits(new Rectangle(0, 0, width, height), ImageLockMode.ReadWrite, PixelFormat.Format8bppIndexed);
            System.Runtime.InteropServices.Marshal.Copy(buffer, 0, bmpData.Scan0, width * height);
            bmp.UnlockBits(bmpData);

            ColorPalette pal = bmp.Palette;
            for (int i = 0; i < 256; i++)
            {
                pal.Entries[i] = Color.FromArgb(i, i, i);
            }

            bmp.Palette = pal;
            return bmp;
        }

        private void CollectionViewSource_Filter(object sender, FilterEventArgs e)
        {
            PessoaViewModel o = e.Item as PessoaViewModel;

            if (o != null)
            {
                e.Accepted = o.Codigo.ToUpper().Contains(tbFilter.Text.ToUpper()) || o.Nome.ToUpper().Contains(tbFilter.Text.ToUpper());
            }
        }

        private void tbFilter_KeyUp(object sender, KeyEventArgs e)
        {
            CollectionViewSource.GetDefaultView(dgPessoas.ItemsSource).Refresh();
        }

        private void dgPessoas_SelectionChanged(object sender, System.Windows.Controls.SelectionChangedEventArgs e)
        {
            if (IsLoaded)
            {
                tbCodigo.Text = "";
                tbTipo.Text = "";
                tbNome.Text = "";

                picPrincipal.Image = null;
                pbPrincipal.Value = 0;
                tbPrincipal.Text = "";

                picSecundaria.Image = null;
                pbSecundaria.Value = 0;
                tbSecundaria.Text = "";

                picPanico.Image = null;
                pbPanico.Value = 0;
                tbPanico.Text = "";

                mPessoaSelecionada = null;
                mDataContext = null;

                if (e.AddedItems.Count > 0)
                {
                    PessoaViewModel o = e.AddedItems[0] as PessoaViewModel;

                    tbCodigo.Text = o.Codigo;
                    tbTipo.Text = o.Tipo;
                    tbNome.Text = o.Nome;

                    mPessoaSelecionada = o.PessoaPermanente;
                    mDataContext = o.DataContext;
                }
            }
        }

        private void btPrincipalCapturar_Click(object sender, RoutedEventArgs e)
        {
            mDeviceDisplay = picPrincipal;
            mDeviceStatus = tbPrincipal;
            mDeviceQuality = pbPrincipal;

            Bitmap b = CapturarDigital();

            if (b != null)
            {
                Digital digital = new Digital();

                digital.Pessoa = mPessoaSelecionada.Pessoa;
                digital.DedoPanico = "n";
                digital.Template = ExtractTemplateFromBitmap(b);
                digital.DataHora = DateTime.Now;
                digital.Ativa = "s";

                var DigitaisAExcluir = mPessoaSelecionada.Pessoa.Digitais.Where(d => d.DedoPanico == "n");
                mDataContext.Digitais.RemoveRange(DigitaisAExcluir);

                mDataContext.Digitais.Add(digital);
            }
        }

        private static byte[] ImageToByte(Image img)
        {
            ImageConverter converter = new ImageConverter();
            return (byte[])converter.ConvertTo(img, typeof(byte[]));
        }

        private static Image ByteToImage(byte[] bytes)
        {
            ImageConverter converter = new ImageConverter();
            return (Image)converter.ConvertTo(bytes, typeof(Image));
        }

        private void btSecundariaCapturar_Click(object sender, RoutedEventArgs e)
        {
            mDeviceDisplay = picSecundaria;
            mDeviceStatus = tbSecundaria;
            mDeviceQuality = pbSecundaria;

            Bitmap b = CapturarDigital();

            if (b != null)
            {
                Digital digital = new Digital();

                digital.Pessoa = mPessoaSelecionada.Pessoa;
                digital.DedoPanico = "n";
                digital.Template = ExtractTemplateFromBitmap(b);
                digital.DataHora = DateTime.Now;
                digital.Ativa = "s";

                // Comentado aqui para depois verificar a melhor forma de excluir digitais que já estavam cadastradas.
                // Se mantiver esse código, quando cadastrar a digital segundária, seria excluido tudo do banco, inclusive
                // a que foi cadastrada como principal.
                // var DigitaisAExcluir = mPessoaSelecionada.Pessoa.Digitais.Where(d => d.DedoPanico == "n");
                // mDataContext.Digitais.RemoveRange(DigitaisAExcluir);

                mDataContext.Digitais.Add(digital);
            }
        }

        private void btPanicoCapturar_Click(object sender, RoutedEventArgs e)
        {
            mDeviceDisplay = picPanico;
            mDeviceStatus = tbPanico;
            mDeviceQuality = pbPanico;

            Bitmap b = CapturarDigital();

            if (b != null)
            {
                Digital digital = new Digital();

                digital.Pessoa = mPessoaSelecionada.Pessoa;
                digital.DedoPanico = "s";
                digital.Template = ExtractTemplateFromBitmap(b);
                digital.DataHora = DateTime.Now;
                digital.Ativa = "s";

                var DigitaisAExcluir = mPessoaSelecionada.Pessoa.Digitais.Where(d => d.DedoPanico == "s");
                mDataContext.Digitais.RemoveRange(DigitaisAExcluir);

                mDataContext.Digitais.Add(digital);
            }
        }

        private Bitmap CapturarDigital()
        {
            if (mPessoaSelecionada == null)
            {
                MessageBox.Show("Nenhuma pessoa selecionada");
                return null;
            }

            mDevice.Display = mDeviceDisplay.Handle;

            IAcquisitionDeviceInfo[] devices = null;
            try
            {
                devices = mDevice.EnumerateDevices();
            }
            catch (Exception)
            { }

            try
            {
                foreach (var dev in devices)
                {
                    IAcquisitionResult result = mDevice.Acquire(dev.SerialNumber);
                    AcquisitionError aError = AcquisitionError.UNKNOWN;

                    if (Enum.IsDefined(typeof(AcquisitionError), result.Status))
                    {
                        aError = (AcquisitionError)result.Status;
                    }

                    String msg = String.Format("Captura de digital {0}", aError.ToString());
                    MessageBox.Show(msg);

                    if (aError == AcquisitionError.OK)
                    {
                        Bitmap b = CreateGreyscaleBitmap(result.ImageBuffer as byte[], result.Width, result.Height);
                        mDeviceDisplay.Image = b;
                        return b;
                    }

                    break;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }

            return null;
        }

        private byte[] ExtractTemplateFromBitmap(Bitmap bmp)
        {
            Coder coder = new Coder();
            coder.TemplateFormat = TemplateFormat.ANSI_378;
            ICoderResult coderResult = coder.EnrollBitmap(bmp, 2);

            return coderResult.Template as byte[];
        }

        private void btSalvar_Click(object sender, RoutedEventArgs e)
        {
            if (mDataContext != null)
            {
                mDataContext.SaveChanges();
                MessageBox.Show("Dados salvos com sucesso!");
            }
            else
            {
                MessageBox.Show("Nenhuma pessoa selecionada");
            }
        }

        private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e)
        {
            mDeviceConnectMonitor.Abort();
            mApp.Shutdown();
        }

        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            tbUsuarioLogado.Text = mApp.UsuarioLogado;
        }

        public void Dispose()
        {
            mDevice.Dispose();
        }
    }
}

XAML:

<Window
    x:Class="ColetaDigital.View.PessoaWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:wf="clr-namespace:System.Windows.Forms;assembly=System.Windows.Forms"
    mc:Ignorable="d"

    xmlns:vm="clr-namespace:ColetaDigital.ViewModel"

    Title="Bioacesso - Captura de Digitais"

    Height="716"
    Width="1242"

    MinHeight="600"
    MinWidth="842"

    Closing="Window_Closing"
    Loaded="Window_Loaded"
    >

    <Window.Resources>
        <vm:PessoasViewModel x:Key="PessoasViewModel"/>

        <CollectionViewSource
            x:Key="cvsPessoas"
            Source="{StaticResource PessoasViewModel}"
            Filter="CollectionViewSource_Filter"
            />
    </Window.Resources>

    <Grid>
        <GroupBox Header="Pesquisa" Margin="20,20,740,100">
            <Grid>
                <TextBox
                    Margin="10,10,10,0"
                    TextWrapping="Wrap"
                    VerticalAlignment="Top"
                    x:Name="tbFilter"

                    KeyUp="tbFilter_KeyUp"
                    />

                <DataGrid
                    AutoGenerateColumns="False"
                    IsSynchronizedWithCurrentItem="True"
                    CanUserAddRows="False"
                    IsReadOnly="true"
                    Margin="10,53,10,10"

                    HorizontalGridLinesBrush="#cac0c0"
                    VerticalGridLinesBrush="#cac0c0"

                    ItemsSource="{Binding Source={StaticResource cvsPessoas}}"
                    x:Name="dgPessoas"

                    SelectionChanged="dgPessoas_SelectionChanged"
                    >

                    <DataGrid.Columns>
                        <DataGridTextColumn Header="Codigo" Binding="{Binding Codigo}" Width="60"/>
                        <DataGridTextColumn Header="Nome" Binding="{Binding Nome}" Width="*"/>
                        <DataGridTextColumn Header="Tipo" Binding="{Binding Tipo}" Width="150"/>
                    </DataGrid.Columns>

                    <DataGrid.CellStyle>
                        <Style TargetType="DataGridCell">

                            <Setter Property="BorderThickness" Value="0" />
                            <Setter Property="Padding" Value="6 3" />

                            <Setter Property="Template">
                                <Setter.Value>
                                    <ControlTemplate TargetType="{x:Type DataGridCell}">
                                        <Border Padding="{TemplateBinding Padding}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" SnapsToDevicePixels="True">
                                            <ContentPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
                                        </Border>
                                    </ControlTemplate>
                                </Setter.Value>
                            </Setter>

                        </Style>
                    </DataGrid.CellStyle>
                </DataGrid>
            </Grid>
        </GroupBox>

        <GroupBox Header="Dados da Pessoa" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0,20,20,0" Width="712" Height="193">
            <Grid>
                <Image Source="/ColetaDigital;component/Assets/Images/no-image.png" Width="150" Height="150" VerticalAlignment="Top" HorizontalAlignment="Left" Stretch="Fill" Margin="10,10,0,0" x:Name="imgFoto"/>

                <!-- Código -->
                <TextBlock Foreground="#ed6c44" HorizontalAlignment="Left" Margin="170,10,0,0" TextWrapping="Wrap" Text="CÓDIGO" VerticalAlignment="Top" FontSize="14"/>
                <TextBlock HorizontalAlignment="Left" Margin="170,27,0,0" TextWrapping="Wrap" Text="" VerticalAlignment="Top" FontSize="16" x:Name="tbCodigo"/>
                <!-- Código -->

                <!-- Tipo -->
                <TextBlock Foreground="#ed6c44" HorizontalAlignment="Right" Margin="0,10,10,0" TextWrapping="Wrap" Text="TIPO" VerticalAlignment="Top" FontSize="14"/>
                <TextBlock HorizontalAlignment="Right" Margin="0,27,10,0" TextWrapping="Wrap" Text="" VerticalAlignment="Top" FontSize="16" x:Name="tbTipo"/>
                <!-- Tipo -->

                <!-- Nome -->
                <TextBlock Foreground="#ed6c44" HorizontalAlignment="Left" Margin="170,60,0,0" TextWrapping="Wrap" Text="NOME" VerticalAlignment="Top" FontSize="14"/>
                <TextBlock HorizontalAlignment="Left" Margin="170,77,0,0" TextWrapping="Wrap" Text="" VerticalAlignment="Top" FontSize="16" x:Name="tbNome"/>
                <!-- Nome -->
            </Grid>
        </GroupBox>

        <GroupBox Header="Captura da Digital Principal" HorizontalAlignment="Right" Margin="0,213,501,100" Width="231">
            <Grid>
                <WindowsFormsHost Visibility="Visible" Margin="11,11,11,112">
                    <WindowsFormsHost.Child>
                        <wf:PictureBox x:Name="picPrincipal"/>
                    </WindowsFormsHost.Child>
                </WindowsFormsHost>

                <Border BorderBrush="#c7c7c7" BorderThickness="1" Margin="10,10,10,111"/>

                <ProgressBar Margin="10,0,10,96" Maximum="120" x:Name="pbPrincipal" Height="10" VerticalAlignment="Bottom"/>
                <TextBox Margin="10,10,10,53" TextWrapping="Wrap" VerticalAlignment="Bottom" x:Name="tbPrincipal"/>

                <Button Content="DESCARTAR" VerticalAlignment="Bottom" HorizontalAlignment="Left" Margin="10" Width="97" x:Name="btPrincipalDescartar"/>
                <Button Content="CAPTURAR" VerticalAlignment="Bottom" HorizontalAlignment="Right" Margin="10" Width="97" x:Name="btPrincipalCapturar" Click="btPrincipalCapturar_Click"/>
            </Grid>
        </GroupBox>

        <GroupBox Header="Captura da Digital Secundária" HorizontalAlignment="Right" Margin="0,213,259,100" Width="231">
            <Grid>
                <WindowsFormsHost Visibility="Visible" Margin="11,11,11,112">
                    <WindowsFormsHost.Child>
                        <wf:PictureBox x:Name="picSecundaria"/>
                    </WindowsFormsHost.Child>
                </WindowsFormsHost>

                <Border BorderBrush="#c7c7c7" BorderThickness="1" Margin="10,10,10,111"/>

                <ProgressBar Margin="10,0,10,96" Maximum="120" x:Name="pbSecundaria" Height="10" VerticalAlignment="Bottom"/>
                <TextBox Margin="10,10,10,53" TextWrapping="Wrap" VerticalAlignment="Bottom" x:Name="tbSecundaria"/>

                <Button Content="DESCARTAR" VerticalAlignment="Bottom" HorizontalAlignment="Left" Margin="10" Width="97" x:Name="btSecundariaDescartar"/>
                <Button Content="CAPTURAR" VerticalAlignment="Bottom" HorizontalAlignment="Right" Margin="10" Width="97" x:Name="btSecundariaCapturar" Click="btSecundariaCapturar_Click"/>
            </Grid>
        </GroupBox>

        <GroupBox Header="Captura da Digital do Pânico" HorizontalAlignment="Right" Margin="0,213,20,100" Width="231">
            <Grid>
                <WindowsFormsHost Visibility="Visible" Margin="11,11,11,112">
                    <WindowsFormsHost.Child>
                        <wf:PictureBox x:Name="picPanico"/>
                    </WindowsFormsHost.Child>
                </WindowsFormsHost>
                <Border BorderBrush="#c7c7c7" BorderThickness="1" Margin="10,10,10,111" />

                <ProgressBar Margin="10,0,10,96" Maximum="120" x:Name="pbPanico" Height="10" VerticalAlignment="Bottom"/>
                <TextBox Margin="10,0,10,53" TextWrapping="Wrap" VerticalAlignment="Bottom" x:Name="tbPanico"/>

                <Button Content="DESCARTAR" VerticalAlignment="Bottom" HorizontalAlignment="Left" Margin="10" Width="97" x:Name="btPanicoDescartar"/>
                <Button Content="CAPTURAR" VerticalAlignment="Bottom" HorizontalAlignment="Right" Margin="10" Width="97" x:Name="btPanicoCapturar" Click="btPanicoCapturar_Click"/>
            </Grid>
        </GroupBox>

        <Button Content="SALVAR" VerticalAlignment="Bottom" HorizontalAlignment="Right" Margin="0,0,21,52" Width="97" x:Name="btSalvar" Click="btSalvar_Click"/>

        <StatusBar VerticalAlignment="Bottom" Padding="9,5">
            <StatusBarItem>
                <TextBlock Text="Leitor desconectado" x:Name="lblPlugLeitor" />
            </StatusBarItem>

            <StatusBarItem HorizontalAlignment="Right">
                <TextBlock Text="" x:Name="tbUsuarioLogado" />
            </StatusBarItem>
        </StatusBar>
    </Grid>
</Window>
  • What happens is that your application is trying to access a file that doesn’t exist, and you don’t treat it by calling a Failfast(). You read a file using the absolute path?

  • The strange thing is that I don’t read any files. Could it be the dependencies? They are being added normally within the release or debug folder. Another detail is that this class: Coletigital.View.Personal Window is relative to a shaman. will be that errors in the xaml can cause it, to work inside the visual studio and not outside?

  • It’s very likely that this is a problem with references. Share your code for us to review.

  • I posted the class with its respective XAML. I don’t know if the error is in this. Windows Log says yes. The code is already a little extensive so I don’t know how to post it complete

  • When trying to run the application from within Visual Studio, as release instead of debug, I am presented with a message "Your app has entered a break state, but there is no code to show because all threads Were executing External code (typically system or framework code)". I’m sensing that this may help me resolve the issue, but vs does not show more details of the error. Do you know how to identify errors that occur this way? Apparently it is in XAML.

  • It seems to me an unexpected error it open the break state. Tried to continue running to see if an exception rolls?

  • does not create an exception, only for the execution.

  • If I delete the Personal Screen, the application runs. It’s something on that screen even.

  • probably he goes into break state because you haven’t implemented catch (Exception) { }for 3 times. Can you check this? probably is the reason your app breaks. If it is I turn that comment into a reply.

  • did not understand, you mean, implement a Try without catch for 3 times? or fail to treat any kind of exception for 3 times?

Show 6 more comments
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.