部署时Silverlight应用程序无法运行

时间:2012-07-05 09:47:50

标签: silverlight authentication iis deployment nullreferenceexception

编辑:

在MainPage.xaml.cs

public MainPageViewModel ViewModel
        {
            set
            {
                try
                {
                    DataContext = value;
                }
                catch (Exception ex)
                {
                    MessageBox.Show(string.Format("Message: {0} \r\n StackTrace: {1}", ex.Message, ex.StackTrace));
                }
            }
        }

在调试时,没有消息框

部署:

消息:对象引用未设置为对象的实例 StackTrace:

at System.Windows.Data.BindingExpression.SendDataToTarget()
at System.Windows.Data.BindingExpression.SourceAcquired()
at System.Windows.Data.BindingExpression.System.Windows.IDataContextChangedListener.OnDataContextChanged(Object sender, DataContextChangedEventArgs e)
at at System.Windows.WeakDataContextChangedListener.MentorDataContextChanged(Object sender, DataContextChangedEventArgs e)...

0 个答案:

没有答案