Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Microsoft.ExceptionMessageBox not being "found"

I have a winform solution that I deploy through clickOnce. There is the Main Project and then a Project called psWinForms. That project has a Reference to Microsoft.ExceptionMessageBox that I use in my custom error reporting.

I have psWinForms as a reference in my Main Project with Copy Local = True.

I have Microsoft.ExceptionMessageBox as a reference in psWinForms with Copy Local = False & Specific Version = False

In Application Files I have Publish Status =Prerequisite(Auto)

I have tried various combinations to no avail.

I looked here on the Test System on the DLL is there.

C:\Program Files\Microsoft SQL Server\90\SDK\Assemblies

I am using the ExceptionMessageBox from SQL version 9.0.242.0 if that makes a difference and the users only have SQL 2005 Express(9.0.1399.0) installed.

So I am very confused as to why my app hangs when I try to throw an error using this....

like image 516
Refracted Paladin Avatar asked Oct 22 '25 02:10

Refracted Paladin


1 Answers

You can't copy and deploy the assembly yourself, it has to be installed as part of the SQL client components. There are different client components for SQL 2008 and SQL 2005, your application has to reference the proper one. So you'll have to ship two different applications, one compiled for SQL 2005 and one for SQL 2008 and your users will have to install the proper one. From Deploying an Exception Message Box Application:

The exception message box is installed by Microsoft SQL Server and is supported for use in your custom Windows applications to improve exception handling. Because the exception message box is installed by all editions of SQL Server except SQL Server Compact 3.5 SP1, you can use it with no additional configuration on any computer on which SQL Server client components, including the SDK, have been installed.

While technically is probably possible to deploy the assembly and add it to the GAC yourself is a bad practice as your dll will not be part of the normal chain of service packs and cummulative upgrade patches.

Also you better clear up with an MS representative whether deploying this dll standalone is OK with the SQL client usage license or not. Every component that can be redistributed under the license has an install msi available for developers to distribute. If this dll does not is a strong indicator that is not allowed to be redistributed by 3rd parties (you).

Update

There is actually a distributable msi (SQLServer2005_EMB.msi, SQLServer2005_EMB_x64.msi) for the ExceptionMessageBox component:

In SQL Server 2005 SP1 and later releases, the exception message box is also provided as a redistributable installation program that you can distribute and deploy with your application... The redistributable installation program for exception message box is available online as part of the Feature Pack for SQL Server 2005 SP1.

like image 193
Remus Rusanu Avatar answered Oct 24 '25 17:10

Remus Rusanu



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!