1

When the user is an administrator, the application runs well. But when the user is a standard user the application crashes on startup . enter image description here

I got the exception information use code from .NET application cannot start and receive XamlParseException

I am using VS2010 and .Net 4.0.

Event Log:

Exception Info: 
System.Windows.Markup.XamlParseException Stack: 
at System.Windows.Markup.WpfXamlLoader.Load(System.Xaml.XamlReader, System.Xaml.IXamlObjectWriterFactory, Boolean, System.Object, System.Xaml.XamlObjectWriterSettings, System.Uri) 
at System.Windows.Markup.WpfXamlLoader.LoadBaml(System.Xaml.XamlReader, Boolean, System.Object, System.Xaml.Permissions.XamlAccessLevel, System.Uri) 
at System.Windows.Markup.XamlReader.LoadBaml(System.IO.Stream, System.Windows.Markup.ParserContext, System.Object, Boolean) 
at System.Windows.Application.LoadComponent(System.Object, System.Uri) 
at MyApp.MainWindow.InitializeComponent() 
at MyApp.MainWindow..ctor() 
at MyApp.App.Main(System.String[]) 

update:

I create a default WPF application without any change. it still crash.

Community
  • 1
  • 1
Rock
  • 205
  • 1
  • 4
  • 14

1 Answers1

2

The application is trying to load a file that the user has no access to.

Probably an image, video or sound file.

Try to pin-point the xaml/file that is causing the issue by commenting-out fragments of the Xaml until you find the file.

After that grant access to the file by either chaning the security on the file or by placing the file somewhere more public.

Emond
  • 50,210
  • 11
  • 84
  • 115
  • it run well on the computer without vs2010 – Rock May 31 '13 at 02:03
  • Do you mean without running the debugger or running on a machine that has no Visual Studio? – Emond May 31 '13 at 04:19
  • I mean vs2010 is not installed on the computer. – Rock Jun 06 '13 at 05:50
  • you could try to use fuslogvw http://msdn.microsoft.com/en-us/library/e74a18c4.aspx to findout what assemblies are loaded on a machine with and on a machine without VS. That is the only thing I can think of how an installation of VS might influence the running of an app – Emond Jun 06 '13 at 06:42
  • fuslogvw required administrator privileges, but this problem is only for standard users. – Rock Jun 21 '13 at 03:05
  • You could run the app as the user and run fuslogvw as admin – Emond Jun 21 '13 at 04:19