Reference library problem in Release configuration on another computer - file

I get this error when I open a program I created in Windows Vista in C# with WPF on a computer with Windows XP:
Could not load file or assembly
'Microsoft.Office.Interop.Word,
Version=12.0.0.0, Culture=neutral,
PublicKeyToken=71e9bce111e9429c' or
one of its dependencies. The system
cannot find the file specified.
This is rather strange because MS Office 2007 is installed... and MS Office 2003 seems to be also installed. Could there be some sort of conflict between the two?
Also, .NET framework is installed up to 3.5!
How can I solve this problem?

What was installed first, .NET or MS Office 2007? If Office is installed before the .NET framework, the interop assemblies will not be installed in the GAC.
You could try downloading the PIA redistributable from MS and running it on your XP box: http://www.microsoft.com/downloads/details.aspx?FamilyID=59daebaa-bed4-4282-a28c-b864d8bfa513&displaylang=en. This redistributable will load the MS Office interop assemblies into the GAC.

Related

Windows Forms (.NET Core) is missing in the Visual Studio Community 2019

I have a problem which I struggle for 3 days. It seems that my Visual Studio Community 2019 doesn't want to recognise the ".Net core" for Windows Forms. I even install it manually (downloaded from Microsoft - .NET Core 3.1 SDK) but doesn't help. I used this blog Microsoft blog. They said that I have to install " Windows Forms .NET Core Designer VSIX package" because "it isn’t yet bundled with Visual Studio", but there is no link to download. I don't have ".NET Core" in "Project solutions" and "Visual Studio Installer" (I cannot download it from the installer). The version of VSC 2019 - 16.8.2
SS:
Installer
Project Picker
Installer2
Settings
So I had the same problem and yes you can't find .NET core windows form directly to open windows form that support windows form you will need to first open non .NET framework windows from app there you can select if you want core which version.
Windows Form Application
Selecting Desired Framework
You'd have to select Windows Forms App (.Net) from the available project types and that will open up as the latest .NET core Windows Froms.

Report Viewer 14.0 redistributable

Previous versions of the Microsoft Report Viewer technology for Windows Forms had a runtime file you could install on a client PC to setup the Microsoft Report Viewer assemblies on the users machine. Does something like this exist for Report Viewer version 14.0 used by Visual Studio 2017? I can't seem to find anything available on the Internet.
Viewer 14 on VS 2017 is quite nice in that all you need is the nuget package and you have everything you need to run reports. It doesn't require an installation package to run on the target machines.
This makes web applications a lot easier to deploy as you don't have to install anything on the server short of the website itself. And for winforms you just need to include the dll files the nuget package added.

Deploying an WPF application with Crystal Reports and SQL Server

I have completed a WPF application in Visual Studio 2010 and SQL Server 2008 Express. I have also used Crystal Reports in my project. Now I need to deploy the application on client's systems. I assume that I will have to install the following pre-requisites first.
.Net Framework 4.0
MS SQL Server 2008 express (which may require .Net 2.0)
CR Runtime for .Net 4.0
Report Viewer
IS there a way so that everything installs on its own? I have tried selecting all the above as ** prerequisites**, but that gives me an error that CR Runtime msi not found. Can I also include all the files within my software in the bin folder?
Please give me suggestions.
you can download CRRuntime_32bit_13_0_1.msi from SAP website (google it) and place it in this location:
C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bootstrapper\Packages\Crystal Reports
for .NET Framework 4.0\

Interop Forms Toolkit DLL and "Class does not support Automation or does not support expected interface" error

I have a .NET WinForms application that I've converted into a COM dll using the Interop Forms Toolkit 2.1. Thet setup project for the application has both my tlb as well as the Microsoft.InteropFormTools.tlb file set to Register as vsdrpCOM. The prerequisites for the project are to ensure that Windows Installer 3.1, .NET Framework 3.5 SP1, and the Microsoft Interop Forms Redistributable Package 2.0a is installed.
When I run this locally on a Windows XP box with both Visual Studio 2010 and Visual Studio 6 installed, it works fine. However, on this Windows XP machine, I receive an error stating: "Class does not support Automation or does not support expected interface."
Any ideas?
I got it. For those of you that are running into the same, do the following:
Go into Visual Studio 2005, 2008, or 2010 (I used 2010) and build your Interop Form.
Then, go into Visual Basic 6. If your library is not already referrenced, reference the
library.
Build your VB6 executable.
Go back into Visual Studio (.NET version) and build only your installer. This way the installer and VB6 both have the same .tlb file
You're good to go. Thanks for the suggestion Kris!
You have RegAsm the assembly (see stackoverflow for more) on the machine you want to install the application on. The assembly should also be in the directory where the VB6 application runs, or installed in the GAC.

