-
-
Notifications
You must be signed in to change notification settings - Fork 107
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
Namespace conflict of ZString and SmartFormat.ZString packages #303
Comments
Hi, conflicts of namespaces can easily be resolved as described here. This could happen any time with any package. |
I guess that's fair @axunonb , but in that case I believe it should be under a different namespace, other than Cysharp.Text , or even made internal to the assembly so that the tweaked ZString implementation does not leak outside SmartFormat's assembly. To be clear, when adding SmartFormat's reference I expect to interact with a certain public api. A public ZString api is definitely not something I would expect to part of that api. |
How would you do that? Doesn't it actually mean to change all |
Precisely @axunonb, that would do the trick. Besides that, I would change prepend SmartFormat to the namespace so that all classes that the library maintains in its source are within the same root namespace. If you want, I would be happy to submit a PR. |
Sorry for the delay. Yes, this sounds simple to accomplish with ReSharper, but would have to be applied again with new releases of ZString and thus was kind of error-prone. Do you see a way to automate in a safe manner? |
I believe it could be automated as part of the build process using some tool like : https://github.com/gluck/il-repack |
The [Update] |
… to internal Affects: class, struct, interface, delegate, enum
Resolves #303 Affects: class, struct, interface, delegate, enum using https://github.com/zzzprojects/findandreplace on command line, so we can automate this step: "fnr.exe" --cl --dir "SmartFormat.ZString\repo\src\ZString" --fileMask "*.cs,*.tt" --includeSubDirectories --caseSensitive --useRegEx --find "public (?=.*(class |struct |enum |interface |delegate ))" --replace "internal "
I still got the conflict @axunonb and I think it worked for some time |
@axunonb downgrade to 3.3.0 fixed it. Comparing the versions show that #368 reverted the fix you've done here. Why don't you add the nuget reference of ZString to your lib and consume it instead of duplicating ZString code and adding it to your lib? |
ok, removing ZString Package Reference from my csproj also fixes it which is totally confusing. |
This is still because of framework v4.6.1 not supported by Cysharp.ZString. |
ok, but why do you still support this? ZString has .net standard 2.0 support which makes it work with 4.6.1 (with additional system dll deployment to output folder), but 4.6.1 is out of support for nearly 2 years (April 2022). |
If I want to use both SmartFormat and original ZString packages I get a conflict because the same types are defined in both assemblies.
This is due to the inlining of ZString code into this project.
Another solution is to use another namespace for the internal ZString implementation.
The text was updated successfully, but these errors were encountered: