We are on kentico 7 and for some reason, none of my edits to Edit.aspx are showing up locally or on our dev server. Usually, I just modify a .aspx or .cs file on my local machine and they appear on my local server when I launch the site. Is there a special way to modify/deploy this file? The file full path is: site\CMSModules\Content\CMSDesk\Edit\Edit.aspx.
Best practice is to NOT modify any of the Kentico base files. BUT I'm assuming here since you're on v7.x that you're most likely not upgrading to a new version any time soon so this will come down to how your site is set up. Is it a website or a web project? Website will have an /App_Code directory.
If you have an /App_Code directory, then you'll make the changes to your ascx and .cs files and copy them to your production server. If you have a web project, then you'll need to build the project and redeploy the site, including the new dll, to your production server.
Don't ask how to copy the code to your servers because that will be something you need to figure out on your own on how to access your production servers. Don't reply with any of your dev or prod server info, it's not a good idea at all.
Related
I am a newbie to asp.net. I recently publish an asps site from Visual Studio using C#, but I realised that the scripts I wrote for the buttons, links, etc to interact with my database on local machine is missing when I publish the pages.
Do I have to rewrite the code for the pages now on the web host?
Your advice is needed.
Thanks
It's really hard to answer such a question, no details, no code, and things disappearing mysteriously. However, given that you're newbie and from the description that you have, I will try to give you some tips that will hopefully set you in the right direction.
Firstly, I don't know exactly what you mean by "script", so I will assume you're referring to what is called code-behind. ASP.Net is different from many other web application frameworks in that it is compiled. So you have the front-end of your aspx pages which has a mixture of HTML and ASP server-side controls, and then linked to each aspx page you have an aspx.cs code file for the code-behind.
Now, when you're ready to upload your project to the hosting, you should use the Build => Publish menu. This will compile your project in Release mode. All the aspx.cs pages will be compiled into a dll, so you will not see them among the file that are uploaded to the hosting, and you cannot modify them. The aspx pages are typically not compiled (although you can configure that), so you will see them and you can still modify them.
As for the database connection, when you're writing your code, you typically connect a local database on your computer. You should have the connection string in the web.config file in the root folder of your project. However, the connection string for the hosted database is likely to be different, so make sure you have the correct connection string for the hosted database in the web.config before you upload your code to the hosting.
I think this will answer your question. It's a setting on a file level, available on properties (F5) for the file:
Visual Studio 2010 Web Publish missing a file
Once you set it and republish, the file will show up in the publish location.
IIS 7.5 installed in windows features.
VS 2012 asp.net project.
There is a server with IIS and I need to upload asp.net application to it to make it available to local network. There is no VS installed in the server.
There is a developer PC with VS.
Is there a way to just upload updated .aspx and .cs files to IIS folder without publishing anything and so do updates to the local website? Publishing is not an option at all. And please don't say "but you still can publish it" or "why don't you want to publish".
My general task is to make the local website in IIS folder updateable by just uploading updated aspx files to the folder without freaking publishing anything. So I have this project folder on IIS server with all the aspx and cs files just like the original project and all I need is to throw updated files into it to update the app.
Project files are on the IIS server. So now I can see the content of the project folder in IIS manager.
Doesn't load any page, just loading and loading infinitely.
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.
I have an asp.net application that i am modifying. I setup visual studio 2010 to publish to are development server which is running windows server 2008 RC 2 (dont think it matters). I added a new webform to the application through visual studios "add new item" feature and it works on my local computer. When i publish to the server, it starts to throw cryptographic exceptions because its trying to access a .p12 file in order to send apple push notifications to an iphone device. I thought it was something wrong with the certificate at first so i added print statements to the code and noticed it is trying to access the new page at the file path on my local machine instead of the file path on the server. Does anyone have any ideas on why its doing that? Is there a way to make the file path relative to the project?
You have to use MapPath("{relativePath/FileName}") . This will return a physical path.
filename = MapPath("/images/logo.jpg")
Would something along the lines of "C:\inetpub\webroot\images\logo.jpg"
Server does not matter. The file was added with an absolute path. Not sure why and don't have the time to research.
How is the site set up on your debug machine? Are you using IIS or the ASP.NET development server? Not sure if this makes a big deal, but switching to IIS and better mimicking production often solves these little snit type of errors. To switch, add the folder to IIS, then remove the project and re-include with the HTTP path instead of the project folder.
If local IIS is not an option, or you already have done that, I would do a search for the path in question and alter it there. If you find no results, this could we be embedded in the solution file some how.
I want to copy a folder that's contained in another project into the publish directory during website publish, is this possible?
The reason for this is that I have a project with the SQL schema files for creating the database structure, ASP.NET membership schema, alongside some code to run the files against the database. I don't really like having these SQL files in my web project, that just seemed dirty. So I figured I'd store them somewhere else in the solution. But when I deploy I do need them in the publish directory.
Why not place these scripts in App_data? It will be deployed along with the rest of the website, and cannot be accessed via client web browsers. That's what it is there for, to store data associated with your website that you don't want to have in the root for security purposes.
You can include an extra folder for deployment with all its contents editing the publish profile: http://www.asp.net/mvc/tutorials/deployment/visual-studio-web-deployment/deploying-extra-files