[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 3954
  • Last Modified:

Build Error: error MSB3103: Invalid Resx file

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=2.0.0.0, 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=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
  </resheader>
  <resheader name="writer">
    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
  </resheader>

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.
0
twentysixpoint2
Asked:
twentysixpoint2
  • 3
  • 3
1 Solution
 
williamcampbellCommented:
Here is how to get the public key being used ... may or may not help

http://blogs.msdn.com/miah/archive/2008/02/19/visual-studio-tip-get-public-key-token-for-a-stong-named-assembly.aspx

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 :)



0
 
twentysixpoint2Author Commented:
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?

Thanks.
0
 
williamcampbellCommented:
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




0
Get quick recovery of individual SharePoint items

Free tool – Veeam Explorer for Microsoft SharePoint, enables fast, easy restores of SharePoint sites, documents, libraries and lists — all with no agents to manage and no additional licenses to buy.

 
twentysixpoint2Author Commented:
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.
0
 
twentysixpoint2Author Commented:
I was able to work through this issue by doing the following:

I ran MSBuild locally following the instructions here: http://msdn.microsoft.com/en-us/library/ms181723.aspx

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).
0
 
williamcampbellCommented:
Should be PAQ'd for others I think. This is a tricky problem and twenty put some work into solving it.
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now