2011-06-21 15 views
6

मेरे पास एक बड़े प्रोग्राम में एक मेनू आइटम है जो एक नई विंडो खोलता है। इसमें कुछ भी नहीं हो जाता है, यह कैलेंडर, 3 खाली टेक्स्ट बॉक्स, 3 लेबल, 2 बटन और एक खाली क्रिस्टल रिपोर्ट व्यूअर लोड करता है।प्रारंभकर्ता घटक एक शून्य संदर्भ अपवाद फेंकता है

जब उपयोगकर्ता इसे चलाता है तो कैलेंडर पर क्लिक करता है और यह स्वचालित रूप से चयनित महीने की पहली और अंतिम तिथियों को टेक्स्ट बॉक्स में डाल देता है। एक बटन एक डीबी से डेटा के साथ सीआर रिपोर्ट लोड करता है, दूसरा बटन रिपोर्ट प्रिंट करता है।

यह मेरे सिस्टम पर ठीक काम करता है लेकिन प्रारंभिक घटक एक सहकर्मी प्रणाली पर तैनात किए जाने पर एक संक्षिप्त संदर्भ अपवाद फेंकता है। मैं अपने सिस्टम पर अपवाद को फिर से नहीं बना सकता।

क्या कोई भी इस विचार पर है कि मुझे कहां से शुरू करना चाहिए?

अपडेट किया गया

त्रुटि

