Obfuscating web apps


A

anon2005

Hi all,

This is partly a question, partly looking for feedback.

I've developed a web app that may be distributed to a few companies,
and I'd like to obfuscate the code. I haven't tried this with a web
app yet, let alone an ASP.NET 2.0 app.

Right now I'm publishing my web app as non-updateable, so I've got an
App_Code dll for about 15 or so classes, and then several dozen for the
ASPX pages.

I haven't used Dotfuscator before, so I jumped in right away and
obfuscated the App_Code dll... even as I copied the obfuscated dll to
the webserver, I realized this would break things since my ASPX pages
relied on those class libraries. So, to obfuscate my business logic, I
need to include all my ASPX pages in the process so the symbols are
correct.

It's only a few dozen pages, but each time a page is added, I now need
to modify the dotfuscator project. This got me thinking:

- Is there any way to tell VS to compile all pages together in a single
DLL (like VS 2003)?
- Anyone have tips/experiences about dotfuscating their web
applications? I'm guessing I must precompile everything for this to
work correctly (which is ok, it's what I want to do for now).

Thanks for the feedback,
Tom
 
Ad

Advertisements

A

anon2005

Thanks to both of you. I have a question about the build process... I
noticed on one of the pages
(http://msdn2.microsoft.com/en-us/library/ms227976.aspx) it says:

--
If your Web site is not an Internet Information Services (IIS)
application and therefore has no entry in the IIS metabase, used the
following value for the -v switch.

aspnet_compiler -p physicalOrRelativePath -v / targetPath
In this case, the physicalOrRelativePath parameter refers to the fully
qualified directory path in which the Web site files are located, or a
path relative to the current directory. The period (.) operator is
allowed in the physicalOrRelativePath parameter. The -v switch
specifies a root that the compiler will use to resolve application-root
references (for example, with the tilde (~) operator). When you specify
the value of / for the -v switch the compiler will resolve the paths
using the physical path as the root.

The targetPath parameter is a physical path to the destination
directory
--

My application uses quite a bit of app-root references (ie, an image
with ~/images/blah.jpg as the source) -- I understand what the above
paragraph is saying, but is there a specific benefit to specifying this
(performance) parameter? In my case I want to _avoid_ this because
I'm allowing the user to install in a directory of their choice, thus,
I need to resolution to happen at runtime. Just trying to understand
the usefulness of the switch.

Thank you for the info! The only oddity I noticed is that the publish
didn't copy images -- it only copied the marker files and the dlls.
The docs seem to indicate that it should copy everything. Perhaps I
missed an option in there...
 
Ad

Advertisements

S

Scott Allen

aspnet_compiler -p physicalOrRelativePath -v / targetPath
In this case, the physicalOrRelativePath parameter refers to the fully
qualified directory path in which the Web site files are located, or a
path relative to the current directory. The period (.) operator is
allowed in the physicalOrRelativePath parameter. The -v switch
specifies a root that the compiler will use to resolve application-root
references (for example, with the tilde (~) operator). When you specify
the value of / for the -v switch the compiler will resolve the paths
using the physical path as the root.

I've been curious about this switch ever since the precompiler command
line utility appeared. I have not actually been able to see a
difference at compile time - all the ~ paths still get resolved at
runtime and not by the compiler. (This is true when using -v in
conjuntion with -p). There may be some special case where the
precompiler actually steps in to resolve a ~, but I have not found the
special case yet.

One impact the -v switch does have is that the -v paramter is used to
select the directory in Temporary ASP.NET Files to do the code
generation and compiling. So far that is the only impact I've seen of
twiddling with -v.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top