WPF Error on Non-Development PC - XamlParse - c#

I have an error very similar to the one addressed in this question. I am trying to deploy a small c#/Xaml utility on 6 work machines. 4 of the machines run the utility successfully and 2 do not. All machines are windows XP and have .Net frameworks 1-4 installed (my app is compiled against 4.0 and all machines have both client and extended redistributables installed).
On running the utility, I get the standard "... has encountered a problem and needs to close." On viewing the error report contents, the problem seems to occur in System.Windows.Markup.XamlParse.
I have run .Net 4.0 online installer in "repair" mode and still I get the same problem. I have tried all the suggestions from the post linked above:
The file is deployed alongside a DLL which is present and correct.
UI cultures are identical.
All computers are up to date from Microsoft Update.
The assembly does not contain any external resources which are referenced in XAML.
I don't really know where to start with debugging this one. Any suggestions?

I would suggest setting up remote debugging on the machines that are having the problem and then adding this to the startup code:
while (!System.Diagnostics.Debugger.IsAttached)
{
Thread.Sleep(100);
}

Related

I have a .NET app impossible to debug because when I install the SDK it works. Any suggestions?

I have a .NET application that regularly works on all the machines with .NET installed.
When I try to launch it on a PC with no .NET framework installed this happens:
it opens, i can change tab (my app has 4 tabs), it reads the computer IP without any problem, but then crashes somewhere when it receives a message from another terminal (i have a terminal that communicates with the PC via ETH-TCP/IP).
The message I get is just:
DESCRIPTION: stopped working.
The big deal is that I cannot debug it because if I install the .NET framework it magically works like a charm.
Obviously I'm asking this because we prefer not to install .NET on all the machines in the office (they run different Windows versions and plenty of them don't have the .NET installed).
My question can be similar to this one, but in my case the .exe starts (as I explained above).. the crash comes when I start the communication between the PC and the terminal.
Anybody has a hint for my problem? Thank you
EDIT : thank you for the answers, in the end I decided to do Remote Debugging by running the app on a virtual machine with no .NET at all. Now, when it crashes, I can catch the bad instructions inside VS2010 installed on the host machine.
Btw, the problem was on a .dll that couldn't be loaded
You must have the .NET Framework installed on a machine in order to run a .NET application. The .NET Framework is both a runtime and the SDK, not just an SDK. All versions beyond Windows XP come with some version of the .NET Framework installed.
If you are saying that installing Visual Studio corrects the issue (which is what the question you linked to describes), that is a different problem altogether. Unfortunately, your question doesn't provide enough information to troubleshoot it. You can check the Event Viewer on the machine experiencing the issue, then look for two errors next to each other in the Application event log. One of these errors will contain exception detail, which will aid us (or you) in tracking down the problem.

Crystal Reports ActiveX Viewer causes Out of Memory exception in VB6 / .NET App Windows 7

