InvalidOperatioException while developing Microsoft Surface 2.0 application - c#

I am developing a Microsoft Surface 2.0 application using Visual C# 2010 Express Edition. I have already installed the Surface 2.0 SDK and Runtime Environment on a Windows 7 (32 bit).
From the installed templates, I choose a new Surface WPF application and press F5. I get an InvalidOperationException with the following message -
Cannot load Counter Name data because an invalid index 'Terminal
Services' was read from the registry.
The project is empty. I haven't added a single line of code yet. The same blank application works perfectly well on another desktop running Visual Studio 2010 Ultimate.

I would try here first: PerformanceCounters on .NET 4.0 & Windows 7
Most likely the performance counters are not loading in the registry, or at least not loaded properly. I know the question is different, but the symptoms are the same.

Run lodctr.exe /r it will repair registry entries related to the perfmon counters.

Related

Publish Portable and Self-Contained .NET Application in Windows 7

I need to release an application that:
must not be installed
must not involve the installation of dependencies for its execution if they are not installed on the PC in use (no versions of C ++, versions of .net Framework, etc ...).
For this purpose I made the application in .NET 5.0 and published it according to the settings visible in the image.
In the settings I specify the Self-Contained property.
Running the application on Windows 11, Windows 10 and Windows 8.1 I have no problems but on Windows 7 I have a .NET Runtime ID 1023 error as in the image.
What could be the problem? How should I publish the application so that I don't need to install anything?
Unfortunately Windows 7 SP1 is supported only with Extended Security Updates installed. The same statement also applies to net6.
I managed to get it to work (with net6) by installing those updates from the Microsoft Update Catalog:
Windows6.1-KB3063858-x64.msu
Windows6.1-KB2999226-x64.msu
Win7AndW2K8R2-KB3191566-x64.zip
this is Windows Management Framework 5.1
Microsoft Visual C++ 2015-2019 Redistributable (x64) - 14.29.30135
In addition, in some installation, I had to also install PowerShell v7.2.1 .
I was unable to run the application on a fresh install of Windows 7 SP1 in any way.

unable to install or run C# application on client PC

I have developed a desktop application in c# & SQL server 2012 using Visual Studio 2013. I have included the reference for Microsoft.VisualStudio.DebuggerVisualizers and set copy local : true.
The application runs perfectly on client systems with windows 8, 10.
But its showing this error while installing on a windows 7 system.
- OS Windows 7 Ultimate
- already installed .NET Framework 4.5
- installed Report Viewer.exe 2012
- installed report viewer.msi 2010
- installed sqlclr types
- the system doesnt have any microsoft c++ redistributable , i am not sure whether it has any impact.
I checked in the assembly folder, but couldnt find the Microsoft.VisualStudio.DebuggerVisualizers.dll
Am I missing any prerequisites here? How to solve this issue so that i can install the application
Error Message
It needs the Microsoft.VisualStudio.DebuggerVisualizers.dll in the global assembly cache. The GAC is the area where libs are placed which can be accessed from all of the system.
It's kinda a ugly fix but you could place this lib in the same or subdirectory of the same directory where the application is.
Is it possibly that you haven't installed VS on that Win7 machine but on the others?
Unintentionally the Microsoft.VisualStudio.DebuggerVisualizers.dll had been included in the project reference. And in the client system the specified dll could not be found even after trying to install it. Hence I removed it from reference and then it worked perfectly fine without any issues. I guess instead of report visualizer i have included debuggervisualizer. It was a manual error.
Thank you for your support

application running fine on winXP and not on win7

I have an application written in C# and built using Visual Studio 2005 on winXP. It is working fine on winXP. If i try to run it on win7, I am getting an error called ".NET Framework Initialization Error." "Unable to find a version of the run time to run this application." Application target framework is .Net 2.0. How can i make it run on win7 ?
Try going to the files properties and go to compatibility then click on run in compatibility mode and then click on windows xp. this should fix the problem.
here's a screenshot to help. Ignore the fact that the options are blanked out they shouldn't be on yours.
try to Remove the .Net framework from your computer and then install .Net framework components through Windows Update .
read it maybe helpful:
http://answers.microsoft.com/en-us/windows/forum/windows_xp-performance/net-framework-initialization-errorunable-to-find-a/6ef76069-f481-48ad-ac30-d03e5c4d9638

C# Windows forms app created using Visual Studio 2012 not working on windows xp

I have created a windows forms application using C#.net 4.0 on Visual studio 2012.
App works great on windows 8 and windows 7 but when I try to run the same app on Windows XP I get following error message.
Following are the prerequisites for my app:
1. .net Framework 4.0
2. Windows Installer 4.5
3. ReportViewer 2010
4. MYSQL DB 5.6
5. Visual Basic PowerPack 10
I have installed all these pre-requistes on Windows XP. My 1 click setup installs the application correctly but on application Start up I am receiving error.
I also tried upgrading visual studio 2012 and then rebuilding and publishing the app but still the same error persists.
Following is the screen shot from the Application Event logger
Screenshot from Project's configuration manager
Screenshot from Project Properties
Can anyone suggest me what could be the issue.
If your program icon (or possibly any icons used by your program) has any images that are larger than 64x64 pixels, you can get this error on XP (in System.Drawing).
Check all your icon files and ensure that none contain images larger than 64x64
You Need Service pack 3 for XP and check the EXE build whether it might build for X64 and also check your XP machine is having .Netframework 4.0 change that into AnyCpu and once again build
the EXE and check with XP. and change your framework as .NetFramework 4.0
Are you targeting Mixed Platforms/Any CPU/x86? Can you try different build configurations?
Are you referencing any third party DLL's?
Can you catch and log details of the exception, or does the program fail to execute entirely?
I've had strange issues before when compiling for Mixed/Any CPU, and x86 machines throw a wobbler if the program isn't specifically targetted to x86.

Application Required run as adminstrator first time

I have developed an application in c#.net.
Created a setup for windows 7 64 bit operating system. I have used Visual Studio 2010 to create a setup. I select the prerequisites for the application which are provided by default for 64 bit os setup namely Sql Server 2008 and .NET Framework 4.0.
The setup is installed successfully.
My problem is that **I need to run the application as administrator for first time.
Do I need to set specific properties for setup while creating the setup ?
You need to Create and Embed an Application Manifest with Your Application. Have a look at this link and i hope you may get what you want. Making Your Application UAC Aware

Categories