SQL Server Compact error: Unable to load DLL 'sqlceme35.dll'. The specified module could not be found

I'm developing a Windows Forms application using Visual Studio 2008 C# that uses an SQL Server Compact 3.5 database on the client. The client will most likely be 32 bit Windows XP or Windows Vista machines. I'm using a standard Windows Installer project that creates an MSI file and setup.exe to install the application on a client machine. I'm new to SQL Server Compact, so I haven't had to distribute a client database like this before now. When I run the setup.exe (on new Windows XP 32 bit with SP2 and Internet Explorer 7) it installs fine, but when I run the application I get this error:
Unable to load DLL 'sqlceme35.dll'. The specified module could not be found
I spent a few hours searching for this error already, but all I could find were issues relating to installing on 64 bit Windows and none relating to normal 32 bit that I'm using.
The install application copies the all the dependent files that it found into the specified install directory, including the System.Data.SqlServerCe.dll file (assembly version 3.5.1.0). The database file is in a directory called 'data' off the application directory, and the connection string for it is
<add name="Tickets.ieOutlet.Properties.Settings.TicketsLocalConnectionString" connectionString="Data Source=|DataDirectory|\data\TicketsLocal.sdf" providerName="Microsoft.SqlServerCe.Client.3.5" />
Some questions I have:
Should the application be able to find the DLL file if it's in the same directory, that is, local to the application, or do I need to install it in the GAC? (If so, can I use the Windows Installer to install a DLL file in the GAC?)
Is there anything else I need to distribute with the application in order to use a SQL Server Compact database?
There are other DLL files also, such as MS interop for exporting data to Excel on the client. Do these need to be installed in the GAC or will locating them in the application directory suffice?
You don't need it to be in the GAC for SQL Server Compact to run, and it will pick them up from the application directory. There are several ways to deploy an SQL Server Compact project. The two main ways are:
Deploying the SQL Server Compact redistributable installer with your project, but this way is painful and also can be unistalled by the end user, or upgraded by Windows updates and breaking your application.
Including the DLL files in your application folder. Depending on the features of SQL Server Compact you are using (replication or whatever), there is a handful of DLL files to deploy in your application folder.
If you have SQL Server Compact installed on your machine, they are most likely located at "C:\Program Files\Microsoft SQL Server Compact Edition\v3.5". They can be added to the project in Visual Studio and then set their project output type to "copy always". And the main reference to System.Data.SqlServerCe that you have in your project references should have copy local set to true.
sqlceca35.dll
sqlcecompact35.dll
sqlceer35en.dll
sqlceoledb35.dll
sqlceqp35.dll
sqlcese35.dll
If you have these all set, then in your installer project all you have to include is the project output of this project and you're good. In my opinion this is the only way to go. It is a simple deployment, of a couple of files and you are in control of what DLL versions your application uses.
I hope that helps.
I had a similar problem, a Visual Studio 2008 Windows application targeting 32-bit Windows XP and Windows Vista that used SQL Server Compact 3.5 SP1 - that then got this error when installed on 64-bit Windows 7:
Unable to load DLL 'sqlceme35.dll'. The specified module could not be found
I was embedding an MSI for SQL Server Compact into the installer for the application.
Following this rather confused discussion on MSDN revealed that I needed to use the 64-bit MSI for SQL Server Compact on 64-bit machines. D'oh! That is, from page Microsoft SQL Server Compact 3.5 Service Pack 1 and Synchronization Services for ADO.NET version 1.0 Service Pack 1 for Windows Desktop I needed SSCERuntime-ENU-x64.msi rather than SSCERuntime-ENU-x86.msi for 64-bit machines.
How to: Deploy a SQL Server Compact Edition Database with an Application should help, at least with your first two questions.
In general, I think you should not install anything in the GAC for a single application.
The following provide a solution to the problem and an explanation also.
Troubleshooting: Can’t load SQL Server Compact DLL
SqlCeException on application's first use of SQL Server Compact
Laxmi Narsimha Rao Oruganti 's blog
I hope this helps.

Resources