I am researching a new ASP.Net project that we would like to host in a Windows Azure Web Role.
One of the technical requirements of this project is to make use of the full pre-compilation options (non-updatable, single page assembly) of the ASP.Net Web Site project model - as opposed to the ASP.Net Web Application project model.
Is it possible to host ASP.Net Web Site projects in Azure? Best I can tell the project templates for Azure are ASP.Net Web Applications only at the moment.
Okay, I was struggling with the same problem for couple of days, here is the step-by-step guide
(1) Publish your website project to a folder (for my case is "PrecompiledWeb\WebSite1", which resides in the sub folder of my azure project)
(2) Modify your service definition(.csdef), adding a webrole
<WebRole name="WebSite1" enableNativeCodeExecution="true">
<InputEndpoints>
<InputEndpoint name="HttpIn" protocol="http" port="80" />
</InputEndpoints>
<ConfigurationSettings />
</WebRole>
(3) Run the following command(CSPack) at command prompt
cspack
CloudService1\ServiceDefinition.csdef
/role:WebRole4;WebRole4
/role:WorkerRole1;WorkerRole1\bin\Debug;WorkerRole1.dll
/role:WebSite1;PrecompiledWeb\WebSite1
/out:CloudService1.cspkg
/generateConfigurationFile:"ServiceConfig.cscfg"
(4) Basically you are almost done!
Good luck! ;)
The short answer is yes, but it isn't easy.
One of the cool things about Azure is that almost anything copy-deployable can be deployed to Azure. As such you web site project can be deployed. The difficult part is that the Visual Studio tools don't currently (and may not ever) support it. You'll need to use the CSPack command line tool to package your deployment.
Related
I'm new to .NET core. We're currently implementing an Umbraco9 site which is running on .NET core 5 (MVC). Normally when setting up a development environment on a regular .NET site, I would create the project, point IIS to that same folder, and create a host entry for something like "local.mysite.com" I would then just be able to load up that URL in my browser and the site would serve, simply building when changes to back-end code were needed.
With .NET core, there are obviously some significant differences. For starters, there is a new wwwroot folder inside the project. So, in this case, I've tried pointing my IIS site to that wwwroot folder. This then has the impact of requiring a visual studio publish to that folder for any change front-end or back-end. Furthermore, it seems as though .NET core compiles the cshtml files into a Views.dll file, but when I publish the site, the site throws a 500 unless I manually copy the cshtml files to the wwwroot folder (which also has its own wwwroot after publish).
I've done loads of research on what the generally accepted best practices are with developing and hosting .NET core, but haven't come to a conclusion on this. Further complicating this is that I've seen some information saying that you can use Kestrel in conjunction with IIS. So now it's a matter of Kestrel vs. IISEx vs IIS. I'd prefer IIS as I'd like it to match production.
I've tried setting my IIS path to the path of the VS project, but I get "web server is not configured to list the contents of this directory." I enabled directory browsing, but this of course just lists the files in the directory. I've installed the hosting bundle as well.
The question: Is there a set of generally accepted practices on how to setup local development environments for .NET core projects? I'm really looking for some guidance on .NET core from a non .NET core developer's perspective. I'm trying to make this question as focused as possible, but I feel like there's a gap in my understanding of "old .NET" vs. .NET core and I'm hoping to get some guidance to help fill in that gap.
I wasn't able to get this figured out, so only solution I can come up with is to point IIS at a separate publish folder and publish to that folder when I need to make changes.
I am looking for a way to create a web deployment package for an asp.net website through Visual Studio 2010. I have been looking around for a while but found all for an web application and not many for a deploying a web site. I would really appreciate if you can provide me with a resource or a guidance on this.
Sorry, I could not add comment, so, I would pretend, that this is an answer.
The only major problem of web site project against web application project is the fact, that it does not support web.config transformation out of the box and there is no way to package it from VS also.
However, you could still use msdeploy to deliver you website folder to your target server:
%msdeploy% -verb:sync -source:contentPath="path\to\your\website\folder" -dest:contentPath="IIS website name",computerName="handler\on\target\computer",username="username",password=password,authType="Basic"
I would like to use web.config transformation but do not see the "Add Config Transforms" in the context menu when i right-click on my original web.config file.
I do not have a Web Application Project and cannot have one. My solution has a few projects for BLL, DAL etc, then i have a local IIS website for the main Website.
Under my local IIS website i have a web.config and have tried to add a web.Debug.config like such:
How can i do web.config transformation using the localhost IIS website and not having to creating a Web Application Project? Is it even possible? Is creating a Web Application Project a requirement?
I was recently reading up on this subject and to my knowledge you can not do web.config transformation in a Web Site project for one simple reason – Web Sites don’t have project files, which is where the msbuild configurations are stored. So if you need that functionality you will have to create a project file. But have a look at this blog which I think gives a better explanation for this.
http://andrewtwest.com/2010/02/25/using-web-config-transformations-in-web-site-projects/
Having said that if you do find out that im wrong, which i might be please keep me updated with what was your solution
Thanks
I'm quite new to programming. I have an ASP.NET 4.0 application and I would like some guidelines and best practise for how to dev, test and deploy it with regards to environment configuration.
I am currently manually changing my Web.Config file when I've finished a round of development, I then publish it to the web server using Visual Studio.
For example in my Web.Config should I define the connection strings for my dev/test/prod SQL Server databases in there? How should I configure Visual Studio? Are there any good articles on this that you could recommend?
The source code is kept in SVN, which is checked in using Tortoise SVN.
Thanks,
Mark.
I've seen people keep files web.config.dev and web.config.live in the repository and then rename it to web.config when deployed.
I have two projects in my solution
1- asp.net web project.
2- wcf serivce project.
3- other common projects between two listed above
Current on the local dev machine I have to run two visual studio instance to run both projects in debug mode. That makes the system run out of resources as these projects share some other project in the soultion which are heavy in files.
Is there a way i can hookup the wcf project on a sinlge visual stodio instance and also be able to debug my asp.net web project. ?
I do not want to combine the web and wcf project in to one. Have already considred this option.
thanks for sharing your thoughts in advance.
You can.
Set your web project to use iis.
Use attach to process menu option to select two processes - w3 and service.
Sources for Both processes that you attach to has be in your solution.
Actually you can attach to more than two, in my project i sometimes debug two wcf services and webapplication and js in IE as well
Add all the projects in the same solution, set the client (the asp.net app) as the startup project, hit run... you'll be able to debug through from the client to the service and back again.