System.NullReferenceException: Object reference not set to an instance of an object. 
    at System.Windows.Baml2006.Baml2006Reader.Process_PropertyWithConverter() 
    at System.Windows.Baml2006.Baml2006Reader.Process_OneBamlRecord() 
    at System.Windows.Baml2006.Baml2006Reader.Process_BamlRecords() 
    at System.Windows.Baml2006.Baml2006Reader.Read() 
    at System.Windows.Markup.WpfXamlLoader.TransformNodes(XamlReader xamlReader, XamlObjectWriter xamlWriter, Boolean onlyLoadOneNode, Boolean skipJournaledProperties, Boolean shouldPassLineNumberInfo, IXamlLineInfo xamlLineInfo, IXamlLineInfoConsumer xamlLineInfoConsumer, XamlContextStack`1 stack, IStyleConnector styleConnector) 
    at System.Windows.Markup.WpfXamlLoader.Load(XamlReader xamlReader, IXamlObjectWriterFactory writerFactory, Boolean skipJournaledProperties, Object rootObject, XamlObjectWriterSettings settings, Uri baseUri) 
    at System.Windows.Markup.WpfXamlLoader.LoadBaml(XamlReader xamlReader, Boolean skipJournaledProperties, Object rootObject, XamlAccessLevel accessLevel, Uri baseUri) 
    at System.Windows.Markup.XamlReader.LoadBaml(Stream stream, ParserContext parserContext, Object parent, Boolean closeStream) 
    at System.Windows.Application.LoadComponent(Object component, Uri resourceLocator) 
    at KeyInScreen.RebatesReports.InitializeComponent() 
    at KeyInScreen.RebatesReports..ctor() 
    at KeyInScreen.Menu.FertiliserRebate_Click(Object sender, RoutedEventArgs e) 

XAML कोड

<Window x:Class="KeyInScreen.RebatesReports" 
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    Title="Fertiliser Rebates" WindowState="Maximized" 
    xmlns:my="clr-namespace:SAPBusinessObjects.WPF.Viewer;assembly=SAPBusinessObjects.WPF.Viewer" 
    mc:Ignorable="d" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" Height="700" 
    Width="1350"> 
<Window.Resources> 
    <Style TargetType="{x:Type Label}"> 
     <Setter Property="FontSize" Value="14" /> 
    </Style> 
    <Style TargetType="{x:Type Button}"> 
     <Setter Property="FontSize" Value="14"/> 
    </Style> 
    <Style TargetType="{x:Type Calendar}"> 
     <Setter Property="FontSize" Value="14"/> 
    </Style> 
    <Style TargetType="{x:Type TextBox}"> 
     <Setter Property="FontSize" Value="14"/> 
    </Style> 
</Window.Resources> 

<Grid Background="#FFEFEDDF"> 
    <Grid.RowDefinitions> 
     <RowDefinition Height=".5*"/> 
     <RowDefinition Height=".5*"/> 
     <RowDefinition Height="4*"/> 
     <RowDefinition Height="*"/> 
     <RowDefinition Height="*"/> 
     <RowDefinition Height="*"/> 
     <RowDefinition Height="*"/> 
     <RowDefinition Height="*"/> 
     <RowDefinition Height="*"/> 
     <RowDefinition Height="5*"/> 
    </Grid.RowDefinitions> 
    <Grid.ColumnDefinitions> 
     <ColumnDefinition Width=".2*"/> 
     <ColumnDefinition Width=".7*"/> 
     <ColumnDefinition Width=".7*"/> 
     <ColumnDefinition Width=".7*"/> 
     <ColumnDefinition Width=".5*"/> 
     <ColumnDefinition Width="4*"/> 
     <ColumnDefinition Width=".1*"/> 
    </Grid.ColumnDefinitions> 
    <Calendar x:Name="cDatePicker" Grid.Column="1" Grid.Row="2" Grid.RowSpan="2" Grid.ColumnSpan="2" SelectedDatesChanged="cDatePicker_SelectedDatesChanged" /> 
    <Label Content="Start Date:" Grid.Column="1" Grid.Row="4" Margin="5"/> 
    <TextBox x:Name="txtStartDate" Grid.Column="2" Grid.Row="4" Margin="5" VerticalContentAlignment="Center" /> 
    <Label Content="End Date:" Grid.Column="1" Grid.Row="5" Margin="5"/> 
    <TextBox x:Name="txtEndDate" Grid.Column="2" Grid.Row="5" Margin="5" VerticalContentAlignment="Center"/> 
    <Label Content="Supplier Number:" Grid.Column="1" Grid.Row="6" Margin="5"/> 
    <TextBox x:Name="txtCustomerNumber" Grid.Column="2" Grid.Row="6" Margin="5" VerticalContentAlignment="Center" TabIndex="1" /> 
    <Button x:Name="btnShowRport" Content="View Report" Grid.Column="1" Grid.Row="8" Margin="0,0,10,0" Click="btnShowRport_Click" IsDefault="True" /> 
    <Button x:Name="btnPrintReport" Content=" Print Report" Grid.Column="2" Grid.Row="8" Margin="10,0,0,0" Click="btnPrintReport_Click" /> 
    <my:CrystalReportsViewer x:Name="crReportViewer" Grid.Column="3" Grid.RowSpan="10" HorizontalAlignment="Center" VerticalAlignment="Center" 
           Height="656" Width="845" Margin="94,-7,62,12" ToggleSidePanel="None" Panel.ZIndex="0" Grid.ColumnSpan="3" 
           ShowPrintButton="False" ShowRefreshButton="False" ShowSearchTextButton="False" ShowToggleSidePanelButton="True" 
           ShowToolbar="True" ShowNextPageButton="True" ShowGoToPageButton="True" ShowExportButton="False" 
           ShowCopyButton="False" SnapsToDevicePixels="True" ShowLogo="False" ShowPrevPageButton="True" 
           ShowStatusbar="True" /> 
</Grid> 

धन्यवाद

+2

अपवाद स्टैक ट्रेस देखकर प्रारंभ करें। मानसिक डिबगिंग का कहना है कि शायद आपकी खिड़की की रिपोर्ट व्यूअर (या कुछ अन्य हेवीवेट घटक) निर्माण पर एक आईएफएफ ऑपरेशन (उदाहरण के लिए डेटा स्रोत से कनेक्ट) करने का प्रयास करती है, और यह वह ऑपरेशन है जो आपके सहयोगी की मशीन पर विफल रहता है (एक तक नहीं पहुंच सकता सर्वर, अपने प्रमाण पत्र, आदि के साथ लॉगिन नहीं कर सकते हैं)। – Jon

+0

सत्यापित करें कि क्रिस्टल के सभी घटक उपलब्ध हैं .. क्रिस्टल रिपोर्ट व्यूअर एक अपराधी प्रतीत होता है – V4Vendetta

+0

यह सीआर व्यूअर प्रतीत नहीं होता है। मैं वास्तव में अपवाद स्टैक को समझ नहीं पा रहा हूं लेकिन मुझे लगता है कि समस्या WPF/XAMl – Noelle

उत्तर

2

आप आंतरिक अपवाद को देखने की जरूरत है। जब प्रारंभिक कंपोनेंट कहा जाता है तो यह अन्य कोड को बंद कर सकता है जो अपवाद पैदा कर रहा है। आंतरिक अपवाद आपको आपको आवश्यक सारी जानकारी देनी चाहिए। ध्यान दें कि यह संभव है कि आंतरिक अपवाद में आंतरिक अपवाद होगा। अपने ऐप को इन सभी को फ़ाइल या क्लिपबोर्ड या कुछ लिखने के लिए संशोधित करें।

4

थोड़ा देर हो चुकी है, लेकिन जब आपको इस तरह का एक संक्षिप्त संदर्भ अपवाद मिलता है, तो यह भ्रामक हो सकता है। भीतरी अपवाद अशक्त हो सकता है (मेरे मामले में किया गया था।)

तरह से मुझे पता चला मुद्दा तो सभी बक्सों को चिह्नित करें वी.एस. 2010 गोटो Debug -> Exceptions में

पहला मौका अपवाद सक्षम करने के लिए किया गया था।

0

जब मैं जीएसी (सी: \ विंडोज \ माइक्रोसॉफ्ट.नेट \ असेंबली \ GAC_MSIL => .NET फ्रेमवर्क 4.0 या उच्चतम के लिए जीएसी स्थान) स्थान पर पुराने असेंबली का नाम बदलता/निकालता हूं तो समस्या गायब हो जाती है।

+0

.NET फ्रेमवर्क 3.5 के लिए जीएसी स्थान सी है: \ विंडोज \ माइक्रोसॉफ्ट.नेट \ असेंबली \ GAC_MSIL – Suriya

संबंधित मुद्दे