Advice for Web Site Development (WinCE) - asp-classic

I need to set up a web server on WinCE (7.0) and the following are some of the features that I need to implement through this web site:
be able to update the device software (run an exe) and display output
start/end process
display the run-time of device
Should I use ASP or ISAPI on my web server on WinCE 7(WEC 7) platform? If you include some reasons for your response, it would be great.
I was planning on using ASP because of its simplicity compared to ISAPI; however, when I tested a simple Hello World(hello.asp) page on the device, it took around 30 seconds to load the page. For testing purposes, I am using Windows Virtual PC. So I am not sure what is causing it to be so slow. If you could please enlighten me on this topic too, it would be great.
I looked up ASP .NET Compact framework but I am concerned about performance again.
I am beginner on WinCE development and web development so any answers would be greatly appreciated.
If you need any other information to better answer the question, please let me know and I will provide it.

Classic ASP on CE is really, really limited. You're not going to be able to hit your targets without a custom COM control, which is not very fun to write or debug and it will have to be installed on the service device. Out of the two you've proposed, ISAPI is the only one that will reasonably do what you want.
It's a side note, but from experience I'd not use either due to the absolute pain of debugging either one. I'd use a separate commercial ASP.NET web server for Windows CE. Of course I created it, so I'm biased, but really, even creating your own port 80 server is going to be less painful than the piss-poor out-of-box offerings in CE.

I found out the problem with the slow loading ASP. It is an error with the WinCE 7 web server. Microsoft has released an update that fixes that problem.
Windows Embedded Compact 7 Monthly Update July 2011
So I think I will go ahead and use ASP. I'll see if I can add the features that I need to implement.

Related

Running Python & Django on IIS

Is it possible to run Python & Django on IIS?
I am going to be a Lead Developer in some web design company and right now they are using classic ASP and ASP.NET.
As far as I can see ASP.NET MVC is not mature. Should I recommend Python & Django stack?
If it's not possible to run Python on IIS what do you think I should do? Stick with ASP.NET which I don't know? I don't know python well as well but I'm more comfortable with it.
Can I run IIS and Apache in parallel?
There's two issue here, technological and psycological.
Technologically, yes, it's definitely possible. In fact, Django has a wiki article about this. Google also shows a lot of similar tutorials. Apache and IIS can also run on the same machine (I'm actually doing that right now from a development machine).
The bigger issue will be psycological, in the form of backlash you'll get from the other developers. I agree that Django kicks the pants off ASP.NET, but you're probably going to find that an ASP.NET shop is going to be married to ASP.NET and will likely ignore your suggestion to try anything else, much less Django.
We've been running django on IIS for a couple of years using PyISAPIe. It's a fairly big site, about 150,000 users. We're moving to linux/apache though, partly cos PyISAPIe isn't great.
Case in point - WebKit browsers don't work well with it, it seems to mess up the chunking. That's tolerable for us as we are allowed to limit our users to FF/IE7+, but annoys me on a mac as I much prefer Safari to FF.

Leading the jump from Classic ASP to ASP.NET, any advice?

