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

FileLoadException.FileName can be null #2722

Closed
SimonCropp opened this issue Apr 29, 2015 · 11 comments
Closed

FileLoadException.FileName can be null #2722

SimonCropp opened this issue Apr 29, 2015 · 11 comments
Labels
Milestone

Comments

@SimonCropp
Copy link
Contributor

So here https://github.com/Particular/NServiceBus/blob/develop/src/NServiceBus.Core/Hosting/Helpers/AssemblyScanner.cs#L302

We have

            foreach (var ex in e.LoaderExceptions)
            {
                var loadException = ex as FileLoadException;

                if (loadException != null)
                {
                    var assemblyName = new AssemblyName(loadException.FileName);

But as per the doco https://msdn.microsoft.com/en-us/library/system.io.fileloadexception.filename%28v=vs.100%29.aspx FileLoadException.FileName can be null

This property returns the name of the file supplied to the constructor for the current instance, if any. If the file name was not specified or is a null reference, this property returns a null reference.

Hence the reason this user is not getting a useful error message https://groups.google.com/forum/#!topic/particularsoftware/Jbiar-UP19s

@johnsimons
Copy link
Member

@SimonCropp what version do you propose we fix this in ?

@johnsimons johnsimons added the Bug label Apr 29, 2015
@SimonCropp
Copy link
Contributor Author

6

@johnsimons johnsimons added this to the 6.0.0 milestone Apr 29, 2015
@bhandfast
Copy link

Is it possible to get this merged into the 4.x and 5.x versions too?

@timbussmann
Copy link
Contributor

@bhandfast as far as I could tell from the original issue, this bug mainly hides the original issue during assembly scanning. Are you running into a scenario where you can't resolve the original source of the exception (e.g. by excluding the assembly from loading)?

@bhandfast
Copy link

bhandfast commented Sep 5, 2016

@timbussmann I've already spent too much time hunting bugs related to this. We have 250+ endpoint projects and our commit policy doesn't allow for committing binary files if not needed. Today I need to manually build NSB and copy the dll to each endpoint to track down bugs.

If we had a Nuget package it would be a simple operation to update all dependencies. If it's possible to get this distributed in Nuget I'd really appreciate it :)

@bhandfast
Copy link

Do you have any plan on releasing new Nuget packages?

@timbussmann
Copy link
Contributor

since the support for version 4 has expired, I don't think there will be a backport to version 4.

@bhandfast Can you help me to reproduce the issue? Do you have any available assembly which causes said exception?

@bhandfast
Copy link

I guess since you opened this issue yourself you had a scenario already. If you don't want to create new packages then I'll continue with manual patching.

We had an issue with ReportViewer that probably generates new assemblies somehow in a IIS application which is scanned. It quite hard to reproduce. The fix in this issue fixes the problem.

Please consider updating at least version 5 of NServiceBus.

@bhandfast
Copy link

I see now that you opened a issue for v5. Thanks :)

@timbussmann
Copy link
Contributor

@bhandfast as you already noticed, there's a PR #4121 targeting v5 which should solve your issue.

@timbussmann timbussmann modified the milestones: 5.2.16, 6.0.0 Sep 9, 2016
@timbussmann
Copy link
Contributor

This is fixed in release 5.2.16.

@bhandfast the package should be available on nuget very soon.

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

No branches or pull requests

4 participants