Recreating solution file in Visual Studio 2010 - asp.net

I need help re-creating a web solution file (at least I think that is what I need). I inherited a web application from another developer that left our company. It was created in Visual Studio 2010 and uses ASP.Net 2.0. There was no solution file, so I created a web application project and manually added all folders and files into my new solution. I did not make any changes to any file in the web application.
When I run the app from within Visual Studio, it starts up to the default page fine, but when I click a link on that same page, I get:
Server Error in '/' Application.
The resource cannot be found.
Description: HTTP 404. The resource you are looking for (or one of its dependencies) could
have been removed, had its name changed, or is temporarily unavailable. Please review the
following URL and make sure that it is spelled correctly.
Requested URL: /SomeCompany/startProject.aspx
Version Information: Microsoft .NET Framework Version:2.0.50727.8009; ASP.NET Version:2.0.50727.8008
My original start location: http://mylocalurl:65212/default.aspx
Link on the default page: http://mylocalurl:65212/SomeCompany/startProject.aspx
If, after clicking the link and getting the error page, I can remove "/SomeCompany/", and successfully get to the page. But I've seen the previous developer run it in Visual Studio and click the exact same link with no problem.
I need it to have the /SomeCompany/ in the url and work just like the previous developer had it so I can maintain and debug it as needed. What am I doing wrong in re-creating the solution...or is it another setup problem that I am not thinking of?

You could have probably just used file -> open web site. It probably is not a Web Application. Visual Studio has multiple types of web projects. Visual Studio will create a solution for you that you can save after you open the website.
Web Application Projects versus Web Site Projects in Visual Studio

Related

Formview options disappear in code behind Visual Studio 2010

I have several .aspx Web sites created with Visual Studio 2010. I recently updated them from .net3.5 framework to .net4.0. I installed NuGet Package Manager to install the app_browsersUpdate package so the sites would work properly in IE10. Web sites connect to various internal SQL databases.
Since the update (I believe, alas it could be some other cause), I am unable to use new references to Formview controls in code behind. (I use VB). For example, I have a Web page containing Formview1. In the code behind page, in the dropdown at the top of the page, there lists General, the the name of the Web page, then Page Events. There is no longer any reference to Formview1 (or any other controls I added, like Gridviews). This is universal to all Web sites I open in Visual Studio 2010. If I manually add the Sub with, for example, FormView1_ItemUpdated, it causes an error at run time.
I also have a copy of Visual Studio Express 2013 for Web that I can use. The Web pages work fine in that version. I can see and reference Formview1, etc, without issue. What happened to Visual Studio 2010?
I haven't resolved the issue, but do have additional info. I found some of my Web sites work fine. The difference in the problem sites seems to be an error in the aspx page line, starting with <%# Page Title = ...
On the problem page, the Page line is underlined with the following error: C:\mylocalpath\page.aspx: ASP.NET runtime error: The pre-application start initialization method preApplicationStart on type Microsoft.VisualStudio.WebPageInspector.Runtime.Loader.RuntimeLoader threw an exception with the following error message: Could not load file or assembly 'Microsoft.VisualStudio.Web.PageInspector.Runtime, Version=14.0.0.0, Culture=neutral,PublicKeyToken=b03f5f7fl1d50a3a' or one of its dependencies. An error relating to security occurred. (Exception from HRESULT: 0x8013150A).
So far researching that error has not given me a clear path to fix. I will update if I find an answer. The structure of that line is the same as the Web sites that are working normally.
Finally figured it out. In the problem Web sites, I have a line in the web.config file for a local domain account. . I added that account as a local admin account on the PC I was using Visual Studio on. Once I added that account, all back to normal.

Publishing my asp.net mvc web application using Visual Studio Web Deploy will list some files as need to be deployed , although i did not modify them

I am working on an asp.net mvc-5 web application , and i am using Visual Studio 2013 , to publish my web application to an online hosting using web deploy.
now i published my web application correctly. and i check it online and every thing is working well.. then today i modify a view named "Contact.cshtml" and a file named "style.css", and then I try to publish again. i was expecting that only the two files will be shown in the preview window since they differ from the publish files. but i was surprised that my project.dll is being listed although i did not chnage it (i did not modify any cs file) and the modified date for this .dll is that same modified date which is online..so can anyone adivce on this ?
here is how the preview window inside VS 2013 looks like:-
So can anyone advice why my project.dll file is listed although i did not modify it since i did my last web deployment ?
Either you ran the project before publishing and/or your are building your views in the solution.
It may be that your style.css and Contact.cshtml files have the wrong Build Action. The proper build action for these files should be "Do not copy", which seems counter-intuitive since the Web Deploy will copy it anyway. You can change the Build Action by selecting each file in the solution explorer and setting the appropriate value.

Difficulty with Converting a WebSite to Web Application and Testing

