WPF CrystalReportViewer VS2010 SP1 - Logon Failed - wpf

The code snippet below works absolutely fine on my development PC and another users PC.
The application was installed to the other users PC using 'ClickOnce'.
ReportWindow reportWindow = new ReportWindow();
Reports.rptDrawAmountSummary rpt = new Reports.rptDrawAmountSummary();
rpt.SetDatabaseLogon(clsArbitrageDB.userID, clsArbitrageDB.password);
reportWindow.crystalReportsViewer1.ViewerCore.ReportSource = rpt;
When I attempt to run the application installed (using ClickOnce) on a different PC the report presents a dialog box displaying the ServerName and two input fields one for UserID (pre-populated) and one for the Password (empty). When I enter the password it says 'Logon Failed'.
The information is definitely correct because this same information is used to provide user access to the application.
I am relatively sure it is WPF CrystalReportViewer related but unsure how to resolve.
UPDATE: Have since determined that if I install the application on any PC that does not have VS2010 installed it has the error. Also, on the PCs with VS2010 installed Crystal Reports for VS2010 doesn't even have to be installed.

Related

Publish WPF + EF Core App with Windows Installer Project

I have tried to create an .exe file to my WPF App and SQL Server related databse with EF Core using Windows Setup Installer Project.
I included all the dll's files from /bin/Release and built it for any CPU.
The Setup Project has been created successfully and it worked on my PC as I expected.
Otherwise when I try to install the Setup File on another PC, I can't even open it up and see what's wrong.
I guess the problem comes from the database but I can't find anything helpful on the internet.
So you get the application installed, run it and nothing happens, right? Here is what you do:
Run it. Watch nothing happen
Hit the Windows key and type "Event"
When "Event Viewer" appears in the list of applications, run it
In Event Viewer, go to Windows Logs >> Application
Near the top there will probably be an error entry. It will probably be related to your application. And if you were missing a key file needed to run your application, like a DLL, the name of the file will probably be in there in the details section
Go back to your installer and add that missing file. Or if that file is part of some support package (like, say, MS Redistributable for Visual C++) then add the installer for that too.

Silverlight app not running on Windows Phone 10

We have a Silverlight app written for Windows Phone 8.
Everyone in the company has upgraded to Windows Phone 10 and the app still install and runs perfectly from the Microsoft Store. Except for one phone! Unlocking the phone for development and running it in debug gives the following errors in the output...
Exception thrown: 'System.IO.FileNotFoundException' in mscorlib.ni.dll
Exception thrown: 'System.TypeLoadException' in mscorlib.ni.dll
Getting the detailed output for the FileNotFoundException gives the following...
Additional information: Could not load file or assembly
'System.Windows.RuntimeHost, Version=2.0.6.0,
Culture=neutral, PublicKeyToken=7cec85d7bea7798e'
or one of its dependencies. The system cannot find the file specified.
The System.Windows.Runtimehost dll is the host for running a Silverlight application. That would explain why it does not run. But how can this be missing from the phone and not from any other phone?
We tried a factory reset of the phone and it still does not work.
Anyone else seem this, any ideas?
I managed to get a suggestion from a Microsoft forum that worked.
I used the Windows Device Recovery Tool that allows a new image to be downloaded and then installed on the phone. It automatically pulls down the correct image for your make/model of phone. I assume these are hosted at Microsoft. After the phone was updated with the new image it worked as expected.

WPF application works fine on my pc but not in the client PC

I have created a WPF application (web scraper), the debug version works as expected on my pc but after copying the files to the clients it shows the User interface and after pressing the button to scrap it doesn't do anything, I am having the same OS as the client (Windows 7 64 bit), I can't guess what the problem is ? can anyone help me ?
Alongside any other diagnostics you are doing to investigate why you can run an app on your machine, but a client cannot run it on his machine is to double check the roles you are both in...
As a developer, you most likely run your development computer with
Full Trust permissions. Therefore, you do not see the same security
exceptions when you debug the application that users may see when they
run it with restricted permissions.
In order to catch these exceptions, you have to debug the application
with the same permissions as the end user. Debugging with restricted
permissions can be enabled on the Security page of the Project
Designer.
When you debug an application with restricted permissions, exceptions
will be raised for any code security demands that have not been
enabled on the Security page. An exception helper will appear,
providing suggestions about how to modify your code to prevent the
exception.
Visual Studio
Here is a snippet to pop up all the various roles...
WindowsIdentity wi = WindowsIdentity.GetAnonymous();
WindowsPrincipal wp = new WindowsPrincipal(wi);
foreach (var e in Enum.GetValues(typeof (WindowsBuiltInRole)))
{
if (wp.IsInRole(e.ToString()))
{
MessageBox.Show(String.Format("{0} is in role {1}", wp.Identity.Name, e.ToString()));
}
else
{
MessageBox.Show(String.Format("{0} is NOT in role {1}", wp.Identity.Name, e.ToString()));
}
}
These things will help you further investigate why the same program behaves differently on two computers driven by two different people.

Unable to Deploy WP7 SDK Application on Windows Phone 8 Through VS2012

I have Registered my device for developer.
But after choosing device in VS2012 and start deploying , It Gives error .
Unable to install application. The maximum number of developer applications on this phone has been reached. Please uninstall a developer application and try again.
I am new to deployment on device . Please suggest .
Do you happen to have multiple Windows Phone 8 devices? It turns out that if you register two devices under the same name, this problem arises. I had registered two Windows Phone Devices for development, but I hadn't given them a unique name (they were both named the default, which is Windows Phone, I think). On the first device, I had multiple test apps installed and, obviously, on the second device, nothing was installed, hence my frustration regarding the error. I did the following to make it work:
Remove the phone(s) from the dev portal,
Unregister both devices using Windows Phone Developer Registration.
Rename the devices, making sure their names are not the same.
Re-register the phones again, now with new, unique names.
I hope it works for you as well.
Uninstall the unwanted applications from the device.
Restart the device
Try to deploy the solution. It will work now.
It means you have installed three(3) testing app. windows phone have limit of max 3 app installation for debug.
Uninstall one of your previously installed application.
Now deploy your new application again.
Hope will work now.

IIS related System.ExecutionEngineException

After too many hours of research I have come up with nothing to solve this problem.
I am running a WPF program in an .xbap page file being hosted on internet explorer. Running the project in Visual Studio 2010 works just fine and generates no errors.
I want to be able to host the webpage on IIS 7.0 and to browse to it with a windows forms application. To test this I created a new website on port 80 in IIS manager. I then published the project to the local website folder and added the autogenerated project certificate file (projectName_TemporaryKey.pfx) to my Trusted Publishers and Trusted Root Certification Authorities.
My problem is this: whenever I try to browse to the file with internet explorer or with my windows forms program, the wpf program stops working. When pulling up the just-in-time debugger, I am informed that there is a System.ExecutionEngineException but am given no source code, no stack trace, and no data outside of an empty Dictionary enumerable. My guess is that this might have something to do with the database call made in the program to another machine, but I can't prove that.
I've tried several things to solve this including repairing my .NET 4.0 framework and altering permissions but nothing seems to be affect the error.
Does anyone know of a way to get more information on this error, or perhaps a step I may have missed when publishing this project?
Thanks very much.
Some things to check:
Windows event log often includes additional exception information (although usually in an awful format)
Output some trace information from your application so you can follow what's happening
Try attaching a debugger to the WPFHost and then stepping through the code

Resources