RickStrahl / Westwind.Globalization

Database driven resource localization for .NET applications
544 stars 135 forks source link

Turn off Admin UI in project #87

Closed mahoon closed 7 years ago

mahoon commented 7 years ago

I have two associated applications (solutions) that I want to use globalization for - the first is an administration application, which should contain the localization Admin UI with the static classes being generated under a shared class library project - which itself will be referenced by the second application. The second application should not contain the LocalizationAdmin, but does need the javascript resource manager in, to serve up client-side resources. I understand you can install Westwind.Globalization.Web for the admin stuff in the first application, but for the second application, the Westwind.Globalization package does not contain the javascript resource manager and installing Westwind.Globalization.Web to resolve that issue, then installs the LocalizationAdmin, which we don't want. Is there a way to setup the second application to make use of javascript handler without having to install the whole admin UI?

The wiki suggests the JavascriptResourceHandler is in the Westwind.Globalization assembly:

<configuration>
<system.webServer>
<handlers>
    <add name="JavaScriptResourceHandler"
        verb="GET"
        path="JavascriptResourceHandler.axd"
        type="Westwind.Globalization.JavaScriptResourceHandler,Westwind.Globalization" />
</handlers>
</system.webServer>
</configuration>

But, when we add this to the web.config of application 2, we get the exception:

Could not load type 'Westwind.Globalization.JavaScriptResourceHandler' from assembly 'Westwind.Globalization'.

The only way we can get the JavaScriptResourceHandler to work in application 2 is to include Westwind.Globalization.Web package and change the assembly in the handler mapping from Westwind.Globalization to Westwind.Globalization.Web

RickStrahl commented 7 years ago

Sure just remove the localization admin folder - or if you want to leave it but lock it out set permissions on the folder.

The assembly is Westwind.Globalization.Web for the JavaScript handler. Things got shuffled around. I'll fix the docs, but the handler mapping should be correct in what was added to the project when you imported the Nuget package.