Hi, I have a problem and it is a problem in my application when I compile it, it always shows me the same warning:
The primary reference "System.Linq", which is a framework assembly, could not be resolved in the currently targeted framework. ".NETFramework, Version = v4.0". To resolve this problem, either remove the reference "System.Linq" or retarget your application to a framework version which contains "System.Linq". (MSB3267) - C: \ Program Files \ MSBuild \ 12.0 \ bin \ Microsoft.Common.CurrentVersion.targets: 1635,5
Try putting xml.linq but in my code it returns errors. Then try using system.linq but even though I put version 4.0 it shows me the same error. the code is:
byte[] file = File.ReadAllBytes(System.Reflection.Assembly.GetExecutingAssembly().Location);
var position = PatternAt(file, Encoding.ASCII.GetBytes("BLAUMOLAMUCHO"));
int longitudSeparador = Encoding.ASCII.GetBytes("BLAUMOLAMUCHO").Length;
byte[] encodedBytes = new byte[file.Length - position.First() - longitudSeparador];
Array.Copy(file, position.First() + longitudSeparador, encodedBytes, 0, file.Length - position.First() - longitudSeparador);
public static IEnumerable<int> PatternAt(byte[] source, byte[] pattern)
{
for (int i = 0; i < source.Length; i++)
{
if (source.Skip(i).Take(pattern.Length).SequenceEqual(pattern))
{
yield return i;
}
}
}
I tried compiling with both but none of them worked, I put version 4.0 but still showing the error that I should do?