CSS problem between Visual Studio IDE and IIS - asp.net

I'm not a web developer, so what seems weird to me is hopefully an easy one.
Have an existing ASP.NET web site which I need to modify, using VS 2008. I worked on an aspx page and somehow the CSS settings changed and messed the page up badly. I restored the old CSS files and now the page is fine again in the IDE but still a mess when I run the project.
Any ideas would be much appreciated
Steven Segal

Have you tried clearing your browser's cache?

Could it be, that website needs authentication (i.e. FormsAuthentication) ?
If so, the Visual Studio ASP.NET Development Server also blocks css files and images making your web app look like crap in Visual Studio... IIS however doesn't have this behaviour, so when you deploy your site, all looks nice and tidy...

Related

New WebForms Application Template FriendlyUrl and Css not working on Server

I created a new project from Visual Studio 2013, it is a basic web application using 4.5
I added some style and content to the default page. When I run it locally using the debug it looks good. However, I publish it like my other sites on my server the friendly url pages are 404 and no style is applied from the bundle. There are not any errors to easily see what is going on. Does anyone have a quick fix so I don't have to dive in deep wasting lots of time?
Running Win Server 2008 R2 and IIS 6.1
Please see my code at: https://github.com/ad5qa/SARGroups
Image A - Visual Studio IIS Express
Image B - From Server
When you are bundling, the bundle is served using /Content/css. Since this file does not have an extension, you need to configure IIS 6 to handle this request. This is probably also the case with your FriendlyUrls
You should be able to use the following solution from Phil Haack to solve both problems:
http://haacked.com/archive/2010/12/22/asp-net-mvc-3-extensionless-urls-on-iis-6.aspx/

Accessing remote Umbraco website from Visual Studio

I'm about to deploy a site where some functionality is omitted to get the website launched as soon as possible. This means that after the site has been deployed to a live server, some development still needs be done.
I have mainly been used to working on local projects, and have just been playing around with opening the site as a FTP project in VS2012.
This seems to be the way to go, but unfortunately, IntelliSense doesnn't play nice (not all namespaces are recognized) and when re-building the project, it seems as the whole Umbraco project is recompiled (which creates an enormous overhead). And I have not found a way of excluding Umbraco specific folders from the project.
Another thing is that the project is recognized as a WebForms project and not MVC4, for which I would also like a fix :)
Any suggestions on how to carry on from here? Suggestions and best practices is very welcome!

Changes to razor view not showing

I have made some changes to a view in my ASP.NET MVC3 application, but the changes I have made are not showing up when I test/debug the site within the browser. The changes I am making are simple text amendments to the markup.
I am using the Visual Studio development server for testing the application.
The odd thing is, I have tried publishing these changes to IIS and the changes I have made to the view are working when I test the application using the IIS server.
It is only when testing in the Visual Studio environment that this seems to happen.
Thanks,
A common problem i've run into is when you are not using IE and you close the debug session, but not your browser.
This means that the "IIS/development server" is still running in your system tray, but it is running on the old compiled code, if you hit ctrl + shift + b, you build your entire solution and re-publish your code to your development server. this allows you to hit refresh (F5) in your browser and the changes you've made to the razor view should now be reflected in your browser.
Are you using IE? Maybe deleting the cache or using another browser should work? I've had a lot of problems with that :D
Solution is to use IIS Express. For some reason, the VS development server doesn't recognise changes to code behind - nothing to do with caching on the browser.
However the location of the source code as suggested in other answers is important - it works for me using the c:\windows folder or c:\users\DefaultAppPool - apparently it has something to do with security to ensure.
Only applications running under the 'DefaultAppPool' identity are permitted under IIS. So, for anyone using a VM and mapping the host OS code folder you won't be able to rectify this unless you copy to a local folder in the c:\users\DefaultAppPool folder.
You may also now have difficulties accessing the SQL server database established for the Membership Provider under ASP.NET. For more details on how to fix that, I've posted on my blog.

