locked
Why is declarative syntax for resources not working with satellite assembly? RRS feed

  • Question

  • User-13302248 posted
        <div>
            <strong>String1: </strong><%= ClassLibrary2.Class1.String1 %>
            <br />
            <strong>String1: </strong><asp:Literal runat="server" Text="<%$ Resources:String1 %>"></asp:Literal> 
        </div>

    I have a satellite assembly for my resources and I can't get the following declarative syntax to work 

    <%$ %>

    In the example of above, using the ClassLibrary2 reference works fine. However, I'd like to directly reference the resource like in the literal element using <%$ %>.

    I get a compile-time error: The resource object with key 'String1' was not found.

    Wednesday, February 24, 2016 2:33 PM

All replies

  • User2119946224 posted

    I faced with same issue and below steps solved my issue.

    1) Click on your resource file project and in property change access modifier to Public.

    2) Rebuild your resource project.

    3) Ref it to your web project

    4) now use keys same way and build your project.

    Hope it will solve your issue. Let me know if you needs further assist.

    Regards,

    Tuesday, June 20, 2017 4:41 AM