Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Commit ccfa393 yields Error #11

Open
codingdave opened this issue Apr 11, 2017 · 2 comments
Open

Commit ccfa393 yields Error #11

codingdave opened this issue Apr 11, 2017 · 2 comments

Comments

@codingdave
Copy link

Please revert the commit ccfa393 as it constitutes a regression for my WPF+Winforms project.

The issue I get on the command line is:

Unhandled Exception: System.AggregateException: One or more errors occurred. ---> System.NullReferenceException: Object reference not set to an instance of an object.
   at Confuser.Core.ConfuserEngine.PrintEnvironmentInfo(ConfuserContext context)
   at Confuser.Core.ConfuserEngine.RunInternal(ConfuserParameters parameters, CancellationToken token)
   at System.Threading.Tasks.Task.Execute()
   --- End of inner exception stack trace ---
   at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
   at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
   at Confuser.CLI.Program.RunProject(ConfuserParameters parameters)
   at Confuser.CLI.Program.Main(String[] args)

The real issue is:

System.NullReferenceException was unhandled by user code HResult=-2147467261 Message=Object reference not set to an instance of an object. Source=Confuser.Core StackTrace: at Confuser.Core.ConfuserEngine.PrintEnvironmentInfo(ConfuserContext context) in D:\Projects\ConfuserEx.git\Confuser.Core\ConfuserEngine.cs:line 527 at Confuser.Core.ConfuserEngine.RunInternal(ConfuserParameters parameters, CancellationToken token) in D:\Projects\ConfuserEx.git\Confuser.Core\ConfuserEngine.cs:line 180 at Confuser.Core.ConfuserEngine.<>c__DisplayClass3.<Run>b__2() in D:\Projects\ConfuserEx.git\Confuser.Core\ConfuserEngine.cs:line 68 at System.Threading.Tasks.Task.Execute() InnerException:

@codingdave
Copy link
Author

codingdave commented Apr 11, 2017

The cause of the trouble is when you have a WPF Application but no local namespace. Then the baml code only contains the header
M S B A M L � ÿÿÿÿ��� �WpfApplication1� �WpfApplication1.MainWindow
whereas when you have included the namespace you get
M S B A M L � ÿÿÿÿ��J FWpfApplication1, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null�1�clr-namespace:WpfApplication1�WpfApplication1 5� � �WpfApplication1.MainWindow
You see that Version, culture and Public Key Token are missing here.
I have added a minimal sample.
WpfApplication1.zip

@codingdave
Copy link
Author

So instead of reverting the commit above it would be better to fix proper detection of code that does not have a local namespace.
Unfortunately I have no clue how to fix that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant