You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With Windows 10 and Mono.Cecil v0.9.6.4 there are problems to build CSCore, because the
Post-build event commands execute CSCli exe with failure, because the file CSCore.dll is blocked.
My patch of this section of Tools\CSCli\Program.cs :
/*
* Load and process assembly
*/
if (!File.Exists(filename))
{
MessageIntegration.WriteError(String.Format("Could not find file \"{0}\".", filename));
Environment.Exit(-4);
}
string origfilename = filename + "_orig"; //use this filename for reader of Mono.Cecil
File.Delete(origfilename); //delete previous version, if existing
try
{
File.Move(filename, origfilename); //file for reader
}
catch (Exception ex)
{
MessageIntegration.WriteError("Rename file to _orig failed: " + ex.ToString());
Environment.Exit(-3);
}
WriterParameters wp = new WriterParameters();
ReaderParameters rp = new ReaderParameters();
var strongNameKey = Path.ChangeExtension(filename, "snk");
if (File.Exists(strongNameKey))
{
MessageIntegration.Info("Signing with Key : " + strongNameKey);
wp.StrongNameKeyPair = new StrongNameKeyPair(File.OpenRead(strongNameKey));
}
//check whether the pdbfile has been passed through application parameters
if (pdbfile == null)
{
//if not use the default pdbfilepath by changing the extension of the assembly to .pdb
pdbfile = Path.ChangeExtension(filename, "pdb");
}
//check whether the original pdb-file exists
bool generatePdb = File.Exists(pdbfile);
//if the original pdb-file exists -> prepare for rewriting the symbols file
wp.WriteSymbols = generatePdb;
rp.ReadSymbols = generatePdb;
if (rp.ReadSymbols)
{
rp.SymbolReaderProvider = new PdbReaderProvider();
}
MessageIntegration.Info("Generating pdb: " + generatePdb.ToString());
//open assembly
var assembly = AssemblyDefinition.ReadAssembly(origfilename, rp); //read
//add the directory assembly directory as search directory to resolve referenced assemblies
((BaseAssemblyResolver)assembly.MainModule.AssemblyResolver).AddSearchDirectory(Path.GetDirectoryName(origfilename));
//path the assembly
AssemblyPatcher patcher = new AssemblyPatcher(assembly, calliAttributeName, removeTypeAttributeName);
if (patcher.PatchAssembly())
{
try
{
assembly.Write(filename, wp);
}
catch (Exception ex)
{
MessageIntegration.WriteError("Creating patched assembly failed: " + ex.ToString());
Environment.Exit(-2);
}
MessageIntegration.Info(String.Format("CSCli patched assembly \"{0}\" successfully.", Path.GetFileName(filename)));
Environment.Exit(0);
}
else
{
MessageIntegration.WriteError(String.Format("\"{0}\" could not be patched.", filename));
Environment.Exit(-1);
}
The text was updated successfully, but these errors were encountered:
With Windows 10 and Mono.Cecil v0.9.6.4 there are problems to build CSCore, because the
Post-build event commands execute CSCli exe with failure, because the file CSCore.dll is blocked.
My patch of this section of Tools\CSCli\Program.cs :
The text was updated successfully, but these errors were encountered: