publish asp.net mvc5 without installing visual studio - c#

Finally, i have completed my asp.net mvc5 project.
I have used EF code first for database and my solution included two part, the core included Model and frontend included the views and the controller.
Now i want to send the project to my friend that he can publish it in his windows server with IIS server.
My question is which file i have to copy for him that he can publish the WebApp with out installing visual studio in his windows server.

Right click on main MVC project in your solution -> Publish.
Publish method: File System
Target location: your location
In settings Configuration you can set Release or Debug as you need.
After publish you can send whole folder to your friend. Everything that you need should be there (Your bins, views, scripts, css).
Your friend should just create new WebSite in IIS and place all files in folder that he selected.
Ofcourse he should change connection strings and set right settings for ApplocationPool that runnig WebSite.

Related

Click once not installing appsettings to users machine

I'm new to using click once when publishing my applications, I've managed to get my application published. However, when I launch the application as a user I'm finding that the app settings file has not been pulled from the server to the user's device. This results in the application falling over on startup.
My question is how when publishing via Click once can I ensure that an app settings Json is copied to the user's machine?
I'm using .net core 3.1 for my application with Microsoft Visual Studio Community 2019
Version 16.8.3 for my IDE for complete context.
After adding appsettings.json (or any content file) make sure you set the build action to Content and set Copy to output directory to Copy Always (or copy if newer):
Then it will be automatically included as part of the deployment files. To make sure the file will be included in the deployment files, in the ClickOnce setup, in settings step, click on Application files and make sure the publish status is Include (Auto):

Update existing asp.net Project with WCF

I have eCommerce ASP.net Project, This project have 20 important dlls and more java script files when i want to update website for my clients i have to give them dlls and js files and ask them to replace new files with old files and many many troubles.
But I want to create system like web service to update each client automatically like antivirus Update !
Is That even possible !
How about ClickOnce?
It's a microsoft tool that allows you to update the client automatically. When the client opens the application, it asks the server if there are any updates - If there are, it downloads them and updates. If not - nothing special happens and the app just start regulary.
A Web Deploy Package works quite nicely.
Create Package:
right click Publish and choose Web Deploy Package. This creates a .zip deploy package, which you can then easily import into IIS.
Deploy to IIS 7:
right click your site -> Deploy -> Import Application -> Navigate to the .zip deployment package, that's it. Here's a detailed walkthrough

MVC Application Created in Visual Studio 2012 is not working properly after deploying on IIS

I have created a simple MVC3 application in Visual studio 2012. Earlier I was using VS2010. Both are currently Installed on my System.
The Problem is that when I publish and Deploy the application on IIS It doesn't works.
It gives Error Code 0x00000000
I tried with different applications but problem remains the same. Any of the application created in VS2012 is not deploying Successfully. Please Help.
I am adding snapshot of publish and error message.
looks like you are publishing an mvc3 app.
If I remember correct for that version you either have to install mvc on the server or include mvc binaries in your output directory.
There was a menu item for mvc project (right click on a project in solution explorer) to add mvc dependencies to some binpub folder. You should look for that.
oh and here is a Hanselman post on the topic
http://www.hanselman.com/blog/BINDeployingASPNETMVC3WithRazorToAWindowsServerWithoutMVCInstalled.aspx
And another SO question: Why is the _bin_DeployableAssemblies folder specific to web applications?

ASP.net MVC Web Deployment Project

I created an ASP.net MVC 2 Web Application in Visual Studio 2010. I then added a Web Deployment Project to the solution and added the Primary Output from my web application. I right clicked on the web deployment project in Visual Studio and clicked Install and ran through the install. I then tried to use IIS to browse to the page and got the following:
HTTP Error 403.14 - Forbidden
The Web server is configured to not list the contents of this directory.
I browse to the folder that the application is and all I see is a bin folder and inside that there are just a few dll's. No web.config. Nothing else. Is there something else I need to add to the deployment project other than primary output?
I had to add the Content Files from the Project as well. Once I added both Content Files and Primary Output everything worked fine.

How to add a .NET C# project to a web site?

I just finished my first C# project in VS 2008 and it is working well now. But now I need to publish this project on my website. This project interacts with my SQL Server 2008 Adventureworks database on this same computer.
I will use this same computer to host the website and house this database. I know HTML but not how to add a .NET project to a web site, especially one that also uses SQL Server. Can u offer me tips as to how to proceed?
I started by right-clicking the project and selecting "Convert to Web Application" and then I selected the URL for my site. But then when I went to this URL, it still shows the original image.
In IIS create a website and point it to a directory that you want to put
your website in.
Make sure the website properties has the default document you want
and the ASP.NET tab has the framework you want.
Use the menu in VS2008 to publish to this directory.
Change the connection string in your Web.Config to point to the
correct database.
Asp.Net has two types of projects: website and webapplication project.
It looks like me that you are using the website project because you have the option to convert it the web application project. Right click your project, go to properties, go to "MsBuild Options" tab, you will see an Output folder, by default, it should have some path called "PrecompiledWeb", that's where your output is, and you need deploy this to your IIS directory.
you can't convert a windows application to a website, you have to built it from scratch.
you can go to file -> new website -> then you choose ASP.NET website.
you might also use the sqldatasource and gridview controls, they help a lot.
to run your website you can hit F5 or just right click your defalut.aspx page and select show in the browser!
check this for more information http://msdn.microsoft.com/en-us/library/41b1tfyt(VS.80).aspx
hope it helps
If your asking if you can move the location of the ASPNETDB away from the root of the project, yes, you can. There are database connection string nodes in the web.config as well as a master-default db config in your Visual studio master.config file. i think there is also a aspnetdbreg.exe or something like that to update the registration of this after you change its location.
Personally, I use visual studio 2008 and my ASPNETDB is on my SQLServer express 2008 instance. Visit my blog for more info on this stuff.
Since you are using IIS 7.0 what you need to do is find a place for your web application to reside (e.g. C:\mywebapp).
Then open up IIS 7.0 Manager.
Expand your computer name on the left.
Expand Sites.
Right click on Default Web Site (I'm assuming you are using the Default Web Site, if you aren't substitute your site name for Default Web Site) and click on Add Application.
Type in an alias for your application. This will be the name you use to access the site (e.g. if you want the url to be http://localhost/myawesomewebapplication/ from your local machine then type in myawesomewebapplication for the alias). Click the ellipsis (the ...) next to Physical Path and browse to the folder you copied your web files to (e.g. C:\mywebapp). Click OK. Click OK to close the Add Application window.
Assuming no errors, you should now be able to browse to http://localhost/ and everything should be peachy.
In my point of view, its simple. Let´s try:
If you want to access your DB from the web app:
1. Create an New ASP.NET Web Application (File > New > Project > Visual C# - Web)
2. In Project Properties (right button on project) go to tab "Web" and under "Servers";
Select the radio "Use Visual Studio Development Server", if you dont need to create an IIS virtual dir.
Select the radio Use IIS Web server, if you need to create an IIS virtual dir. Note that you can create the directory by clicking directly the button "Create Virtual Directory".
You can create a Class Library (File > New > Project > Visual C# - Windows) to access your DB and then, reference this assembly in your Web App. Just ask if you want that way.

Categories

Resources