Red Gate forums :: View topic - Problems with string and path also without obfuscation
Return to www.red-gate.com RSS Feed Available

Search  | Usergroups |  Profile |  Messages |  Log in  Register 
Go to product documentation
SmartAssembly 6
SmartAssembly 6 forum

Problems with string and path also without obfuscation

Search in SmartAssembly 6 forum
Post new topic   Reply to topic
Jump to:  
Author Message
MarkCEO



Joined: 26 Nov 2012
Posts: 2

PostPosted: Tue Nov 27, 2012 12:03 am    Post subject: Problems with string and path also without obfuscation Reply with quote

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.
Back to top
View user's profile Send private message
Chris.Allen



Joined: 12 Mar 2009
Posts: 591

PostPosted: Wed Nov 28, 2012 1:41 pm    Post subject: Reply with quote

Hello. I'm old but I know a thing or two about Smartassembly Wink

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?
Back to top
View user's profile Send private message
MarkCEO



Joined: 26 Nov 2012
Posts: 2

PostPosted: Fri Nov 30, 2012 3:28 pm    Post subject: Re: Reply with quote

Chris.Allen wrote:
Hello. I'm old but I know a thing or two about Smartassembly Wink

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
Back to top
View user's profile Send private message
Chris.Allen



Joined: 12 Mar 2009
Posts: 591

PostPosted: Mon Dec 10, 2012 8:45 pm    Post subject: Reply with quote

I tried to reproduce but had no luck in forcing any kind of error.
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.
Back to top
View user's profile Send private message
eric-914



Joined: 30 Nov 2012
Posts: 28

PostPosted: Mon Dec 10, 2012 8:47 pm    Post subject: Reply with quote

When you try to run the obfuscated version, does the .config file exist in the same folder as the .exe?

This has caught me a few times.
Back to top
View user's profile Send private message
Chris.Allen



Joined: 12 Mar 2009
Posts: 591

PostPosted: Tue Dec 11, 2012 9:25 pm    Post subject: Reply with quote

Ah! Well done eric-914- this could well be the issue. Smartassembly has no effect on the .config file - which means it won't copy it over for you either so this could be the exact problem.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic All times are GMT + 1 Hour
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group