-
Notifications
You must be signed in to change notification settings - Fork 775
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
Includign AutoUpdater.NET package broke Type.GetType #185
Comments
@snechaev Thanks for reporting it. I will look into this. |
My knowledge of type internals is a bit rusty, but is "ArrayOfint, http://schemas.microsoft.com/2003/10/Serialization/Arrays" valid? Checking the Type.GetType and type names documentations I can't find any reference to schema based type loading and as far as my knowledge goes it should only be "TypeName, AssemblyName" If it is valid, could you point me to the documentation? (personal interest) Further if I do this in a clean console app project (the true means "throw on error"):
I get "System.IO.FileNotFoundException: 'Could not load file or assembly 'http://schemas.microsoft.com/2003/10/Serialization/Arrays' or one of its dependencies. The system cannot find the file specified.'" So I think your dynamic computation of the type name is a bit off. Regarding the crash: It happens in resource embedder as described here and I can fix it via user input validation. |
@marcStan, the argument is invalid type, I know. We get it from third-party code, so I actually do not know how exactly it is calculated. So, the expected result is null when calling GetType with single argument, or the exception when calling with second argument set to true. Glad to hear that crash was fixed! |
In out code we have the operation like this
var result = Type.GetType("ArrayOfint, http://schemas.microsoft.com/2003/10/Serialization/Arrays");
(the argument is actually calculated). The expected result will be null (type not found).But after adding AutoUpdater.NET 1.4.11.0 and referencing one of static field of AutoUpdater class, the code above throws FileLoadException instead returning null.
Full test code. Create Console application (.net 4.5) and replace Program.cs with the following snippet,
I make some research and found, that if I recompile AutoUpdater.NET without Resource.Embedder package (and additionally manually remove corresponding build targets from .csproj file), and use this rebuilded package instead of nuget package, the issue stop reproducing.
So, looks like the issue is caused by the bug in the Resource.Embedder package.
My environment is Win7 (with all updates) and VS2017 (15.8.4)
The text was updated successfully, but these errors were encountered: