Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Inexplicable Crash
Message
De
05/04/2014 18:40:41
 
 
À
Tous
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Titre:
Inexplicable Crash
Versions des environnements
Environment:
C# 4.0
OS:
Vista
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Desktop
Divers
Thread ID:
01598097
Message ID:
01598097
Vues:
75
Hi,

I have the following code compiled into en executable and running successfully at multiple sites. At one site in particular the exe just crashes without any error displaying, just a notice from Windows that the exe has crashed. The Event Log shows this:

Faulting application ProvisionClient.exe, version 1.0.0.0, time stamp 0x53408368, faulting module System.EnterpriseServices.Wrapper.dll, version 4.0.30319.18408, time stamp 0x5231093c, exception code 0xc0000005, fault offset 0x00015d65, process id 0x%9, application start time 0x%10.

This is my code, any ideas what I can do to work out what is going wrong?
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using System.Data;
using System.Data.SqlClient;

using Microsoft.Synchronization;
using Microsoft.Synchronization.Data;
using Microsoft.Synchronization.Data.SqlServer;

using System.Configuration;
using System.IO;

namespace ProvisionServer
{
    class Program
    {
        static void Main(string[] args)
        {
            try
            {
                Console.WriteLine("Getting connection string");
                string serverConnection = ConfigurationManager.ConnectionStrings["Server"].ConnectionString;

                // connect to server database
                Console.WriteLine("connect to server database");
                SqlConnection serverConn = new SqlConnection(serverConnection);

                // define a new scope named CompleteScope
                DbSyncScopeDescription scopeDesc = new DbSyncScopeDescription("CompleteScope");

                // add the description of all the tables from the database
                //DbSyncTableDescription tableDesc = SqlSyncDescriptionBuilder.GetDescriptionForTable("Accounts", serverConn);

                // add the table description to the sync scope definition
                //scopeDesc.Tables.Add(tableDesc);

                //tableDesc = SqlSyncDescriptionBuilder.GetDescriptionForTable("AccountTypes", serverConn);
                //scopeDesc.Tables.Add(tableDesc);

                DbSyncTableDescription tableDesc = SqlSyncDescriptionBuilder.GetDescriptionForTable("AppConfig", serverConn);
                scopeDesc.Tables.Add(tableDesc);

                tableDesc = SqlSyncDescriptionBuilder.GetDescriptionForTable("ApptTypes", serverConn);
                scopeDesc.Tables.Add(tableDesc);

                tableDesc = SqlSyncDescriptionBuilder.GetDescriptionForTable("Attendance", serverConn);
                scopeDesc.Tables.Add(tableDesc);

                tableDesc = SqlSyncDescriptionBuilder.GetDescriptionForTable("AttendanceDetails", serverConn);
                scopeDesc.Tables.Add(tableDesc);

                tableDesc = SqlSyncDescriptionBuilder.GetDescriptionForTable("Branches", serverConn);
                scopeDesc.Tables.Add(tableDesc);

                tableDesc = SqlSyncDescriptionBuilder.GetDescriptionForTable("CLLabOrder", serverConn);
                scopeDesc.Tables.Add(tableDesc);

                tableDesc = SqlSyncDescriptionBuilder.GetDescriptionForTable("CLTrials", serverConn);
                scopeDesc.Tables.Add(tableDesc);

                tableDesc = SqlSyncDescriptionBuilder.GetDescriptionForTable("CreditNotes", serverConn);
                scopeDesc.Tables.Add(tableDesc);

                tableDesc = SqlSyncDescriptionBuilder.GetDescriptionForTable("Discounts", serverConn);
                scopeDesc.Tables.Add(tableDesc);

                tableDesc = SqlSyncDescriptionBuilder.GetDescriptionForTable("Drawings", serverConn);
                scopeDesc.Tables.Add(tableDesc);

                //tableDesc = SqlSyncDescriptionBuilder.GetDescriptionForTable("ErrorLog", serverConn);
                //scopeDesc.Tables.Add(tableDesc);

                tableDesc = SqlSyncDescriptionBuilder.GetDescriptionForTable("ExamDiagnoses", serverConn);
                scopeDesc.Tables.Add(tableDesc);

                tableDesc = SqlSyncDescriptionBuilder.GetDescriptionForTable("ExamLensType", serverConn);
                scopeDesc.Tables.Add(tableDesc);

                tableDesc = SqlSyncDescriptionBuilder.GetDescriptionForTable("Exams", serverConn);
                scopeDesc.Tables.Add(tableDesc);

                tableDesc = SqlSyncDescriptionBuilder.GetDescriptionForTable("Holidays", serverConn);
                scopeDesc.Tables.Add(tableDesc);

                tableDesc = SqlSyncDescriptionBuilder.GetDescriptionForTable("ItemCategories", serverConn);
                scopeDesc.Tables.Add(tableDesc);

                tableDesc = SqlSyncDescriptionBuilder.GetDescriptionForTable("Items", serverConn);
                scopeDesc.Tables.Add(tableDesc);

                tableDesc = SqlSyncDescriptionBuilder.GetDescriptionForTable("LabOrderLensType", serverConn);
                scopeDesc.Tables.Add(tableDesc);

                tableDesc = SqlSyncDescriptionBuilder.GetDescriptionForTable("LabOrders", serverConn);
                scopeDesc.Tables.Add(tableDesc);

                tableDesc = SqlSyncDescriptionBuilder.GetDescriptionForTable("Letters", serverConn);
                scopeDesc.Tables.Add(tableDesc);

                //tableDesc = SqlSyncDescriptionBuilder.GetDescriptionForTable("LoginHistory", serverConn);
                //scopeDesc.Tables.Add(tableDesc);

                tableDesc = SqlSyncDescriptionBuilder.GetDescriptionForTable("Lookups", serverConn);
                scopeDesc.Tables.Add(tableDesc);

                tableDesc = SqlSyncDescriptionBuilder.GetDescriptionForTable("LookupTypes", serverConn);
                scopeDesc.Tables.Add(tableDesc);

                tableDesc = SqlSyncDescriptionBuilder.GetDescriptionForTable("MemoAE", serverConn);
                scopeDesc.Tables.Add(tableDesc);

                tableDesc = SqlSyncDescriptionBuilder.GetDescriptionForTable("MsgSvc", serverConn);
                scopeDesc.Tables.Add(tableDesc);

                //tableDesc = SqlSyncDescriptionBuilder.GetDescriptionForTable("Navigator", serverConn);
                //scopeDesc.Tables.Add(tableDesc);

                tableDesc = SqlSyncDescriptionBuilder.GetDescriptionForTable("PatientAddresses", serverConn);
                scopeDesc.Tables.Add(tableDesc);

                tableDesc = SqlSyncDescriptionBuilder.GetDescriptionForTable("PatientEmails", serverConn);
                scopeDesc.Tables.Add(tableDesc);

                tableDesc = SqlSyncDescriptionBuilder.GetDescriptionForTable("PatientPhones", serverConn);
                scopeDesc.Tables.Add(tableDesc);

                tableDesc = SqlSyncDescriptionBuilder.GetDescriptionForTable("PatientRecallPlans", serverConn);
                scopeDesc.Tables.Add(tableDesc);

                tableDesc = SqlSyncDescriptionBuilder.GetDescriptionForTable("Patients", serverConn);
                scopeDesc.Tables.Add(tableDesc);

                tableDesc = SqlSyncDescriptionBuilder.GetDescriptionForTable("Payments", serverConn);
                scopeDesc.Tables.Add(tableDesc);

                tableDesc = SqlSyncDescriptionBuilder.GetDescriptionForTable("PaymentsDetails", serverConn);
                scopeDesc.Tables.Add(tableDesc);

                tableDesc = SqlSyncDescriptionBuilder.GetDescriptionForTable("RecallDetails", serverConn);
                scopeDesc.Tables.Add(tableDesc);

                tableDesc = SqlSyncDescriptionBuilder.GetDescriptionForTable("RecallNotices", serverConn);
                scopeDesc.Tables.Add(tableDesc);

                tableDesc = SqlSyncDescriptionBuilder.GetDescriptionForTable("RecallPlans", serverConn);
                scopeDesc.Tables.Add(tableDesc);

                tableDesc = SqlSyncDescriptionBuilder.GetDescriptionForTable("Recalls", serverConn);
                scopeDesc.Tables.Add(tableDesc);

                tableDesc = SqlSyncDescriptionBuilder.GetDescriptionForTable("RefundDetails", serverConn);
                scopeDesc.Tables.Add(tableDesc);

                tableDesc = SqlSyncDescriptionBuilder.GetDescriptionForTable("Refunds", serverConn);
                scopeDesc.Tables.Add(tableDesc);

                tableDesc = SqlSyncDescriptionBuilder.GetDescriptionForTable("ReportCatalog", serverConn);
                scopeDesc.Tables.Add(tableDesc);

                tableDesc = SqlSyncDescriptionBuilder.GetDescriptionForTable("Sales", serverConn);
                scopeDesc.Tables.Add(tableDesc);

                tableDesc = SqlSyncDescriptionBuilder.GetDescriptionForTable("SalesDetails", serverConn);
                scopeDesc.Tables.Add(tableDesc);

                tableDesc = SqlSyncDescriptionBuilder.GetDescriptionForTable("Schedule", serverConn);
                scopeDesc.Tables.Add(tableDesc);

                tableDesc = SqlSyncDescriptionBuilder.GetDescriptionForTable("SecuredItems", serverConn);
                scopeDesc.Tables.Add(tableDesc);

                tableDesc = SqlSyncDescriptionBuilder.GetDescriptionForTable("SecurityAccess", serverConn);
                scopeDesc.Tables.Add(tableDesc);

                tableDesc = SqlSyncDescriptionBuilder.GetDescriptionForTable("StockReceipts", serverConn);
                scopeDesc.Tables.Add(tableDesc);

                tableDesc = SqlSyncDescriptionBuilder.GetDescriptionForTable("Transfers", serverConn);
                scopeDesc.Tables.Add(tableDesc);

                tableDesc = SqlSyncDescriptionBuilder.GetDescriptionForTable("UserAccExceptions", serverConn);
                scopeDesc.Tables.Add(tableDesc);

                tableDesc = SqlSyncDescriptionBuilder.GetDescriptionForTable("UserGroups", serverConn);
                scopeDesc.Tables.Add(tableDesc);

                //tableDesc = SqlSyncDescriptionBuilder.GetDescriptionForTable("UserPrefs", serverConn);
                //scopeDesc.Tables.Add(tableDesc);

                tableDesc = SqlSyncDescriptionBuilder.GetDescriptionForTable("Users", serverConn);
                scopeDesc.Tables.Add(tableDesc);

                tableDesc = SqlSyncDescriptionBuilder.GetDescriptionForTable("UsrGrpXRef", serverConn);
                scopeDesc.Tables.Add(tableDesc);

                tableDesc = SqlSyncDescriptionBuilder.GetDescriptionForTable("Vacation", serverConn);
                scopeDesc.Tables.Add(tableDesc);

                tableDesc = SqlSyncDescriptionBuilder.GetDescriptionForTable("VAT", serverConn);
                scopeDesc.Tables.Add(tableDesc);

                tableDesc = SqlSyncDescriptionBuilder.GetDescriptionForTable("Vendors", serverConn);
                scopeDesc.Tables.Add(tableDesc);

                tableDesc = SqlSyncDescriptionBuilder.GetDescriptionForTable("VFPCommands", serverConn);
                scopeDesc.Tables.Add(tableDesc);

                // create a server scope provisioning object based on the ProductScope
                SqlSyncScopeProvisioning serverProvision = new SqlSyncScopeProvisioning(serverConn, scopeDesc);

                // skipping the creation of table since table already exists on server
                serverProvision.SetCreateTableDefault(DbSyncCreationOption.Skip);

                // start the provisioning process
                serverProvision.Apply();
            }
            catch (Exception error)
            {
                using (StreamWriter tw = new StreamWriter("BPOSync.log", true))
                {
                    // write a line of text to the file
                    tw.WriteLine(DateTime.Now);
                    tw.WriteLine("Error");
                    tw.WriteLine(error.ToString());
                    //tw.WriteLine(error.InnerException); 
                    tw.WriteLine("---");

                    // close the stream
                    tw.Close();
                }
            }
        }
    }
}
Frank.

Frank Cazabon
Samaan Systems Ltd.
www.samaansystems.com
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform