Adding String resource to .resx in PCL causes a compilation error

I have a resource file in my portable class library that currently contains about 30 lines. They are available from my Windows Phone 8 application, and the lines that are already in the file work fine.

However, now when I try to add a new line, as I did before it causes a compilation error:

"System.Type" does not contain a definition for "Assembly" and does not use the extension method "Assembly", which takes the first argument of the type "System.Type" (do you miss the using directive or assembly?)

In the .designer.cs file it is clear that this is a problem. When a new line is added, two changes occur:

  • using System.Reflection; disappears
  • `global :: System.Resources.ResourceManager (" ViewModels.Resources.StringResources ", typeof (StringResources). Assembly); instead:

    new global :: System.Resources.ResourceManager ("ViewModels.Resources.StringResources", typeof (StringResources) .GetTypeInfo (). Assembly);

The .GetTypeInfo () error and the disappearance of the operator used is a problem, but I can not return them, because the file is created by the visual studio and returned back. Any ideas?

The only significant change I can think of is the new Visual Studio 2012 2 update?

It is also worth noting: If I add another resx to another place in the project (wp8 application or another pcl), then this exhibits the same behavior when adding a line.

+5
source share

All Articles