What is contained in a published ASP.net project? - c#

I developed a site in asp.net using C# as the language.
I have debugged it and no more errors can be found and can also view the page from a browser.
I would like to host this site and direct a client to it for demo purposes but am having a problem each time I publish my site. The publishing only does away with all my .aspx.cs files but I don't see any .exe file that I can install or send to my hosting provider.
I would like to know if this what I am experiencing is normal or there are settings I need to do in my visual studio 2013 ultimate edition for these tasks to be performed?
Kindly advise me on the way forward

ASP.NET applications (not "ASP.NET websites") are compiled into a .dll file in your bin folder, which is then deployed on to the server.
Your .aspx/.cshtml1 files reference compiled classes and types contained within this DLL, thus eliminating the need for source files.

There won't be any .exe files, you need to deploy your project to a web server, like IIS. Check out this link.

Related

Publishing to Azure workaround: trying to understand compiled files to upload them by FTP

We have not been able to publish to Azure from Visual Studio (for Windows). We managed to do it with Visual Studio for Mac, but we just did not find the way in Windows. Publish seems to work with zero errors, but nothing seems to be pushed in reality. We have also realised we have created another App Service / Server somehow from Visual Studio, so maybe we are pushing to the wrong place not sure why or how to fix it.
Anyway, we have found a way to access to the published files within Visual Studio (by FTP, I guess):
We have updated files that don't need to be compiled (which sometimes does not seem to work either, by the way. Maybe because we are uploading to the wrong server? Maybe some cache stuff?).
Anyway, my question is about how to upload compiled files manually, I mean, by FTP:
May we just upload a full local folder with the compiled files to Azure?
Or maybe compiled files in local environment are different than compiled files to upload to Azure?
Thanks for the clarifications!
For compiled files, like they are all in the bin folder of your project, you need to upload the bin folder to azure via ftp.
I can confirm this behavior by using visual studio FTP deploy azure web app.

How to create exe of a web application in asp.net

I have to create an exe of an website created in asp.net using visual studio 2010.
I don't known whether exe of web application can be created or not, but I want that my application with database will be able to run on another system where visual studio will or will not be there.And my code should not to be visible to the users using that exe or running that project.
How can I achieve it?!
you can't make a exe for web application but you can do one thing to solve your problem
1)make a window project in this project make a code for run iis and open browser with your web application url and make your window application form hide
2) now make exe of your window application project
You cannot create an executable file in asp.net.
All you can do is create a website using visual studio. once done, publish your website. Deploy it to IIS or host it to a paid web hosting company so you can have your domain. Once done, other users can see your beautiful and elegant website.
You don't create exe of a web application. It is hosted on IIS. So first of all you have to publish your website and then you can host it. For more information you can refer to this one:http://msdn.microsoft.com/en-us/library/20yh9f1b%28v=vs.100%29.aspx Or google for more articles.
Posting to an old thread, but I came across this situation and found the solution.
Following footsteps of Spring Boot and other containerized solutions, I believe now Microsoft also has added this feature.
My scenario: Created a basic REST based Web application and built it.
This created Debug and Release folder within \bin within the root directory of Web application.
It also creates an exe file.
You just need the necessary runtime dependencies (like .NetCore 3.1 etc in my case) to run this exe.
I copied the entire Web application folder to a Windows Server 2016. There were some issues initially, however later when I added the required dependencies (dotnet folder which was present in my earlier machine), it worked like a charm.

Visual studio web, what file do i upload to server?

I'm a little confused, since a day or 2 i've been programming with visual studio 2013 web express. i've made a C# web form (.aspx). i used to program normal html/css in Adobe Dreamweaver.
But unlike a normal .HTML document i cannot find a file to just click and open in my browser. and so i do not know how to upload my project to my hosting server. when i debug it, it shows up in my browser and it tells me it is the file with .aspx extension but when i try to manually open this file it just tells me there's something wrong with my page (incorrect code etc.)
Anyone can tell me how i do this? could not find a solution in google so i thought i'd give stackoverflow a chance :)
Thanks!
Gr.
First off, a website programmed with ASP.Net requires Internet Information Services (IIS) to run.
Visual Studio has its own built-in mini version of IIS for development, but to deploy to production you'll need a Windows Server with IIS. You should check that your hosting provider supports IIS before you do anything else.
Assuming you have IIS running, and you've configured a website in IIS with an empty directory, ready to host your project there are a couple of different options you have for deployment:
Just copy everything in the website to the server (all files & folders). This is simplest, and allows you to tweak things on the fly, but is the least secure.
Use Visual Studio's packaging and deployment utility. Not much to say here, other than read the manual.
The .aspx pages, .ascx controls, the bin folder with your .dll files, web.config, App_Themes, App_LocalResources, etc. And then you'll need to set up a new web site on IIS.

How to do a precompiled web application

I have a webapplication that uses a master page. When I publish the site in vs2010 (running framework 4), and then I navigate to the default.aspx page I get a parser error that the masterpage's codebehind file does not exist.
I know that a website can be precompiled and then deployed which means there would never be anything that IIS needs to parse. The above error therefore implies that IIS is still trying to compile my precompiled site.
Is there something that needs to be configured to stop the web application from doing this?
Convert to Web Application: Difference between 'Web Site' and 'Project' in Visual Studio
Have you uploaded the bin folder with the webapplication's dll?
You are using the term 'web application' and 'website' interchangeably in your question.
If you are using the web application model, you need to build it before deployment (i.e to a single binary)
If you are using the website model, you need to deploy all your files (code behind included), the framework then JIT compiles all your codebehind.
But you can pre-compile:
http://msdn.microsoft.com/en-us/library/ms227972.aspx

How do I unpublish a .Net application

I published a C# .net application to the wrong folder. I am using VS 2005. How do I unpublish the app to be able to republish in the correct folder.
I tried simply publishing to another folder and now the app will not run from either location.
You will need to manually delete all the published files from the wrong folder.
There is no "recall"/"unpublish" function in VS. All "publish" does is compile and copy compiled files and other included files and folders (images, css, js etc) to the specified directory.
Publishing is essentially just a copy of the built application to the destination folder, as far as I aware. This points to a different problem in your application as being the source of your error.
More than likely your app isn't working from either folder because it's configured to use asp.net 1.1 or doesn't have asp.net installed at all on the server. If it is installed, and both 1.1 and 2.0+ are installed, it will default to 1.1, and the folder needs to be configured to use 2.0+.
But other than that, you just delete the files from the server by hand.
Publishing function also creates "Application" on the IIS, so I would probably start by opening the IIS server with "Internet information services manager", and remove the application with the wrong folder.

Categories

Resources