ChangemakerStudios / Papercut-SMTP

Papercut SMTP -- The Simple Desktop Email Server
2.97k stars 272 forks source link

Papercut fails to open or show up in tray #167

Closed clamburger closed 2 years ago

clamburger commented 4 years ago

Describe the bug When opening Papercut, no UI or tray icon appears, making it impossible to use.

To Reproduce Steps to reproduce the behavior:

  1. Open Papercut.exe
  2. Process is running, but no UI or tray icon appears
  3. Log file indicates an error, and the only way to exit Papercut is to force close the process in Task Manager.

Expected behavior

  1. Open Papercut.exe
  2. A UI window or tray icon appears

Desktop (please complete the following information):

Additional context

Log file:

2020-05-28 18:30:17.383 +10:00 [Information] Loading Messages from the Following Path(s) ["C:\Users\Sam\AppData\Roaming\Changemaker Studios\Papercut SMTP", "C:\Users\Sam\AppData\Roaming\Papercut", "C:\Program Files (x86)\Changemaker Studios\Papercut SMTP\Incoming", "C:\ProgramData\Changemaker Studios\Papercut SMTP\Incoming"]
2020-05-28 18:30:17.420 +10:00 [Information] Default Message Save Path is Set to "C:\Users\Sam\AppData\Roaming\Changemaker Studios\Papercut SMTP"
2020-05-28 18:30:17.647 +10:00 [Information] Papercut Backend Service Running. Disabling SMTP in App.
2020-05-28 18:30:18.091 +10:00 [Fatal] Fatal Error Starting Papercut
Autofac.Core.DependencyResolutionException: An error occurred during the activation of a particular registration. See the inner exception for details. Registration: Activator = MainView[] (DelegateActivator), Services = [System.Collections.Generic.IEnumerable`1[[Papercut.Views.MainView, Papercut, Version=5.7.0.0, Culture=neutral, PublicKeyToken=null]]], Lifetime = Autofac.Core.Lifetime.CurrentScopeLifetime, Sharing = None, Ownership = ExternallyOwned ---> An error occurred during the activation of a particular registration. See the inner exception for details. Registration: Activator = MainView (ReflectionActivator), Services = [System.Windows.Media.Composition.DUCE+IResource, System.Windows.Media.Animation.IAnimatable, System.Windows.IInputElement, System.Windows.IFrameworkInputElement, System.ComponentModel.ISupportInitialize, System.Windows.Markup.IHaveResources, System.Windows.Markup.IQueryAmbient, System.Windows.Markup.IAddChild, System.Windows.IWindowService, System.Windows.Markup.IComponentConnector, Papercut.Views.MainView], Lifetime = Autofac.Core.Lifetime.CurrentScopeLifetime, Sharing = None, Ownership = OwnedByLifetimeScope ---> An exception was thrown while invoking the constructor 'Void .ctor()' on type 'MainView'. ---> The invocation of the constructor on type 'TheArtOfDev.HtmlRenderer.WPF.HtmlPanel' that matches the specified binding constraints threw an exception. (See inner exception for details.) (See inner exception for details.) (See inner exception for details.) ---> Autofac.Core.DependencyResolutionException: An error occurred during the activation of a particular registration. See the inner exception for details. Registration: Activator = MainView (ReflectionActivator), Services = [System.Windows.Media.Composition.DUCE+IResource, System.Windows.Media.Animation.IAnimatable, System.Windows.IInputElement, System.Windows.IFrameworkInputElement, System.ComponentModel.ISupportInitialize, System.Windows.Markup.IHaveResources, System.Windows.Markup.IQueryAmbient, System.Windows.Markup.IAddChild, System.Windows.IWindowService, System.Windows.Markup.IComponentConnector, Papercut.Views.MainView], Lifetime = Autofac.Core.Lifetime.CurrentScopeLifetime, Sharing = None, Ownership = OwnedByLifetimeScope ---> An exception was thrown while invoking the constructor 'Void .ctor()' on type 'MainView'. ---> The invocation of the constructor on type 'TheArtOfDev.HtmlRenderer.WPF.HtmlPanel' that matches the specified binding constraints threw an exception. (See inner exception for details.) (See inner exception for details.) ---> Autofac.Core.DependencyResolutionException: An exception was thrown while invoking the constructor 'Void .ctor()' on type 'MainView'. ---> The invocation of the constructor on type 'TheArtOfDev.HtmlRenderer.WPF.HtmlPanel' that matches the specified binding constraints threw an exception. (See inner exception for details.) ---> System.Windows.Markup.XamlParseException: The invocation of the constructor on type 'TheArtOfDev.HtmlRenderer.WPF.HtmlPanel' that matches the specified binding constraints threw an exception. ---> System.TypeInitializationException: The type initializer for 'TheArtOfDev.HtmlRenderer.WPF.Adapters.WpfAdapter' threw an exception. ---> System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.
   at System.ThrowHelper.ThrowKeyNotFoundException()
   at System.Collections.Generic.Dictionary`2.get_Item(TKey key)
   at TheArtOfDev.HtmlRenderer.WPF.Adapters.FontFamilyAdapter.get_Name() in d:\source\github\HTML-Renderer\Source\HtmlRenderer.WPF\Adapters\FontFamilyAdapter.cs:line 54
   at TheArtOfDev.HtmlRenderer.Core.Handlers.FontsHandler.AddFontFamily(RFontFamily fontFamily) in d:\source\github\HTML-Renderer\Source\HtmlRenderer\Core\Handlers\FontsHandler.cs:line 88
   at TheArtOfDev.HtmlRenderer.WPF.Adapters.WpfAdapter..ctor() in d:\source\github\HTML-Renderer\Source\HtmlRenderer.WPF\Adapters\WpfAdapter.cs:line 64
   at TheArtOfDev.HtmlRenderer.WPF.Adapters.WpfAdapter..cctor() in d:\source\github\HTML-Renderer\Source\HtmlRenderer.WPF\Adapters\WpfAdapter.cs:line 37
   --- End of inner exception stack trace ---
   at TheArtOfDev.HtmlRenderer.WPF.Adapters.WpfAdapter.get_Instance()
   at TheArtOfDev.HtmlRenderer.WPF.HtmlContainer..ctor() in d:\source\github\HTML-Renderer\Source\HtmlRenderer.WPF\HtmlContainer.cs:line 51
   at TheArtOfDev.HtmlRenderer.WPF.HtmlControl..ctor() in d:\source\github\HTML-Renderer\Source\HtmlRenderer.WPF\HtmlControl.cs:line 102
   at TheArtOfDev.HtmlRenderer.WPF.HtmlPanel..ctor() in d:\source\github\HTML-Renderer\Source\HtmlRenderer.WPF\HtmlPanel.cs:line 61
   --- End of inner exception stack trace ---
   at System.Windows.Markup.XamlReader.RewrapException(Exception e, IXamlLineInfo lineInfo, Uri baseUri)
   at System.Windows.Markup.WpfXamlLoader.Load(XamlReader xamlReader, IXamlObjectWriterFactory writerFactory, Boolean skipJournaledProperties, Object rootObject, XamlObjectWriterSettings settings, Uri baseUri)
   at System.Windows.Markup.WpfXamlLoader.LoadBaml(XamlReader xamlReader, Boolean skipJournaledProperties, Object rootObject, XamlAccessLevel accessLevel, Uri baseUri)
   at System.Windows.Markup.XamlReader.LoadBaml(Stream stream, ParserContext parserContext, Object parent, Boolean closeStream)
   at lambda_method(Closure , Object[] )
   at Autofac.Core.Activators.Reflection.ConstructorParameterBinding.Instantiate()
   --- End of inner exception stack trace ---
   at Autofac.Core.Activators.Reflection.ConstructorParameterBinding.Instantiate()
   at Autofac.Core.Activators.Reflection.ReflectionActivator.ActivateInstance(IComponentContext context, IEnumerable`1 parameters)
   at Autofac.Core.Resolving.InstanceLookup.Activate(IEnumerable`1 parameters, Object& decoratorTarget)
   --- End of inner exception stack trace ---
   at Autofac.Core.Resolving.InstanceLookup.Activate(IEnumerable`1 parameters, Object& decoratorTarget)
   at Autofac.Core.Resolving.InstanceLookup.Execute()
   at Autofac.Core.Resolving.ResolveOperation.GetOrCreateInstance(ISharingLifetimeScope currentOperationScope, IComponentRegistration registration, IEnumerable`1 parameters)
   at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()
   at System.Linq.Enumerable.<OfTypeIterator>d__95`1.MoveNext()
   at System.Linq.Buffer`1..ctor(IEnumerable`1 source)
   at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)
   at Autofac.Core.Activators.Delegate.DelegateActivator.ActivateInstance(IComponentContext context, IEnumerable`1 parameters)
   at Autofac.Core.Resolving.InstanceLookup.Activate(IEnumerable`1 parameters, Object& decoratorTarget)
   --- End of inner exception stack trace ---
   at Autofac.Core.Resolving.InstanceLookup.Activate(IEnumerable`1 parameters, Object& decoratorTarget)
   at Autofac.Core.Resolving.InstanceLookup.Execute()
   at Autofac.Core.Resolving.ResolveOperation.GetOrCreateInstance(ISharingLifetimeScope currentOperationScope, IComponentRegistration registration, IEnumerable`1 parameters)
   at Autofac.Core.Resolving.ResolveOperation.Execute(IComponentRegistration registration, IEnumerable`1 parameters)
   at Autofac.ResolutionExtensions.TryResolveService(IComponentContext context, Service service, IEnumerable`1 parameters, Object& instance)
   at Autofac.ResolutionExtensions.ResolveService(IComponentContext context, Service service, IEnumerable`1 parameters)
   at Papercut.AppBootstrapper.GetAllInstances(Type service)
   at Caliburn.Micro.ViewLocator.<>c.<.cctor>b__10_0(Type viewType)
   at Caliburn.Micro.ViewLocator.<>c.<.cctor>b__10_8(Object model, DependencyObject displayLocation, Object context)
   at Caliburn.Micro.WindowManager.CreateWindow(Object rootModel, Boolean isDialog, Object context, IDictionary`2 settings)
   at Caliburn.Micro.WindowManager.ShowWindow(Object rootModel, Object context, IDictionary`2 settings)
   at Papercut.AppBootstrapper.OnStartup(Object sender, StartupEventArgs e)
   at System.Windows.Application.OnStartup(StartupEventArgs e)
   at Papercut.App.OnStartup(StartupEventArgs e)
clamburger commented 4 years ago

This is on the latest version (5.7.0)

Jaben commented 4 years ago

Make sure .NET 4.7 is installed.

clamburger commented 4 years ago

My currently installed version of .NET is 4.8.03752.

borie88 commented 4 years ago

Same issue on Windows 10 version 2004 with .NET 4.8.04084

dinc5150 commented 3 years ago

Same issue on Windows 10 Pro version 20H2 with .NET 4.8.04084. Tried upgrading to Papercut 5.7.0, but issue still happens.

Strangely though, when I download the source and run it, the version run from VS shows the tray icon without any issues.

ASKemp commented 3 years ago

Same here, was having this issue so just downloaded and installed latest but giving me the same. Doesn't open. It's running in the background and can access via the web version just not the desktop app.

ricardomomm commented 3 years ago

Same here, is there something I can provide to help? Sadly the Papercut.exe is not generating log, only the service.

liang340 commented 3 years ago

I have papercut installed on win7 and win10. It works fine on win7, but win10 has the same issue. I found out win7 has .NET 4.7 installation entry in the control panel -> programs & features, while win10 does not (it has up to 4.6 only). Win10 pc already had .NET 4.8 installed through windows updates. Install .NET 4.7 manually is blocked as newer version is already in the system. Hope this help.

1Jesper1 commented 3 years ago

@Jaben Maybe we can upgrade Papercut to .NET 4.8?

Jaben commented 2 years ago

@1Jesper1 I pushed this branch: https://github.com/ChangemakerStudios/Papercut-SMTP/tree/net48 -- but the installer needs more testing. The installer is such a hassle.

1Jesper1 commented 2 years ago

@Jaben Nice! Do you have use cases to test?

Jaben commented 2 years ago

@1Jesper1 The use case is: user doesn't have .NET 4.8 installed and the "bootstrap" installer should detect and install it.

1Jesper1 commented 2 years ago

@Jaben I only tested the scenario when .NET 4.8 is already installed, it didn't install .NET 4.8. When I removed the checks it did install .NET 4.8. I saw the filehashes didn't match so I created a PR for that.

1Jesper1 commented 2 years ago

@Jaben Maybe can this the scenario with a Virtual machine?

1Jesper1 commented 2 years ago

@Jaben Hello, I have tested the scenario on a Win 7 virtual image, the .NET 4.8 framework will install, but I get another error. See screenshot beneath. Maybe this thread has the same problem? https://github.com/tauri-apps/tauri/issues/2882 error

1Jesper1 commented 2 years ago

It seems it's because Win 7 has Powershell 2 installed, so Invoke-WebRequest is not recognized.

1Jesper1 commented 2 years ago

https://github.com/ChangemakerStudios/Papercut-SMTP/pull/207 Fix

1Jesper1 commented 2 years ago

Hello @clamburger This should be fixed in https://github.com/ChangemakerStudios/Papercut-SMTP/releases/tag/6.2.0.build.723

clamburger commented 2 years ago

Can confirm 👍