mono / xwt

A cross-platform UI toolkit for creating desktop applications with .NET and Mono
MIT License
1.36k stars 241 forks source link

Exception thrown: 'System.IO.FileNotFoundException' in mscorlib.dll #934

Open Shadowblitz16 opened 5 years ago

Shadowblitz16 commented 5 years ago

I can't get this to run. I keep getting a Exception thrown: 'System.IO.FileNotFoundException' in mscorlib.dll error and then visual studio freezes.

using System;
using Xwt;

namespace QuestMakerEngine
{
    class Program
    {

        [STAThread]
        static void Main(string[] args)
        {
            Application.Initialize(ToolkitType.Gtk);

            //Create the Window
            var mainWindow = new Window()
            {
                Title  = "HelloWorld",
                Width  = 640,
                Height = 480
            };

            mainWindow.Show();
            Application.Run();
            mainWindow.Dispose();
        }
    }
}

'QuestMakerEngine.exe' (CLR v4.0.30319: DefaultDomain): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_32\mscorlib\v4.0_4.0.0.0__b77a5c561934e089\mscorlib.dll'. Cannot find or open the PDB file.
'QuestMakerEngine.exe' (CLR v4.0.30319: DefaultDomain): Loaded 'C:\Users\Shadowblitz16\source\repos\ZeldaEngine\QuestMakerEngine\bin\x86\Debug\QuestMakerEngine.exe'. Symbols loaded.
'QuestMakerEngine.exe' (CLR v4.0.30319: QuestMakerEngine.exe): Loaded 'C:\Users\Shadowblitz16\source\repos\ZeldaEngine\QuestMakerEngine\bin\x86\Debug\Xwt.dll'. Cannot find or open the PDB file.
'QuestMakerEngine.exe' (CLR v4.0.30319: QuestMakerEngine.exe): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System\v4.0_4.0.0.0__b77a5c561934e089\System.dll'. Cannot find or open the PDB file.
'QuestMakerEngine.exe' (CLR v4.0.30319: QuestMakerEngine.exe): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Core\v4.0_4.0.0.0__b77a5c561934e089\System.Core.dll'. Cannot find or open the PDB file.
Exception thrown: 'System.IO.FileNotFoundException' in mscorlib.dll
Exception thrown: 'System.Exception' in Xwt.dll
An unhandled exception of type 'System.Exception' occurred in Xwt.dll
Toolkit could not be loaded

'QuestMakerEngine.exe' (CLR v4.0.30319: QuestMakerEngine.exe): Loaded 'C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\PrivateAssemblies\Runtime\Microsoft.VisualStudio.Debugger.Runtime.dll'. 
'QuestMakerEngine.exe' (CLR v4.0.30319: QuestMakerEngine.exe): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Configuration\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Configuration.dll'. Cannot find or open the PDB file.
'QuestMakerEngine.exe' (CLR v4.0.30319: QuestMakerEngine.exe): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Xml\v4.0_4.0.0.0__b77a5c561934e089\System.Xml.dll'. Cannot find or open the PDB file.
The program '[3328] QuestMakerEngine.exe' has exited with code -1 (0xffffffff).

``
Therzok commented 5 years ago

Is Xwt.Gtk.dll local copied to the output directory of the startup project?

Shadowblitz16 commented 5 years ago

no i don't think so. I basically just used nuget and assumed it set it up for me.

I would have to create a test project since I removed the asset from my project. I will get back to you.

Therzok commented 5 years ago

You also need to reference Xwt.Gtk, not just Xwt - doesn't seem to be loaded in the appdomain on startup.

Shadowblitz16 commented 5 years ago

now I get

System.Exception
  HResult=0x80131500
  Message=Toolkit could not be loaded
  Source=Xwt
  StackTrace:
   at Xwt.Toolkit.LoadBackend(String type, Boolean isGuest, Boolean throwIfFails)
   at Xwt.Toolkit.Load(String fullTypeName, Boolean isGuest)
   at Xwt.Application.Initialize(String backendType)
   at Xwt.Application.Initialize(ToolkitType type)
   at XwtTest.Program.Main(String[] args) in C:\Users\Shadowblitz16\source\repos\XwtTest\XwtTest\Program.cs:line 12

Inner Exception 1:
FileNotFoundException: Could not load file or assembly 'gdk-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f' or one of its dependencies. The system cannot find the file specified.

I installed the nuget package for Xwt.Gtk and I made sure it's copy local property was set to true

Therzok commented 5 years ago

That means gtk# is not installed on the system. See the link I posted above for the gtk# installer

Shadowblitz16 commented 5 years ago

you should make this use dependencies in the nuget package installer so it does all this when you add it to the project

EDIT: ok I installed gtk# from the mono page. but it didn't change anything

Shadowblitz16 commented 5 years ago

@Therzok I have both Xwt.Gtk and Xwt as references in the project and its still not working. I don't see where you posted a link. if you mean the Xwt.Gtk thats where I got my Xwt.Gtk reference from.

Shadowblitz16 commented 5 years ago

I just realized I do have gtk# installed in my system. if it's outdated then there are no windows binary releases for it.

EDIT: nope it sends me to the same page on the mono website

so here is a rundown I have Xwt referenced in my project I have Xwt.Gtk referenced in my project I have Mono 32 bit and Gtk# installed on my system

what could be the problem?

venkate5hgunda commented 4 years ago

@Shadowblitz16 , did you find a solution to the issue?

Shadowblitz16 commented 4 years ago

nope I just stopped using the library because I couldn't get any help with it. I would be willing to try again though if someone is willing to help me fix it

hxbb00 commented 4 years ago

should be .net framework 4.7.2