Here is a link to a sample application which reproduces the error:
http://sdrv.ms/17j2Ale
I have three projects. One is a .NET 2.0 Windows Forms application (.NET App), one is a VB6 Standard EXE application (VB App), and the other is a VB6 ActiveX DLL (VB DLL). The .NET App references the VB DLL which is already registered. This VB DLL essentially launches Crystal Reports. The VB App launches the .NET App via the Shell() command. Here's what happens:
If I run the .NET App directly, I can open a Crystal Reports document with no problem. However, when the VB App launches the .NET App via the Shell() command, when the .NET App attempts to open the Crystal Reports document, I get an Out of Memory error.
Now here's the kicker - this worked on Windows XP, but when we attempt to launch it in Windows 7 64-bit, we run into this issue. I'm sure there's got to be a simple solution out there for it. Any takers?
You can jump to Update 5 where I narrowed down the problem.
Update: I also tried creating a second .NET 2.0 Windows Forms application (.NET Launcher), and launched the .NET App from it via:
Process.Start(#"C:\Path\OtherApp.exe");
and when I tried open the Crystal Reports document in the .NET App it still gave me the same Out of Memory error.
Update 2: removed due to update 4
Update 3: So today I discovered that the reason the .NET App was able to open the report when it was launched directly was because I was launching it within Visual Studio. When I tried the executable outside Visual Studio, the error returns. I noticed that Visual Studio, as of 2005, began using a vshost.exe to launch windows applications to speed up debugging startup: http://blogs.msdn.com/b/dtemp/archive/2004/08/17/215764.aspx
When I disabled the vshost feature, the out of memory error returned. So I suppose the question is, what is this vshost process doing that allows it to work on windows 7?
Update 4: I was able to compile the VB6 DLL with debug information and load the source and debug information into Visual Studio and step through it when the .NET app executes the VB6 code. The Out of Memory exception comes from this line:
Dim myForm As frmTheForm
Set myForm = New frmTheForm 'OOM Error right here
So inside the vshost.exe this form is able to initialize but not without it.
Update 5: I have narrowed down the problem to the Crystal Reports ActiveX Viewer. I started a new VB ActiveX DLL project from scratch and started with only a form. This worked every which way. Then I added the Crystal ActiveX Report Viewer Library 11.5 - and the error returned! It is definitely the Report Viewer. I'm told that this problem may be able to be fixed by a simple registry adjustment.
Update 6: I used Procmon.exe from Sysinternals and generated a logfile that can be found here:
http://sdrv.ms/194aO7A
I've got such problems when I use 32Bit C/C++-Dll's with .NET code running on 64Bit Windows.
If your .NET project has "any platform" as target then the runtime compiles the code to 64Bit on a 64Bit Windows, on a 32Bit Windows I think you'll have no problems.
You have to set your target platform to "x86", you wrote you did this. Please verify that all your .NET projects in your .NET solution are set to x86 as target.
The Crystal Reports *.dll should be a 32Bit COM *.dll, and the VB6 *.dll too.
I found a workaround solution to the out-of-memory error; however, it is not an allowable solution. Apparently, this issue is resolved in future versions of the crviewer.dll but Mister Uher makes it very clear in his response to my question here: http://scn.sap.com/thread/3405856 that we are not allowed to use the versions after 11.5 due to licensing restrictions. It would seem this is a common question he receives. Unfortunately, we are forced to accept the response that we are to upgrade our applications to .NET. If anyone else is feeling adventurous enough to attempt to troubleshoot the out-of-memory exception, I would am happy to leave my sample project above available to anyone who wishes to venture it. Best of luck to anyone else feeling my pain of CR 11.5 interop support.
Not sure if this information will help, but I have faced similar problems in the past with crystal and a Web Forms applications. I resolved it by ensuring that the application pool has the 'Enable 32 bit applications' option checked? You can find it under the advanced settings -> General....

Getting the error "The 'VFPOLEDB.1' provider is not registered on the local machine" even after installing and registering the provider

Alright, so I've got a Windows service that has a FileSystemWatcher that watches an output folder for some Visual FoxPro database files. And it leverages the VFPOLEDB.1 provider to read those files. I cannot go away from this provider because it's being used in production.
However, I've never had to support this application before so that's why my development box isn't setup for it. Here is my environment:
Windows 7 x64
Visual Studio 2005
.NET 2.0 Windows service
so, when I first started getting the error I figured I just didn't have the provider at all, and I was right. So, I downloaded and installed it from here.
I then proceeded to drop the files in the folder again, but I got the same error.
I figured because it's an x64 machine I might be experiencing problems with it getting registered since it was probably dropped into SysWOW64, and it was as I expected, so I ran this command:
regsvr32 "C:\Windows\SysWOW64\mscomct2.ocx"
and it said it was successfully registered (which means about nothing LOL) but I dropped the files in again - same error.
I have not yet rebooted my machine, and I can if somebody has a compelling reason that's the problem, but generally speaking if the assembly is registered properly with regsvr32 that's not necessary. I've worked with a ton of COM objects and never have to reboot to get to the object as long as I've registered it.
Does anybody know another step I need to perform to get this thing registered?
It is registered as it should. It is your application that is compiled for AnyCPU Platform.
In x64 operating system this produces 64bit code and 64bit code could not access 32bit drivers.
Change your Platform to x86 and you will be fine.
EDIT
Two years later there is something to add to this answer. Now with Visual Studio 2013 the cheese has been moved. The article linked explain in great details how the compiler setup defaults has been changed. The AnyCPU target CPU with Prefer 32 bit means that your application works as 32bit app also in x64bit operating systems leaving practically no-room to x64 application unless specifically required.
With this new configuration becomes also important to remember what is posted in comments below by Mark Berry. If your (now 32bit) app needs to work in a IIS 64bit environment you need to set the Application Pool with Enable 32 bit Applications
I have desktop app (Win7 x64 VS 2015) - and kept getting the same error no matter what. I changed platform target to x86, installed MSI as admin etc - did everything I could google - and no luck. What helped me is to install MSI for Everyone instead of Just me - one of the last wizard's screen in the setup.
I have the same problem.
I install the VFP Ole DB Provider in my system and resolved.
download link
use Advantage OLE DB Provider,works for 32 or 64,here is the connection string

WPF Application designed in VS 2012 won't run on Windows 7 machine

I've designed a WPF C# application using Visual Studio 2012. The application, which is simple enough, runs fine on my Windows 8 machine using the ClickOnce deployment method. The datagrid displays the content from a SQL Server database and performs all of it's other functions just as I've designed it to, but when I attempt to install it on a Windows 7 machine it immediately crashes and I'm not sure why. The Windows 7 computer I'm trying to install the application on has .NET 4.5 running on it, but is there anything else that computer needs to have installed on it in order to run applications developed with VS 2012. This is my first attempt to install an application developed with VS 2012 on a Windows 7 machine, so I'm not sure if there's another step that I'm missing here. Any help you guys can provide would be greatly appreciated. Thank you.
The message you stated "The application has stopped working and that if Microsoft has a solution..." is an indicator of one of the following:
The Framework is disabled; though 4.5 is installed several root instances are built on the foundation which are apart of Framework 2.0. This particular Framework can cause issues for 3.0, 3.5, 4.0, and even 4.5.
The System.EnterpriseServices.dll is damaged in the Framework. Which needs to be connected back to the Global Assembly Cache (GAC).
And another common issue is the machine.config file log in the Framework Folder can be corrupt and needs to be replaced with a valid one.
There are others that can occur within the System Policy Folder as well, which may require you to use the .Net Cleanup Tool and reinstall the Framework. But before you do any troubleshooting you should go to the Event Viewer and get details of what is going on.
Try these steps first for me:
Windows Key + R
When the run prompt appears type: appwiz.cpl
Go to the left hand side: Turn Windows Features On or Off
Turn Framework 3.5 on if it isn't already; if it is already on go to Step 5.
Turn off the Framework; then reboot.
Once rebooted follow steps 1-4 again.
Now at this point I would suggest trying the application again. If it fails try this:
Open Start
Type 'cmd' in Search
Right Click and Run as an Administrator
Type %windir%\Microsoft.Net\Framework\v2.0.50727\ngen.exe update
Then type: sfc /scannow
The Native Regeneration tool will try to repair the Framework back to a factory state; the System-File-Checker will attempt to fix any errors indicated in Windows. If it can't it will say 'it found integrity violations'.
Those are the steps I would do for general support; but you really should try and locate an error message. As the Framework can become a huge ordeal to cleanup and fix. If you provide more information I will revise my response to help address it.
Hopefully that helps.

Cant install .NET application in Clients PC

My client's PC runs Windows 7 Ultimate with .netframework 4 client profile. I am unable to install my application developed in VS2008. I tried uninstalling .NET Framework 4 From his PC and running the Clean up tool provided by Microsoft. But still I am unable to install it successfully. It provides Error 1001.
I tried running the program as administrator. I also tried to Turn on .net 3.5 feature from add or remove program.
Thanks in advance. :)
Edit:
The error what i get is shown here.
Furthermore,
I have confirmed that it is a 32bit processor and i run x86 release version of setup
The application is developed in a Windows 7 OS with .NET Framework 3.5
I have installed this application in 7 PCs which have .NET 3.5 installed in them and having OS Windows XP,Vista and Windows 7; and all are working fine.
In clients PC, when I try to install .NET 3.5 again, the installer starts but then it disappears suddenly without doing anything
I have tried turning on .NET 3.5 framework feature from control panel> Program and Features.
I have tried running the program as Administrator
I have tried setting the application setup in Windows XP and Vista compatible mode.
But still the issue persists.
Thanks :)
#Niraj.. hope you recognize me.. :)
Well, I think the issue is with your installer. Something in your package settings is conflicting with the environment at your client's computer. With the error message that you posted, it looks like there is some dependency on some assembly which isnt available to the installer, and hence its failing. This might include version number mismatches too.
You should also look at this question, which talks about an issue similar to yours.
or try using FusLogvw.exe to check which assemblies fail to load at runtime.
As you said you have only .net framework 4 client profile which is a subset of the .NET Framework 4 and is optimized for client applications. Please make sure that everything needed for your new application is included in client profile version. Also it is possible that your application installer requires .NET Frw 3.5 as a dependency. Anyway as already said by Henk no need to do anything with .NET Frw 4 just install 3.5.
There is an exception raised during the installation, and you should as it wished to collect MSI debug log and other necessary information to troubleshoot.
I don't think .NET 4 is the root cause. Otherwise, you should already install this app after uninstallation of .NET 4.
in my opinion
be sure that you not run X64 application in X86 based computer
trying to run them in compatibility mode for OS depend on which OS you used in client system
check the prerequested component are installed or not in client system.
you show the problem 1001 in snapshot so you can Read the log for more information about the setup you trying to install on client side.
your setup forced client system to load a specific type during the installation and type not exactly load as setup want so they give you a exception called "LoaderException"
for more information start googling may be it solved your problem
http://www.google.co.in/search?sourceid=chrome&ie=UTF-8&q=loaderexception+in+.net&qscrl=1
I got it finally...nothing was stopping my application but Crystal Reports.
We forgot to include Crystal Reports Basic as a prerequisite.
Thank you guys for the efforts taken. :)
Niraj

Categories

Resources