I just started at a new company that has 99% of their code written in classic ASP (most of it poorly written) and part of the reason they hired me was because I had worked with both ASP and ASP.NET in the past. The ASP.NET experience was VB.NET but I've worked with C# in college but I prefer it just because I've worked a lot with PHP in the past and when I'm not focusing I just start typing C syntax and have had many occasions here in ASP where I end lines in a semi colon just out of habit and have to go back and delete it.
But I digress, basically I just don't have the knowledge I need to make the best decisions on things have made notes of some key processes that I'd like advice on:
Version Control - truth be told I've never really used it. On my own I just never had that whoops moment to push me to use it and shops I've worked in have always just thrown caution to the wind. Would like to know what you all think I should use as far as the server side and
Local Dev Environment - Probably something I'll just quickly Google but I want to setup a local dev environment so I can test stuff without having to FTP it somewhere first.
Pushing Changes Live - I've never really understood the step between checking something into version control and seeing it live, is there some sort of automated system that can go "hey I see you checked in, let me see what's different between this and the live version and push the affected files" – possibly just a lack of vc understanding all together: (
IDE - Downloading VS2010 Beta 10 now, hoping it's stable
MVC.NET - Easy to pickup? I always hated the whole concept of Web Forms, seemed like it didn't ultimately fit the Internet the rest of the world is developing.
Anything Else - Like I said I'm relatively new to this stack so I'd love any advice I can get early on to avoid any "shit, I wish I knew that 3 months ago" moments.
Version Control:
Definately have a look at SubVersion, its free, we use a paid-for hosted service called Assembla (www.assembla.com) but you can install the server on your network. Themost popular client is called TortoiseSVN (http://tortoisesvn.tigris.org/) its also free.
You can also have a look at VisualSVN (http://www.visualsvn.com/) which integrated into the VS IDE, their site also has a handy SVN server installation.
Local Dev Environment
Local IIS or Built-in VS web-server in VS are both fine, it really down to preference I think. Opening a website (File-system based) rather than IIS based seems to work quite well for us.
Pushing Changes Live
ASP is very page by page based development and doesnt require compiling, copying files up to a test or production site is quite easy. Depending on how you compile/publish your asp.net site, you will need to consider how you compile library code and publish your web application/website.
I would recommend starting off by using SVN to commit changes and to update test/production sites.
IDE:
I would recommend updating to the latest Beta version of VS2010 and use that.
Anything else:
Consider the rollout, are you replacing everything before going live?
Consider adopting an existing framework, use an ORM, or Business Objects framework, possibly even use Code-Generation. Have a look at CodeSmith, it has various ORM/Business Object Frameworks associated with it. (these will use various teqniques and technologies in the .net framework, which you will need to learn)
Look at the basic structure of the site:
Consider asp.net WebForms (Applications) or MVC (Websites) [yes, this is a very basic analysis of the differences]
Site Membership and Permissions: Have a look at the MembershipProvider, RoleProvider and build your own.
File System: Consider how and where you will upload files.
Separate UI into re-usable UserControls.
HTH, Good Luck you have a lot to do...
Wow. lots of questions here:
Version Control - Look into Subversion and Git. They represent two kinds of version control, you might like one more than the other. Git is free for open source projects.
Local Dev Environment - I would recommend using the built-in web server in Visual Studio. You can right-click a page in your solution explorer and say "view in browser". Then it will just compile it right there and open up an instance of the local web server.
Pushing Changes Live - I am not gonna offer advice here. Someone smarter than me will surely do so.
IDE - Yeah, just stick with the current version of Visual Studio. If you don't have any active (for pay) projects, I think the VS2010 is a good idea because it supports the newest upcoming features of asp.net and by the time you learn them, it will probably be released to the public anyways.
Anything Else - It's worthwhile (from getting work perspective) to know WebForms in and out. But I would highly suggest learning ASp.Net MVC (if, for no other reason than, "it's more fun").
After reading Mark Redman's answer, it triggered something for me. I would recommend (as he does) that you investigate some sort of ORM. I use SubSonic and really love it. Bu t there are lots of options out there.
Those are my 2 cents.
I'm going to focus on versioning and project tracking here. Development environments for ASP.Net are well documented.
Version Control - I use SVN (version control) with Tortoise SVN (windows client integration) and Trac (project tracking). SVN and Trac both run on Apache (a web server).
Pushing Changes Live - Commit your changes to SVN from your dev machine, do a SVN update on your test site to pull down the latest changes from the repository, run tests, then do a SVN update on your production site.
Anything Else - In this scheme Apache, Subversion, and Trac will be running on a server that is NOT your development machine and hopefully (but not necessarily) also not the same server that is running your production IIS.
Check out:
Apache HTTP server: http://httpd.apache.org/
Subversion: http://subversion.apache.org/
Tortoise SVN: http://tortoisesvn.tigris.org/
Trac: http://trac.edgewall.org/
One thing to take account of is basically going from Classical ASP to ASP.NET is about as similar as going from COBOL to ASP.NET. Everything will basically need to be a complete rewrite (especially as you said there were poor development practices in the original codebase)
Version Control: Definitely use it, there's also Team Foundation Server which if you can convince the company in the value of purchasing you a MSDN subscription TFS is included at no additional cost for 5 or less users.
Pushing changes live: I currently use Web Deployment projects (not sure if they're compatible with VS2010), TFS is also a build server I just haven't had time to setup the responsibility for that. If you take advantage of TFS fully I'd also recommend looking into a continuous integration (CI) tool something along the lines of Jetbrains's TeamCity or CruiseControl etc.
Local Dev Enviroment: Get Jetbrains's Resharper! This is the number one most important tool to developing software in .NET second only to Visual Studio itself!
Anything else: Learn generics and lambdas/expression trees both are integral to proper software development in .NET and both are moderately to extremely complex topics (IMO).
Version control: I see many recomendations of SVN here but... it's just outdated. Use GIT or Mercurial. They merge algorithms are more robust. The are faster and safere because they are distributed. They are more flexible - you can construct a workflow model that suits your company well while there is basically one way of using SVN.
Pushing changes live: After you have version control, the next thing to do is making a Continous Integration server thah repeatedly checks out repository and perform automated build. You can get immediate information who and where made an error. You can make this build do anytking you want: perform static code analysis, unit tests, deployment. You can make several builds - one, automatic, that builds a project and deploys it to a testing environment. And another one, triggered manually, that will deploy to live. I worked with Hudson, Jenkins, CruiseControl.NET, TeamCity and I've found TeamCity to be the most user friendly tool of that four.
Local dev env: Althoug IIS Express (that Visual Studio built-in) is OK in many cases, you have to know where it differs from the 'real' one. I would just recommend using the full IIS 7.
IDE: Visual Studio + Resharper + Notepad++ + LINQPad.
Anything else: Have some bug tracking/planning software. Even as simple as http://www.trello.com, but use it. My favourite is http://www.pivotaltracker.com
Introduce code review into the workflow. http://www.reviewboard.org might help.

how to write code in asp.net to stop reverse engineering of asp.net application

We are having an application that is downloadable. We want to stop the application being reverse engineered by someone to lose our business. It there any way to stop this?
What do you mean by an downloadable application? You are talking about ASP.NET applications in the title of the question, but that's not a kind of application which can be downloaded. If you have a Console/WinForms/WPF-Application that has compiled binaries, you could use code obfuscation tools to make reverse engineering harder.
Best Regards
Visual Studio (usuall) comes with Dotfuscator (community edition). Look in your Visual Studio Tools program files entry.
PreEmptive Solutions’ Dotfuscator is
the leading .NET Obfuscator, Compactor
and Watermarker that helps protect
programs against reverse engineering
while making them smaller and more
efficient. Dotfuscator Professional
Edition is designed to stop even the
best of decompilers from producing
useful output. It provides
comprehensive and efficient .NET code
development and deployment.
I've had a similiar problem. I had a server based piece of software that was loaded onto a server within the customer's premises. This meant anyone half technical could copy the files from the server onto disk and re-install with some know-how onto another server. Basically, stealing my work.
I wrote in numerous measures, I obfuscated the code and I put hooks into all corners of the server (registry, database, root of drive) so if the code was installed elsewhere the system wouldn't find these items and lock itself up. I even went to the lengths of self encrypting some of the source files and then deleting the encryption tool itself. Unfortunately, if anyone wants to steal the software however, they still can. You have to realistically judge how much effort you must put it to stop a percentage of thefts. I love Roeder's Reflector, but it's programmes like this that allow a competent programmer an insight into your protection code and circumvent it.
Have you looked at 3rd party products like Xheo: http://www.xheo.com/products/codeveil/?gclid=CL-Tjoye7psCFdYB4wodHGVZAQ?
I found this on SO too: Protect ASP.NET Source code
I hope this helps.

When should new .NET projects be designed for .NET 4 Framework

I am preparing to start on a new short-term contract (1-2 months) that involves replacing an Access application by moving it to ASP.NET and SQL Server.
I am only responsible for the ASP part and connecting it to the database.
The only requirement is that whatever technologies I use be relatively well-known in the area, so that if they need to have someone else work on it, it isn't specialized knowledge.
So, I could do this in Rails or ASP.NET, but, when should the development be aiming for .NET 4 Framework, as there are many changes coming out that may be advantageous to use.
Or, even though it may be useful, when is it better to just ignore new features and stay on an older version of .NET?
I am assuming that hardware isn't the limitation, as many computers won't be able to run .NET 4 Framework, but that would be an issue for a hosting company, as they can find a hosting company to support whichever framework the application is designed for. If Rails makes the most sense, as their hope is to have the application written quickly, but have it reliable, then again, the hosting company would need to support it, or they use a different one.
This company hasn't used a hosting company, they need to find one, so there isn't a relationship that could be an issue.
UPDATE: Part of my concern is that initially the application will not require javascript, but phase 2 will be to make it more interactive, as some clients won't be allowed to have javascript on their computers. In order to limit how much javascript must be known by a developer there are frameworks that will adapt to browsers and situations fairly well, which is why I am also thinking about RoR and the fact that there appears to be changes coming out in .NET 4 that may help with this.
As a general rule of thumb, I wait one year before building sites in a new framework unless the client specifically asks for the newest technology. This has worked out very well for me. The advantages are:
The technology is much more stable (hotfixes, service packs, etc.)
Common complaints about missing functionality are usually resolved
Hosting companies, support communities and corporate IT departments have had time to get used to the technology, find out more about it, play around with it and have it mature within their organization
Unless there is specific need for new functionality introduced by .Net 4, there is no point in subjecting your clients to the immediate problems with an initial release, or making it more difficult for them to find hosting. You should either investigate all of this up-front, or use .Net 3.5 in the meantime.
The only requirement is that whatever
technologies I use that it be
relatively well-known in the area, so
that if they need to have someone else
work on it, it isn't specialized
knowledge.
I would have thought that requirement was enough not to develop this project on .NET 4.0 - it takes time for a new framework version to filter down into the market, and it will be a while yet before there are a lot of developers around with .NET 4.0 experience.
Also, you would be essentially developing on top of a BETA product - while I'm sure most of the features will remain unbroken from BETA -> RTM, there is always a risk that something will break or not work like it did in BETA, so why risk this on a commercial project?
I wouldn't target .NET 4.0 yet on a commercial project unless there was a specific reason for doing so, and even then you would have to have buy-in from the client, ie "I can do this much more quickly and with less effort if we use the current beta version X rather than established, stable version Y" - good luck with that.
I worked on a commercial project that used the CTP version of LINQ to SQL - then when we went to VS2008 / 3.5, suddenly everything changed and we had to make a lot of changes just to get LINQ to SQL working again.
Stick with 3.5 - it's easier for hosting and getting developers.
Just a couple of thoughts, I wouldn't even think about creating an application for production use in .NET 4/ASP.NET 4 until:
There is a release candidate. It's
not the first time I've seen
features in beta's not make it to
RC/RTM.
Microsoft have permitted development and deployment
of production applications by way of a 'Go
Live' license.
There are some hosters out in the market such as OrcsWeb who are participating in public beta testing, but they aren't intended for production use.
I'd run with the .NET 3.5/ASP.NET 2.0 or MVC bits for now. Better safe than sorry.
Generally speaking it's going to be easier finding hosting for a Rails app. If you want to run .net 4.0 you're probably going to have to run a VPS or dedicated machine. However if you're bailing after the application is finished and assuming your client is in Knoxville, they're going to have a tougher time finding a Rails developer to maintain the application.
I think the bigger question is your role. They're looking to you to solve this problem for them. Are you productive in both technologies? How about getting a Windows server up and running? A Linux server? How's your SQL Server vs MySql? I'd guess that you're probably stronger on one stack vs the other - for a contract that short I wouldn't want to be doing a lot of experimental development.
i wait until the OS that everyone will be using has it.
Just last month i took a dependancy on GDI+, which first shipped with Windows XP.

How can I serve an ASP.NET application on a Linux Server?

Is it possible? If so, please explain how to do it.
I think you are looking for mono.
You can run most ASP.Net applications on Linux using Mono:
http://www.mono-project.com/ASP.NET
Mono is an open source implementation of (most of) .Net
As other posters have noted, you can use Mono and Apache with mod_mono. I have no idea whether it's robust and feature-rich enough for your needs. (Mono's current implementation of WCF is only skeletal, for example.) So whether it's advisable depends on what you plan on doing. If other people's money is riding on your applications being robust, it's safest to just plonk some money down on a windows server and going full Microsoft.
Update: in the comments, you suggest that price is a concern. In the long run, what you pay for hosting is tiny compared to the costs involved in using inferior software. I'd recommend either using Windows hosting, or using a different development environment altogether if you have a choice. LAMP, Java, Ruby on Rails--each of these are perfectly fine choices, and I'm sure there are many others. But if you are constrained to using .NET for some reason, Microsoft is really the only choice right now for enterprise-quality ASP.NET.
I wouldn't try using Mono. You could use VMware or something but I would try go a different route. You can run a very basic ASP.NET site on Mono; but I mean very basic. If your site is non-trivial, I wouldn't recommend this approach.
It's possible to run ASP.NET on Linux. You should take a look at the Mono project, Mono has an implementation of ASP.NET and ASP.NET AJAX.
You need to use mono and XPS (which is the server that runs the ASP.NET framework on mono). There is a standalone version of XPS and one that works through Apache. That is the best way to serve the files on Linux.
It may be possible with the use of WINE (or something similar, Mono, thats it.) but you will require all the .NET framework so it may be a bit much to setup

Resources