I'm using IronPython for my project. The setup is following:
Project.Main - MyProject.Python - IronPython package
Project.Main has a class called Community
that is one of the main classes. It is used everywhere.
Now has IronPython a namespace called Community.CsharpSqlite with a class called Sqlite3.
- I do not need to reference this class within MyProject.Main
- I am not using any classes directly from the IronPython package within MyProject.Main
- I only refer to wrapper classes in MyProject.Python.
All my code doesn't compile anymore though because I'm getting:
Error CS0118 'Community' is a namespace but is used like a type
This is a very large project and I do not want to start prefixing all my references to the Community class with a namespace prefix.
- Is there any workaround?
- Can I expose the IronPython namespaces only to MyProject.Python?
- I tried both Aliases and the PrivateAssets option but I get a warning symbol within the solution explorer and it does not seem to work (still the CS0118)
- see https://docs.microsoft.com/en-us/nuget/consume-packages/package-references-in-project-files