Can't view Visual Web Developer Websites when copy to web server

As far as I can work out I should be able to copy a web project/application to my IIS Web server and be able to see it as I do when designing it on my development computer.
The problem is once I copy the folder over to my web server and then try to view it the browser it says Error 404 not found. There must be a real simple fix for this. I would like to be able to develop ASP.NET sites using the Visual Web Developer instead of Dreamweaver but this little issue is stopping me. Any ideas?
Cheers,
Darren Woolway
You can't just copy over the files and expect it to run. You have to do a little more work than this.
please see the following;
non iis7: http://support.microsoft.com/kb/323972
iis7: http://learn.iis.net/page.aspx/37/deploying-web-sites-on-iis-7/

How can I use the "Publish" function in Visual Studio 2008 without erasing the contents of the target folder?

When I use Build->Publish Web Site in Visual Studio 2008, most of the time it compiles the site, and then simply asks me "All files in the target folder will be deleted. Continue?" (or something to that effect). On occasion, however, when publishing a project in Visual Studio, I would get a dialog box that would give me the choice of replacing the folder's contents completely, or simply replacing changed files with newer version.
I much prefer to publish without completely obliterating the folder, because the deployed application creates user files and cache files as it's been used that I don't want to take extra steps to preserve. However, I'm not sure why Visual Studio doesn't always give me this option. Is this a setting somewhere I can change? Is it tied to the version of .NET I'm using?
Any insight is appreciated!
Edit - Followup on 2009-01-20
I still haven't figured this out, but here's some more information.
Here's what the publish function looks like for one ASP.NET project on my Win XP desktop:
And here's what it looks like for a different project on my Vista laptop:
Notice the radio buttons in the second screenshot that allow me to choose to either delete the contents of the folder prior to publishing, or merely to overwrite matching files. I'd like to have these options for every project.
Both computers are running Visual Studio 2008 Professional (version 9.0.30729.1 SP, according to Help->About). The exact same version. And I doubt the OS difference is causing this functionality change. It's got to be a setting somewhere, right? Does anyone know?
John is right, the only difference is one of your projects is a Web Site Project and the other is a Web Application project. You will not see the "convert to web application" option unless you are in a Web Application project. I know... it is very misleading. The reason behind this stems from the the way you convert to a web application project. If you plan on converting it(which can be a real pain in arse, depending on how it is set up) then you need to be aware of a few differences:
In a Web Application project everything is pre-compiled all the codebehind pages will be compiled into a .dll ---- In a Web Site Project nothing in the project is pre-compiled, the compiler will compile everything to ensure it is valid but none of the compiled pages are uploaded. When a user first attempts to access the site each page is compiled into its own dll. This means in a Web Site Project you are able to upload a single codebehind file.
Namespaces - In a Web Application project namespaces are created by default in a Web Site Project they are not. So you may have to spend some time adding them if you plan on converting them.
Project files - you will notice that A Website Project does not have a "cproj" file a Web Application project does.
I have converted a few of these project I find they go fairly smooth as long as there is not a lot of code in the "app_code" folder. You can give it a try and see how easy it is, if it looks like it is going to be a pain, I would suggest FileZilla just FTP it and save yourself some headache.
Good Luck
That dialog is different for Web site projects and Web application projects. In my MVC projects (Web application projects), I see the additional options. In my regular ol' web site projects, I see the first dialog posted.
Not sure if this option will be suitable for you but you could use the copy website function from the solution explorer. Click on the "Copy Website" icon at the top of the solution explorer.
I think the real answer to your question is that you should put your user files and cache files somewhere else.
When publishing a web site Visual Studio is designed to make sure that the target folder contains your web site files, and absolutely nothing else.
Apparently this feature is coming in VS2010 - that's what Vishal Joshi announced at TechEd EMEA in session "PDC307: Microsoft Visual Studio 10: Web Development Futures"
The site has been updated from the site in the updated layer.

Resources