Publishing a .NET C# website to an external server - c#

I have just completed my first aspx/c# project using Visual Web Developer Express and consuming some custom controls and external web services. It runs fine on my development machine.
If I now want to test this on a shared hosting account, do I just upload all the files with the current project structure? Will there be any problem uploading the DLLs to a shared Windows hosting account? Anything I should be aware of or changes to be made to the code? Can anyone recommend a cheap and good provider (this is just for testing - no mssql required yet).
Thanks!

Does visual web developer have a "publish website" menu item under the Build menu?
If you want to pre-compile your site and publish it with all dependencies the easiest way I've found. You can then choose to publish it to either an FTP site or the file system. I usually choose the filesystem and then FTP it up myself to make sure I don't overwrite any config files.
If I'm working on a low volume site for a client and performance isn't a problem, I'll just upload my working directory right up to the server so I don't have to deliver the source code separately and I know they won't loose it.
Oh, and one other thing, if you don't configure it special, I would expect you will have to upload your site to the root directory of your hosting account. GoDaddy does have the ability to specify certain directorys as their own ASP.NET application. If you do that you can put your app in a sub-dir of your choosing.
-Al

It would depend on your website provider. You need to get one that supports the .NET runtime. Once you have that, then you simply upload your code and all should work. I personally use www.godaddy.com. You can see an example ASP.NET site hosted by them at www.chessbin.com.
I hope this helps.
Adam

The hosting companies may vary on what they require, but I would think a simple xcopy deploy would be sufficient for most. Here's a link to one that seems to have good prices (disclaimer: I have never used them)
http://www.reliablesite.net/v3/index.asp

Related

Hosting websites with different portnumbers in ASP.Net IIS server

I have just begin using ASP.Net Web application in Visual Studio. What I want to know is that I have two web pages namely index1.aspx and index2.aspx. I want to host them separately using different port numbers in local host on the iis server. I know site binding is used in these cases but not sure how to go about it.
What is the best way to do this? I want them to run simultaneously and communicate between each other.
In IIS there is something called Virtual directory. You can create two web applications in IIS and make both pointing to same physical location on your system.
You can also update settings of each web application to have different index pages. i.e. web app1 shall use Index1.aspx as index page, and web app 2 shall use Index2.aspx.
Virtual directories are so cool, you can use the same code base for multiple tenants. All we have to create is new web apps or sites in IIS.
So I solved it like this:
I created two projects WebApp1 and WebApp2 in the same Solution.
Right Click on Solution Explorer--> Properties--->Select the radio button with Multiple Startup projects.
Also make sure The Action of atleast one of the projects is set to Start only . The rest can be Start Without Debugging.
To connect IIS to your web application say webapp1:
Reference this video:
https://www.youtube.com/watch?v=IwbKquNBNgQ
Hope this helps anyone who is trying this out.

Publish just one webform? Or precompile just one webform?

I'm sure this isn't the first time someone asks this, but I tried doing a search and found nothing.
We have an issue with a website, and we've narrowed it down to a timeout issue with an email being sent. So I created a simple webform that sends a test email and I would like to reproduce the error with this new webform..
The issue is that since we publish the website, what's deployed to the production server are precompiled files. I don't want to publish the whole site again just to include one webform with two controls.
How can I just publish one webform? Or how can I precompile just one webform? I don't want to publish the whole site.
Thanks.
You really didn't display any code for us to evaluate perhabs we might see the very source of your problem from the method you're using to send the email.
From experience, using SMTP in ASP Webforms usually crashed the app at some point in the lifecycle. The issue might be from time-outs or from the security configuration of your Website or the hosting enviroment.
I'll recommend you integrate the use of Email APIs to avoid these issues. Sendgrid is a good choice.
Secondly, it appears you have a small test Webform project where you expect to encounter the result again and to maybe adequately analyse the error. I recommend you do not need to deploy this test Webform to your hosting environment because as it would replace the existing site there. While you have the option to pre-compile the site before publishing via FTP, Web deploy does the whole work for you automatically.
It's better you create a different enviroment for testing apps to prevent interference with the live version.
Once you write some server side code, you need the recompile your website and replace the .dll in your bin folder.

how to create a link for an asp.net website?

I have created a website using asp.net c# for my college library,i have completed it with all their requirements.I know setup files cannot be created for asp.net websites,so,now i need a way to at least create a link for the website,so that they can access the website from anywhere in the college systems and use it.I have tried deploying and publishing nothing is working.I need any other ideas.
Make sure that the web server you're deploying on is publicly (or at least locally within your college network) accessible. If it is, then accessing a particular website is just a matter of sharing its URL with others. You don't need a SETUP for it.
Note that what you see in a browser when you press F5 is most likely an instance of the built-in "ASP.NET Development Server" that is accessible only on the development machine. You need to deploy your site to an instance of IIS (or some other equivalent) to access it from other machines.
There are 2 steps that you need to perform.
Publish the website
Hosting
You can do it either in the IIS of local domain server to be accessible within the network
OR you can purchase a domain and host it on server to be accessible from anywhere.
You can see this on how to host application in IIS 7.
There are two types of deployment
Local
Global
Local Deployment: Download Cassini Web Server , Install it and Configure the WebApp or Website on that. It will give you the Network Url. Use that url to access it from anywhere in your local network.
Global Deployment: Go to Domain and Hosting Provider, purchase domain and link that domain to webspace and hosting that will Support .Net framework. Generally all windows based hosting now a days have IIS. Do not go for LINUX ,as you need MONO there which is generally not available. Upload you publish pages in the root of our virtual directory. In most of the hosts its httpdocs and some where have wwwroot, depending upon the control panels. Access that pages from the domain name.
this website provides all the details step by step!! its awesome it worked for me :)
http://www.programmerfish.com/how-to-deploy-asp-net-web-application-on-the-network-in-windows-7/

Analytics in a restricted environment

Does anyone know of an analytics package, either open source or commercial, that can be integrated into a corporate MVC3 site running in a restricted environment?
The (rather rigid) requirements for my project are: -
The solution must be installed locally, which sadly rules out Google Analytics.
The solution must track analytics for individual users / customers.
The solution must work on a Microsoft technology stack and work under IIS 7.5.
Unfortunately due to client sensitivities (I.E., security and brand reputation) they cannot use publically analytics packages and thus rule out Google, Open Web Analytics, etc.)
Thanks, and let me know if I need to make the requirements clearer.
Piwik is one of the best open source Web Analytics solution. I understand you need a solution in Microsoft stack but this is based on PHP.
I am using this to tracking SharePoint web applications and I am running Piwik using IIS 7.5.
Configure IIS to use a detailed log. Then use a IIS log analayzer tool (there is plenty, google).
http://awstats.sourceforge.net/ is pretty popular. (PHP, but easy to configure in a separate website in IIS)
A .NET based analyzer: http://www.iis.net/community/default.aspx?tabid=34&i=1864&g=6

What is the best way to deploy authenticated autoupdates in a .NET application?

Currently applications are deployed only to my office of 40 employees or so. ClickOnce works great for this as everyone has network access or VPN access which makes updating pretty straightforward. Now, it has been tasked to me to figure out the best way to deploy these applications to res of the company. ClickOnce would work but the files would be made publicly available to any.
What would be the easiest way to implement this feature with some form of authentication?
The actual deploy page can be set up on a site that requires Windows Authentication. As long as the domain controller you are using trusts the other domain controllers, you are golden. You might be able to do this at the folder level, as well. If you go this route, you can still use the click once model.
There are a few more ideas here:
http://tinyurl.com/bn5e76

Categories