Build Error: error MSB3103: Invalid Resx file

Posted on 2009-04-16
Last Modified: 2013-12-17
I have a project that builds and runs fine on the local machine but when I try to run the build project on the server I am getting the following error:

error MSB3103: Invalid Resx file. Request for the permission of type 'System.Security.Permissions.SecurityPermission, mscorlib, Version=, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.

The Resx file has the following items that seem to be requesting the permission:

  <resheader name="reader">
    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
  <resheader name="writer">
    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>

I've found several items via Google that reference setting permissions for internet apps but this is a winforms app.  I'm looking for a solution that will allow the assembly to build and run on any machine.  Any help would be appreciated.
Question by:twentysixpoint2
    LVL 12

    Expert Comment

    Here is how to get the public key being used ... may or may not help

    You can set the Assembly key in code with

    AssemblyIdentity.PublicKeyToken = "b77a5c561934e089";

    Not sure if you have a strongly type Assembly but if you don't then try setting this in properties and using the key b77a5c561934e089

    Lastly you can remove the publickey entry from the config so you can continue to work until you figure this out :)


    Author Comment

    William -

    My assembly is strongly typed so I guess the first solution is out.  This is really stumping me.  I understand that building on the server will encounter a different set of permissions than on my local machine but I'm really at a loss here.  No matter what I try, I keep getting the exact same error.

    >>Lastly you can remove the publickey entry from the config so you can continue to work until you figure this out

    Which config file are you referring to here?

    LVL 12

    Expert Comment

    Sorry I meant the resx file not the config

    I will have to do a little more investigation nothing else comes to mind at the moment


    Author Comment

    I just re-read my post and I need to make one thing clear.  This is not just a build on a server.  It is a TFS Team build on the TFS server.

    Accepted Solution

    I was able to work through this issue by doing the following:

    I ran MSBuild locally following the instructions here:

    Everything built fine and copied the binaries to the Team Server where the app executed as expected.  That told me that the code was OK.  I tried several other things to tweak the security but none were effective.  Finally, I placed all the third party (DevExpress) DLLs that the build was referencing into the GAC and they build worked just fine.  Not sure why that worked but that was the solution (in this case).
    LVL 12

    Expert Comment

    Should be PAQ'd for others I think. This is a tricky problem and twenty put some work into solving it.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Flash ( has evolved over the years to where it has become a masterful tool for displaying content screen.  It has excellent layout placement, UI precision as well as rendering capabilities. This, along with t…
    Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
    how to add IIS SMTP to handle application/Scanner relays into office 365.
    Internet Business Fax to Email Made Easy - With eFax Corporate (, you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now