I had done a project by using ASP.NET MVC. How do I copy and paste the project to an external drive. I have to submit my project as coursework yet they request to copy the entire project to a CD/VCD.
The problem is when I copy & paste the project into a CD, it can't run properly with loads of errors. How do I do this in the cleanest way possible?
Snippet:
Here's the warning message.
You can delete .vs folder. Visual Studio will recreate it, when you open the project.
The main issue is Visual Studio cannot read and write to CD. However, you can copy the project into USB Flash Drive, and open the project straight from it.
Starting from Visual Studio 2012, Microsoft uses IIS Express by default to host ASP.NET applications, which relies on a file applicationHost.config to store the site information.
The design of applicationHost.config, means a physical path to your project directory is hard coded which prevents this project from running if you simply copy the project to another location on another machine without updating applicationHost.config. What's worse, starting from VS2015 this applicationHost.config lives in .vs folder inside your project directory, which can be copied to other machines by mistake.
Read my blog post to understand the technical details if you like,
https://blog.lextudio.com/jexus-manager-secrets-behind-visual-studio-iis-express-integration-834f88c8e8b
Related
I just simple know that is a published project, but how to open that file as a project? Here is the story, I got a file from a contractor with all the project and the pages and I would like to check the code and run the project from Visual Studio 2017.
Sorry about my ignorance and thanks in advance.
You can't.
What you can do though is create an ASP.Net Project (e.g. .csproj) and then right-click on a folder or the root of that Project and select "Add Existing Web Site...". This adds your site to that solution.
Note that .publishproj projects ("Web Site" Projects, aka "Web Applications") are not really compiled/built. (Though they can be pre-compiled, but that's not the same thing).
Web Sites are "published" not "built". Note that publish profiles (.pubxml) files are stored in /App_Data/PublishProfiles folder and work very much the same as .csProj files. In fact MSBuild will recognize some of the same elements, such as <task> and <using>. You just have to manually add them.
I am using these steps to publish my ASP.NET MVC 4 application using Visual Studio 2010 on IIS 7.5 running on a 64-bit Windows 7 Professional machine.
When I click the Publish button on the wizard after entering the values, it reports a single error that reads:
Copying file Views\Shared\Error.cshtml
to obj\Debug\Package\PackageTmp\Views\Shared\Error.cshtml failed.
Could not find file 'Views\Shared\Error.cshtml'.
I looked into the target folder where the wizard dumps the necessary files that will be needed to deploy the application. It turns out that the folder had the Views folder which had only the _ViewStart.cshtml of the root Views folder, but no other View. My application has at least 20 views, perhaps more.
I realized that it was my fault. The local copy of my project had the file Error.cshtml in the Views\Shared folder. However, the TFS copy of the project file did not. Apparently, the file had been excluded from the project at some stage.
I excluded the file from my project locally and ran the build and it worked.
In my case the problem was that the file was in the solution but didn't actually exist on the local file system.
For me, this problem occurred when I moved a file (via explorer) from the shared folder to another folder.
I added the file in visual studio, but did not "delete" the file from the shared folder (as far as visual studio was concerned).
For some reason, visual studio did not put a little flag or warning sign to tell me the expected file was missing (even after a refresh), so I didn't notice (although trying to open the missing file revealed the problem).
The error message is clear, and self explanatory. I just couldn't understand it for some reason.
I have a simple web app project in Visual Studio 2010 (converted from 2008 project). For some reason when I publish the app, Visual Studio doesn't copy the App_Theme -folder to the publish destination folder. This will cause the app to fail when deployed to production environment.
App_Theme is considered as "system" folder by VS (shown as grey), which means that I can't manually set it's publish properties.
Can anyone tell me how to get VS to copy App_Theme -folder when deploying?
I had same problem, located and deleted TEMP folders with cached data about publish, and then publish gone fine.
%userprofile%\AppData\Local\Microsoft\WebsiteCache
%temp%\VWDCache
%LocalAppData%\Microsoft\Team Foundation\1.0\Cache
Hope this will save time for next people, hitting this problem.
I think Visual Studio has a cache file in the root directory where it tracks what files/folders have already been published. If you nuke that file, it should do a full publish again.
I am personally only familiar with VS 2005 and am working on a project using VS 2003. So I've downloaded the solution to my local drive, opened it and had to fiddle with IIS a bit before it would run and now I also have the website in the inetpub folder.
Can someone just explain using an overall picture what's going on. Am I editing the file in my local source safe folder and when I run the app the sites is copied it the IIS folder?
How do I publish the site, Normally I right click the solution, goto publish and fill out the form. In 1.1 should I just copy the content from my source safe folder to it's destination or copy them out of my IIS folder to the destination or secret option number 3?
Thanks guys
VS 2003 only has the "Web application" project type, not "Websites" that are available in VS 2005. Additionally, the File system website model is lacking in VS 2003.
VS 2003 requires a web application to be a configured virtual folder in IIS. It does not need to be copied to Inetpub\wwwroot folder, but it does need to be a virtual directory. So you do not need to copy the files to the IIS folder.
Lastly, VS 2003 does not have a "Publish" site option because when you build the website, all files are compiled into a single assembly. This is in contrast with the VS 2005 website model where each resource is compiled into a separate assembly allowing for dynamic compilation.
When I developed with vs.net 03, I pointed the IIS site to the same directory to where I had pulled it out of source control, so I dont have to bother copying it over whenever I do any changes, and that seemed to work perfectly well
When publishing the site, you want to copy all the files over, bar the following extensions:
.cs
.resx
.csproj
.projdata
.sln
.csproj.user
.suo
.scc
.load
.vssscc
.vspscc
Dont forget to copy over the bin directory!
In VS2005 you have integrated Web Server, so your web app can be run from any directory on the disk - ie. from your source directory. In VS2003 you can only use IIS, so you have to copy source to IIS folder. Yes, there are tricks to simplify web development in VS2003, but still the comfort of VSA2005 is much, much greater.
I am working with Team Foundation Server and Visual Studio 2008 for the first time. I had a web site project that was done with Visual Web Developer Express, which I have converted to a solution containing a Web Application Project, setup for TFS source control, etc etc.
TFS was having issues checking in/uploading some of my referenced DDLs, specifically AjaxControlToolKit, saying things like /bin/AjaxControlToolKit.pdb couldn't be found. I removed the reference, deleted everything it had in /bin (it had created lots of folders like /ar, /cs, /de, etc etc along with other files like /bin/AjaxControlTookKit.dll), then re-added the reference to AjaxControlToolKit. It will now upload, and works fine locally, but it didn't re-create anything in /bin. I have other references that work fine and have info in /bin (ie: /References/LinqKit.dll and /bin/LinqKit.dll) I cannot do a build on the server yet, but locally it works. So, will this work when its built on the server? Why didn't it recreate anything in the /bin folder? Is that something to do with Visual Web Developer Web Site vs Visual Studio Web Application/Solution? Any info is appreciated! Thanks.
References are references, not copies of the assemblies. Where are the assemblies you're trying to work with?
Typically, you'll want to check in third-party assemblies that you are not maintaining source. You'll then want to change the file references to point to the version from source control.
Of course, this means that all your developers and build machines will need to maintain the same folder structure on disk.