This is not as straight forward as I had hoped.
I created a Web Site project on my development machine using the Visual Studio C# template for a WebSite Project. (Visual studio 2010 .net 4.0). The project name is C:\Nova5\WebSite3. It consists solely of:
the Bin subdirectory
Nova.svc file
web.config file
It has been tested to run correctly by:
Setting the website as the startup project, then
Run Debug-->Start Debugging
When tested, the NovaDataService information page is correctly displayed. It also correctly works when used through my client project.
I followed the recommended procedure described at
Walkthrough: Converting a Web Site Project to a Web Application Project in Visual Studio to covert the Web Site to a Web Application.
I now have the following problems and/or difficulties:
If I use the recommended procedure for testing the web site:
-- File | Open | Web Site
-- Build Web Site -- Start Debugging
I get the Error: The type 'Nova5WCFServiceLibrary.NovaDataService', provided as the Service attribute value in the ServiceHost directive, or provided in
the configuration element system.serviceModel/serviceHostingEnvironment/serviceActivations could not be found.
Since, I think, the WebSite does work, I skipped this error and moved on to the next part of the article. The next issue (?) is there is no App_Code file in the WebSite. Is this necessary? If it is necessary, how should I create it? Or do I need to create another WebSite project from its template just to have it?
I did not copy the Nova.svc nor the web.config from the WebSite to the Web Application as none of the references I read indicated to do so. Should I copy these files to the Web Application as well?
I now used the "Convert to Web Application" on the Web Application project and recompiled the solution. Everybody is happy. No errors reported. So how do I now test the Web Application project on my development machine (which also has the client application) ?
TIA

Old Asp.Net Web Site Project - No Project file?

So I have an Asp.Net website that i'm responsible for. I'm having a build issue, that as far as I can tell, may be either MacAfee or some other random cause.
But thinking back, I want to say the problem started when I added a "Test.aspx" form to the site, did some testing, then removed the Test.aspx form from the site.
I'm using TFS 2010 as my source control as well. Which I don't know if it applies or not.
My question is, is there some hidden location where all files to be included in publishing a website is maintained?
Is there a Project file for a Web Site app and if so where is it?
I've built the site using MSBUILD and notice some metaprj project file in the output but I can't seem to find any such file.
Web Site apps aren't meant to be built into a dll file. There is a conversion wizard to make it a web project but it doesn't always work well. My advice would be to continue to work with it as a Web Site app. The code files are compiled at at runtime on first use. You can run from Visual Studio or setup a site in IIS. Nothing is hidden in a Web Site app and there is no project file. So, you shouldn't have a build issue because you shouldn't be building. Try to run the app as is and if you get an error let us know what the specific message is.

ASP.NET - How to Deploy in VS Express 2013 for Web?

Ok, so I have been creating the same project like 15 times now, have created it in 2008, with the .NET Framework of 3.5 (New Web Site, New Web Project, and OMG, like all different ways). Have deployed this, however, when I try to load it in localhost, (because I am building these Applications directly from within the Server), I get all kinds of errors. Than I get an error that says, needs to use .NET Framework 4.0.
So, in order to use .NET Framework 4.0, I need to have atleast VS Express 2012, so I get VS Express 2013 and Rebuild the Application again, but this time, I do not see option for Web Application in this software, I see this: ASP.NET Web Forms Application, there is an option for ASP.NET Empty Web Application and I have done both of these damn things! Not sure which one is supposed to actually work.
For the Forms Application, I don't see any option to Publish it, only to Build!
In any case, how the hell are you supposed to transfer your VS 2013 .NET Framework 4.0 Web Application so that it will work on the actual SERVER (Public URL)? How to do this is baffling the hell out of me. No matter what I do I get errors, I can't even get VS Express 2013 to even work when building it, since it gives me 500 error or Page Not Found 404 Error. Atleast with VS Express 2008, I got some errors on the page that told me that the aspx file actually trying to load in the browser.
How do you deploy this project in VS Express 2013 for Web Exactly? What are the steps to do this from within the actual SERVER itself? Also, I just want a simple web application that ties into an existing site (that will use an iframe on an existing page) that uses a Web Service. What application to choose to use? What type should be created? There are so many and they all seem the same to me! I believe the type should be ASP.NET Web Forms Application, but this doesn't seem to want to be published after working in it. It only Builds, and than I don't know how to put it on the Server after that. I have it in a folder on the server, but it loads nothing when I go to that page. It can not find the Default.aspx file. ARGGG! I am pulling out my hair now!
Perhaps there is a URL somewhere online that explains how to do this? From within the localhost itself?
You will see publish option if you Select your Website in the solution explorer and
1) right click it
Or
2) Go to Build menu on the top
Regarding project types:
-> If you select New Project -> You get option for creating a Web Application
-> If you select New Website -> You get option to create Website
You might want to upload some screenshots of your VS environment / errors to show what problem you are exactly facing.
You can create a Web Application Project in Visual Studio 2013 Express for Web. After creating the Web Application you can Publish it to the web but you need to create a profile. You can also publish to Windows Azure.
Some steps are shown in this article:
VS Studio 2013 Express for Web is also known to have a bug in its UI: here
If some items are missing in the UI, perhaps the application is corrupted and you may need to reinstall.

Resources