开发者

Uploading issues with an asp.net website

I have created my first website using asp.net 3.5 . I have used App_Code for managing my source code files.

Now, after completion:

  1. List item
  2. What needs to be uploaded to the server ?
  3. Do uploading all file including webforms files, source code files make any sense ?
  4. Please provide your own suggestio开发者_Python百科ns apart from these.


You should look in to one of these several very good tutorials and articles about deploying ASP.NET applications.

  • How to Deploy ASP.NET
  • 15 Seconds: Deploying ASP.NET
  • Deploying ASP.NET Applications on IIS 6
  • Deploying ASP.NET Applications

Now to your thoughts on what should be uploaded and what not. If you understand the asp.net cycle and how the files are processed by the webserver, it would be easy to know that all files need to be uploaded. But since this is your first application you probably don't have that knowledge.

So, to save you some reading time, Upload everything. In older versions such as 1.1 you had to compile all your source-code into binaries, which you don't have to anymore, but you can, it's up to you.

I However prefere to upload all the files without compiling it to binaries, makes it easier to manage once they are on the server.

The webserver will upon request ( first request ) compile these and then use the compiled files on other requests, this is the short answer anyway, this is why the load-time is longer the first time and the other times it's ( suppose to ) go faster.

Also, worht to know is that if you change the web.config, the application will re-compile.

So just drag n' drop em' to your webb-location and start playing!


If you are using the App_Code folder, it sounds like you are using a web site project type. In this case, the easiest thing to do is just xCopy all of the files up to the webserver. IIS will then do Just In Time compilation (JIT) the first time a page is hit, and will compile your code on the fly.

rgds,

Paul


  1. All content files (i.e. aspx, ascx, asmx, asax, js, css, htm, jpg, gif, png) and DLLs need to be deployed to the server. I recommend using the Visual Studio "Publish..." option on the Build menu to do this for you. It can deploy to a folder (which you can then copy to somewhere else if you like), an FTP site or to an IIS virtual directory.

  2. Uploading your .cs or .vb files is not necessary. It will still work if you do but it's probably safer not to. There's a remote possibility that IIS will have a vulnerability or a sysadmin will make a mistake and your source code will end up being served to the public.

  3. In Visual Studio you could could do File -> New Web Setup Project and build an MSI to do it. This article and This article have more details on this option.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