Forum Discussion

PassRusher's avatar
PassRusher
Copper Contributor
Jul 08, 2024

Common Reasons A C# Program Won't Run On A Clean Install Of Windows 11

So, back in 2017, someone made a C# program to help auto populate a Word Document with data from a design program. And has worked as expected. The few users that use it are on "Upgraded Windows 11" machines and one on Windows 10. If we create a new Windows 11 machine and try to run this program, it doesn't kick off. I made sure that the old PC and the new one had the same .NET as set in ADD WINDOWS FEATURES. It doesn't return an error or generate a system log. It just won't work...

 

I am not a C# developer but I do have the source code...I tried debugging on my machine (where it will not run) and still haven't found a reason why it isn't running. It is almost a needle in a haystack but we need it resolved. 

 

Any suggestions? 

9 Replies

  • shanewatson5091's avatar
    shanewatson5091
    Copper Contributor

    Check if the program uses external libraries or packages (e.g., NuGet dependencies).
    If the program references COM libraries (like Microsoft Office Interop for Word), ensure they are installed.
    Install necessary dependencies or recompile the program to include them using "Publish" mode in Visual Studio:

    dotnet publish -c Release -r win-x64 --self-contained

    This creates a standalone executable with all dependencies included.

  • evaelfie5091's avatar
    evaelfie5091
    Copper Contributor
    Check Required Libraries: Ensure all necessary .NET Framework libraries and dependencies are installed on the new machine. Use the Dependency Walker tool to analyze the program's dependencies.
    Reinstall .NET Framework: If the issue persists, consider reinstalling the .NET Framework version required by the program.
  • Hi , Can you please provide source code here then it would very help to solve problem
    • PassRusher's avatar
      PassRusher
      Copper Contributor
      Here's the project... https://pinnaclestructures365-my.sharepoint.com/:u:/g/personal/bwolters_pinnaclestructures_com/ESFd_o2EYJhPqjFxsVTFqpEBD1c44ByNrADrRfvV3iVhfA?e=2T4IA1
      • PassRusher's avatar
        PassRusher
        Copper Contributor
        If I need to extend the expiration date on the link, let me know.

Resources