Problems with string and path also without obfuscation
MarkCEO
Posts: 3
Good evening, i'm new, i'm trying SmartAssembly to protect my software, i tried also without all obfuscations and etc.. disabled but just with rebuilding the application through SmartAssembly i have few exceptions and i don't know why; all these exceptions concern strings and paths.
for example:
EXCEPTION:
Value cannot be null.
paths -> in System.IO.Path.Combine(String[] paths) in PokerDream.Client.Data.SQLiteDatabaseHelper.GetConnectionString(String connStr)
METHOD:
private string GetConnectionString(string connStr)
{
try
{
var dir = Path.GetDirectoryName(connStr);
var file = Path.GetFileName(connStr);
return System.IO.Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "XXX", "XXX Client", dir, file);
}
catch (Exception ex)
{
Logger.Log(Logger.LogType.ERROR, ex);
}
return string.Empty;
}
EXCEPTION:
Invalid path format
in System.IO.Path.NormalizePath(String path, Boolean fullCheck, Int32 maxPathLength)
in System.IO.Path.GetDirectoryName(String path)
in PokerDream.Client.Data.SQLiteDatabaseHelper.CreateDB()
METHOD:
var dir = Path.GetDirectoryName(connectionString);
and another similar problem.
I have also problems with webservices.
Thanks in advance.
for example:
EXCEPTION:
Value cannot be null.
paths -> in System.IO.Path.Combine(String[] paths) in PokerDream.Client.Data.SQLiteDatabaseHelper.GetConnectionString(String connStr)
METHOD:
private string GetConnectionString(string connStr)
{
try
{
var dir = Path.GetDirectoryName(connStr);
var file = Path.GetFileName(connStr);
return System.IO.Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "XXX", "XXX Client", dir, file);
}
catch (Exception ex)
{
Logger.Log(Logger.LogType.ERROR, ex);
}
return string.Empty;
}
EXCEPTION:
Invalid path format
in System.IO.Path.NormalizePath(String path, Boolean fullCheck, Int32 maxPathLength)
in System.IO.Path.GetDirectoryName(String path)
in PokerDream.Client.Data.SQLiteDatabaseHelper.CreateDB()
METHOD:
var dir = Path.GetDirectoryName(connectionString);
and another similar problem.
I have also problems with webservices.
Thanks in advance.
Comments
I'm a bit confused about what exactly led up to those errors you got as i don't recognise them as Smartassembly errors- they even look more like compiler errors.
Can I just check- your application compiles and runs perfectly well unobfuscated?
When you build a smartassembly project- with no features selected at all- you get the errors you mention?
yes works perfectly
This is not a known error so please treat this like a undifferentiated bug in code and can you track down where in the code it actually behaves differently to non-protected code? For example, it looks like the path string is not initialized so if we can track down why we should be closer to diagnosis.
Sorry I cannot be more specific.
This has caught me a few times.