Skip to content

Conversation

@djechelon
Copy link

Class not accessible in Razor context from MVC 5.2

Class not accessible in Razor context from MVC 5.2
@djechelon
Copy link
Author

Making it public in my project made me able to display @ExpressionStringBuilder.ToString(Model.Query.Expression)

Utility classes should always be public

@JakeGinnivan
Copy link
Owner

Hey

You can just install the package into all projects which need it?

If we do this we also need the build to change the namespace to $rootnamespace$ so NuGet will change the namespace. Otherwise if you install into multiple projects there will be type conflicts.

@djechelon
Copy link
Author

Hi, unfortunately it is not as simple as it look.

ASP.NET applications compile code and pages in different assemblies so I cannot reference any ExpressionStringBuilder class if it is not publicly available from the pages assembly.

I might provide an example that does not compile if you wish.

Regards.

@JakeGinnivan
Copy link
Owner

I will look into this. The good news is that being a source package you can just change the class which is dropped into your project, when you upgrade it will leave the modified file, you then delete it and make the same change to the next version.

I could also provide a binary package as well if that would work better?

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

Successfully merging this pull request may close these issues.

2 participants