3
votes

I had developed a Desktop Application in .Net. I had published and deployed it in my Client's System. But while my client running that setup, an error message is displayed :

Unable to install or run the application. The application requires that assembly Microsoft.SqlServer.Diagnastics.STrace Version 10.0.0.0 be installed in the Global Assembly Cache (GAC) first

What should I do for this ?

4
You need to include this file as a prerequisite in your setup program - edepperson
sorry, i cant able to understand.. - RobinHood

4 Answers

2
votes

Open project Properties form Solution explorer in visual studio

Properties->Publish -> Application Files

In Applications Files window check Show all files at the right bottom. change publish Status of "Microsoft.SqlServer.Types.dll" "Prerequisite(Auto)" to Include click ok and publish Application.

1
votes

Probably, this dll is not present in Global Assembly Cache.

you can add an assembly to GAC by following command:

GACUTIL –i <Path to Microsoft.SqlServer.Diagnostics.STrace.dll>
0
votes

to find if STrace.dll file is present on your client computer, you can search it with this command line: dir Microsoft.SqlServer.Diagnostics.STrace.dll /s

if the file is found, use the previous anwser command line to add the dll to the global asembly cache

If not, you have to add this file as prerequisit in your deployment project if you have a setup project (lik installshield / MS setup project / Clickonce project, the prerequisit can be added on your setup project properties.

when you add a prerequisit, you should be able to choose if the prerequisit has to be packaged with your application or downloaded from the publisher site.

0
votes

What solved my problem was I had to do what @ShahidRaees did except include all of the assemblies. I selected all of them except for the file ending in .pdb.

Selecting all of them should automatically update the GAC when you install the program, but I'm not 100% sure.