ClickOnce with report viewer control

Installing SSRS Report Viewer component for Visual Studio 2017 (VS2017) using NUGET

For Visual Studio 2017, the SQL server reporting services, report viewer component, for web forms or windows forms has been put into a NuGet package. This means it can be installed into projects where it is required, with the added benefit of no longer needing a client report viewer runtime msi installer for the client, that previously was used to install the runtime report viewer components into the GAC.

To upgrade a solution from using the old report viewer component, open all the references nodes in the project tree, remove all the old .dll references to the original report viewer .dll files. Then install the NUGET package for the projects in the solutions within the solution that require it.

To install the NuGet package, Right click the project, select Manage NuGet Packages,

Select the Browse option and then search for “ReportViewerControl” as shown.

2018-01-05_12-35-12

Take care to install the Windows Forms or Web Forms version as required and that it is the newer version, it is easy to click the wrong one as there are a few similar products in there.

This will pull down the required .dlls in to the project.

If you need the control in the visual control toolbox, then right click the toolbox area, select “choose items”, then in the .NET Framework Components Tab use the Browse button to browse to the control’s dll. This will be located in the “\packages\Microsoft.ReportingServices.ReportViewerControl.Winforms.140.1000.523\lib\net40” folder for the example where we installed the version shown above (note the version number). The packages folder is usually found with the solution or project files somewhere.  Select the file “Microsoft.ReportViewer.WinForms.dll” within that folder.

This will add the control to the toolbox.

2018-01-05_12-41-26

 

Problems:

I experienced some real problems after this when trying to deploy the application with the ReportViewer control via ClickOnce deployment.

On install of a non-developer machine, various errors occurred.

These were due to the “Microsoft.ReportViewer.Design.dll” library being referenced by the project. This meant the project then had visual studio dependencies introduced. Removing this file caused the application deployment to work again as expected.

"assembly Microsoft.VisualStudio.Text.Logic version 14.0.0.0 be installed in the GAC"

The above was caused by the report viewer design dll being referenced by the project, causing a dependency that was picked up by the ClickOnce manifest generator.

Microsoft.VisualStudio.Text.Logic installed in teh Global Assembly Cache

Assembly Microsoft.VisualStudio.Diagnostics.Assert needs to be installed in the Global Assembly Cache

image

Unable to install or run the application. The application requires that assembly Microsoft.VisualStudio.Diagnostics.Assert Version 14.0.0.0 be installed in the Global Assembly Cache (GAC) first.

Silent install of Microsoft Dynamics GP eConnect


I needed to do a silent install of eConnect for Dynamics GP but couldn’t find the documentation on how to do it, I figured it out and document it here for future reference:


The basic root command construct for a msi silent install is something like:

msiexec /i my.msi /qb+

The switch i is for install then the name of installer and then the silent install options, where it can be tweaked depending upon how silent we need it:

q , qn - No UI

qb - Basic UI. Use qb! to hide the Cancel button.

qr - Reduced UI with no modal dialog box displayed at the end of the installation.

qf - Full UI and any authored FatalError, UserExit, or Exit modal dialog boxes at the end.

qn+ - No UI except for a modal dialog box displayed at the end.

qb+ - Basic UI with a modal dialog box displayed at the end. The modal box is not displayed if the user cancels the installation. Use qb+! or qb!+ to hide the Cancel button.

qb- - Basic UI with no modal dialog boxes. Please note that /qb+- is not a supported UI level. Use qb-! or qb!- to hide the Cancel button.


eConnect needs a SQL user account and an account to run the service under. These can be supplied as parameters like so:


USERDOMAIN={domain} USERNAME={username} USERPASSWORD={passoword} SQL_SERVER_NAME={SQLserverName} SQL_USER_ID={sqlUser} SQL_USER_PASSWORD={password}


So this becomes:

msiexec /i "Microsoft_DynamicsGP18_eConnect_x64_en-us.msi" /qb+ USERDOMAIN={domain} USERNAME={ServiceUsername} USERPASSWORD={password} SQL_SERVER_NAME={SQLserverInstanceName} SQL_USER_ID={sqlUser} SQL_USER_PASSWORD={password}


Which will install eConnect for you with limited UI interaction.

2017-12-10_23-24-36


Do comment if you found this useful – motivates me to write more!

ClickOnce Deployment failing–requires installing into GAC

Note to myself for future for this issue: After making some changes to an application, I went to publish it using Visual Studio, as a ClickOnce application. On trying to install the resulting published application I got presented with the following error.

Unable to install or run the application. The application requires that assembly Newtonsoft.Json Version 6.0.0.0 be installed in the Global Assembly Cache (GAC) first

Unable to install or run the application. The application requires that assembly Newtonsoft.Json Version 6.0.0.0 be installed in the Global Assembly Cache (GAC) first.

I searched for any reference, or mention of the NewtonSoft 6 version but found nothing, anywhere in any projects involved. There was a old folder in the NUGET cache for it, so it had been in use at some point.

Totally stumped, the breakthrough came when looking at the build log. There were warnings in there about the version of Newtonsoft.

Warning message in build log

Ah – that makes more sense, so I added a mapping into the app.config.

Binding Redirect to correct the issue from version 6 to 10

<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30AD4FE6B2A6AEED" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="10.0.0.0"/>

After publishing the application launched correctly again.

There must be some 3rd party dependency somewhere that is looking to the old version but I can’t track it down. Remember ClickOnce applications run in a sandbox.

** If you found this useful, drop me a comment to let me know, as it motivates me to blog more!

Retail Microsoft Dynamics GP Point of Sale Systems (POS)

What retail point of sale (POS), retail store, till Systems are compatible with and also work well with Microsoft Dynamics GP?

On my investigation, the market seems to be sparse with only a few products out there:

Compass POS- seems to get the most praise and most mentions

Salespad POS – very experienced in Dynamics GP

Retail Edge – reports of the product being integrated successfully with GP

Microsoft Dynamics Retail Management System (RMS) (as good as retired not worth looking at)

 

If you know of any others, please leave me a comment and I will add them to the list.