In our college they have competition--students have to develop and show some code. It has a cash prize. I have done an entry as a website (C#) using asp.net. The problem is that my website is in the computer laboratory of the college, so anybody can open Visual Studio and copy my project or edit it.
I want to protect my project. Is there any way to put password for the project alone in Visual Studio? To make it attractive I have hosted the website in the IIS of the server, so by using the IP adresss I can run the project anywhere with intranet access.
When I put a lock like EasyFileLocker, I am unable to open and run the project using the IP address.
I want to run my project anywhere in the intranet, but also protect its code.
How can I do that?
Presuming your source code is somewhere safe (if not, then put it somewhere safe over which you have control), then the deployed end result need not expose the source code in its raw format; you can pre-compile ASP.NET websites entirely (such that even the markup can't be edited on the server - at least not very easily) - do this by selecting the pre-compilation options on the deploy screen, being sure to uncheck "allow this website to be updatable".
the exact method of specifying the right build options differs between VS versions, but the options are the same ultimately: Precompile, (Don't) Allow precompiled site to be updatable.
The result is the code of your website ending up in binaries, including the page markup (the files still exist, but simply as placeholders with their substance missing.) For someone to get at your code, they'd need to reflect your binaries.
Related
Is it possible to duplicate a live Umbraco site which we have full access to (Backoffice, passwords etc.) and copy its content into another account? The idea is that we want a clone of the live site to practice on without danger of changing something and accidentally ruining the currently working and published live site.
To simplify, we have:
A working live Umbraco site with admin privileges so we can access all files.
A new, separate Umbraco account which is essentially a blank canvas with access to all files.
We would like to duplicate all the files and content from the live site to the new account just to have something that closely resembles the live site to practice building widgets etc.
We are working in Visual Studio 2012 with C# and Razor and want to use the latest version of Umbraco CMS (currently 7.3.0-beta Prerelease according to NuGet Package Manager).
Have I got the right idea with this approach or is there a better way? I am aware of Umbraco Courier but would like to know if there are any options other than a paid-for add-on.
If this is the best approach, what is the procedure, and if not, what are the options and why are they preferable?
This can be achieved quite easily by copying the files to a new environment, restoring a backup of the database to a new environment and then updating the connection string in the web.config. This will give you a working copy of the live site. If you are looking for a continuously synchronised solution then that is a different matter, Courier has never worked for me reliably.
I have developed a application in ASP.NET using c#. The entire application working fine but the problem is when I open the application for first time it running very slow. i.e. its taking so much time to load a page like home page or any other page. But when I reopen that page then that page opens quickly as I expect. Even whenever application getting session expired and relogin into application its taking so much time again to load all the pages for the first time, where from 2nd time to opens that pages its not happening. So can anybody tell me what is the problem occuring here.
The application is compiled on the first request.
Read this article by Microsoft.
Because ASP.NET compiles your Web site on first user request, you can
simply copy your application's source code to the production Web
server. However, ASP.NET also provides precompilation options that
allow you to compile your Web site before it has been deployed, or to
compile it after it has been deployed but before a user requests it.
Precompilation has several advantages. It can improve the performance
of your Web site on first request because there will be no lag time
while ASP.NET compiles the site. Precompiling can also help you find
errors that might otherwise be found only when a user requests a page.
Finally, if you precompile the Web site before you deploy it, you can
deploy the assemblies instead of the source code.
You can precompile a Web site using the ASP.NET compiler tool (ASPNET_Compiler.exe). The tool that provides the following precompilation options:
In-place compilation This option performs the same compilation that occurs during dynamic compilation. Use this option to compile a Web site that has already been deployed to a production server.
Non-updateable full precompilation Use this to compile an application and then copy the compiled output to the production server. All application code, markup, and UI code is compiled into assemblies. Placeholder files such as .aspx pages still exist so that you can perform file-specific tasks such as configure permissions, but the files contain no updateable code. In order to update any page or any code you must precompile the Web site again and deploy it again.
Updateable precompilation This is similar to non-updateable full precompilation, except that UI elements such as .aspx pages and .ascx controls retain all their markup, UI code, and inline code, if any. You can update code in the file after it has been deployed; ASP.NET will detect changes to the file and recompile it. Note that code in a code-behind file (.vb or .cs file) built into assemblies during precompilation, and you therefore cannot change it without going through the precompilation and deployment steps again.
However, you mentioned that it's also slow if the session expired. Maybe you are loading too much into memory on session start. It's difficult to make a diagnosis without more informations.
Check your site in firebug in .net tab there you will find which part of your page take much time to load,
there might be some exceptions or some code errors in client side language.
Try to use less sessions
and debug your code to clarify no extra looping of code
(sorry for bad English but hopefully you have got my point)
If we make a slight modification of the code in the C# page or in the aspx page, do we have to republish the entire web-site after the modification?
I am using VS-2008 professional and the code is written in C#.
It depends, if you are connnected to the website using a ftp connection (Solution showing as ftp://ftp.somewebsite.com) then your alterations will be updated real time. If you are using a local copy of the website (offline website), you need to publish the entire website once your are done.
So to answer your question we need more information about how you setup your website in the solution.
There are two case of modification:
UI (HTML Code), you can just click to refresh the browser without having to rebuild the solution
Server Code (C# code), you have to click F6 in VS2008 and rebuild the solution
It depends on which code you modify:
if you make a change to the asp markup of the aspx , than you don't have to.
if you change your code behind, then you will need to rebuild your
project therefore you have to republish it.
As a company for years we have worked using old ASP (vbscript), we have just started updating to c# .net. our first MVC3 project is ready to be uploaded to the web server for testing and to iron out any bugs.
After reading about it I have made myself fairly familiar with the theory of it.
System.Web.Mvc
System.Web.Routing
System.Web.Abstractions
Have all been set to copy local 'true'
Right clicked the solution and selected 'Publish'
Created a new profile
Filled in the connection details, although I am unsure exactly what is meant by the 'Site Path' and 'Destination URL'
As it stands the site path is the scripting path and the destination URL is the URL as it would be typed into an address bar in a browser.
connection does validate.
in setting I have selected release
The there is a little tick box which seems scary to me, it says "Delete all existing files prior to publish" The server I am uploading to contains all our live and test websites, although I have created a new folder for the project, I under no circumstances want it to touch, edit, modify or delete anything else on the server. So this box is unchecked. Can anyone verify that leaving this unchecked will ensure it does nothing to anything else on the server?
Then in preview it simply says "Your application will be published to: (IP address of server)
Can anyone who has done this before give me some guidance this is the correct method to go? I could do it will less worries through a normal ftp but would like to be able to utilise Visual Studios tools. Its Visual Studio 2012.
Sorry if this isn't the exact correct place for this question.
After trying to do this for a while I discovered that publishing to ftp was a waste of time and the hard way to go about things. Although probably alot of you know this.
Instead I just published to a system file and then uploaded it with cuteftp to the web server. This maybe isn't the most professional way to go about things but from someone that comes from a primarily web scripting background, I found this alot less confusing and alot easier to manage.
I just thought I would answer my own question to resolve this thread.
I'm new to ASP.NET, and would like an understanding of when/where to use WSP vs WAP.
I will make a rather simple business website, with 6-7 pages, where one page will open a registration/login form where the user can see various personal data and reports, pulled from a database.
Would this suggest the use of a combination of WSP and WAP, where for example the login window is part of the WSP, and a successful login opens a WAP in a frame or in a new browser window/tab?
mmhh you are confused with the notion of web application and web site.
You cannot make one page in one way and another the other way, because WAP and WSP are type of project. So it is at the beginning of your project in visual studio to decide which one to use.
Basically, WSP is leaving the compilation of your code to IIS, and so you are working only with files. Using WAP, your project behaves like in a normal application, Visual studio will then compile your code to create different dll. You will then have only to move to your production environment the page aspx and the dlls, whereas with WSP, you would also include aspx.cs.
this link will tell you everything you might want to know
hope it helped,