C# - Migrating From Website Project To Web Application Project In Visual Studio 2010 Causing All Controls To Throw Error?
Mar 29, 2011
I recently updated my VS2010 website project from .NET 3.5 to 4.0. Everything was working fine in the website project. Today I decided to migrate the website to a web application project as I have learned this is the best way to work in .NET. I split out all my class files into a separate class library and copied all my other content into my new project. Then I updated all the references and web.config.
When I build the class library, everything works great. The problem is happening when I try to build/debug the web application project. It is acting like all the controls are missing and it is also throwing a bunch of compile errors about the public properties I have in my master pages.
Control errors: "The name 'INSERT CONTROL NAME HERE' does not exist in the current context"
Master page errors:'System.Web.UI.MasterPage' does not contain a definition....
It is giving these errors for every single control and master page property in my entire solution.I notice when I add a new web.form to this project, it also adds a filename.aspx.designer.cs file in addition to the .aspx and .aspx.cs file. My existing files do not have these extra files since they were created in a different .NET version.
UPDATE: It seems I was missing the step where I need to right click on the new application folder and select "Convert to web application". I just did that and it seems to be a little bit better...
Now it is choking on Literals that are inside single quotes:
I have downloaded a project from the internet called the SMS Source example. I wanted to open this project in VS2010, so a conversion wizard has popped up prompting for the conversion. But it has errors in converting.
how I can enable .asp files in a simple VS2010 Website project? For example: Start VS2010 Click "File/New Web Site..." Accept defaults Add an html file called "Test.asp" Attempt to open Test.asp (debug project with that file active) and you get the following error: "This type of page is not served. ... is not server because it has been explicitly forbidden. The extension '.asp' may be incorrect " SO, HOW DO I EXPLICITLY ALLOW IT? VS2010 is using the ASP.NET Development Server....
I create a new ASP.NET MVC 2 project with Visual Web Developer 2010 a while back. After some testing, I realized that the built-in development server is too slow for proper testing, so I decided to switch to IIS. I created a new IIS website that points to my project on disk, and configured it to use the .NET 4 application pool. Many problems arose from this:
If I open the solution file in VWD, then clean the project, IIS gives me a "Could not load type: ***" where *** is my global.asax class name.If I open the IIS website in VWD and then try to build the project, I get the same error.If I open the solution file in VWD, build the project, then open the IIS website in VWD, and then build, the build is successful. However, whenever I make a change in the code and then build again, my change is simply ignored (it seems to only be using the assembly that was compiled when I built it as a solution). When I open the IIS website in VWD, and start debugging, the debugger does not catch requests to the IIS website.My guess is that when I open the IIS website in VWD, it outputs the built assemblies to a directory that IIS is not aware of. Is there a way I can configure it to output everything to the bin directory instead? Or am I doing something wrong?
I have an asp.net mvc 1.0 project. I upgraded the project and solution to Visual Studio 2010. However, I do not want to use asp.net mvc 2.0. My app compiles under mvc 1.0. All my references are to 1.0. I have copy local true and i am referencing mvc 1.0 from a lib folder, not the GAC.However I keep getting this error:
No parameterless constructor defined for this object.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.MissingMethodException: No parameterless constructor defined for this object.
Source Error:An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:[MissingMethodException: No parameterless constructor defined for this object.] System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandle& ctor, Boolean& bNeedSecurityCheck) +0 [code]....
Its like it wants to keep using asp.net mvc 2.0, because its complaining about that GetControllerInstance method. This project works fine in vs 2008.
Creating a .NET 3.5 website in 2010, and when I attempt to create public properties for a user control I whipped up it is giving me inline error:Visual Basic 9 does not support auto-implemented properties. I can, however, type GET on the next line 2010 populates the property just like it used to. However, when I expose a control property it craps out with a null reference error at runtime.
As that title says my aspx page shows a compile error on the @Page directive that says "ASP.NET runtime error: Cannot load file or Assembly 'Microsoft.SqlServer.BatchParser' or one of it's dependencies". The project compiles with our error and it runs with no problem. The only real problem that this causes it that the intellisense for anything other than simple HTML is broken so I can't type asp:Controlname and have intellisense show me a the list of items or properties in a control. I get a green squiggly line under all the asp tags saying "Unrecognized tag prefix or device filter 'asp'". This project doesn't directly use SQL SMO but it does reference a project that does. However, I removed that reference and the problem still doesn't go away. I have installed on my development machine the full SQL client and for both SQL 2005 and 2008 (including the SDK) from the Developer editions of both versions. This was not a problem on VS2005 and the project compiles without error in VS2010 too.
I have a vs 2008 project that I converted to vs 2010. I added a label to my aspx page but I couldn't get it be recognized in the c sharp until I realized that it wasn't added to the designer.cs file. I added it to that file like this:
and it worked fine. Why would I have to add something to the designer.cs file though? Shouldn't this have been created automatically when I built the project?
Im working on a website project with Visual Studio 2010 from 2 different computers (home & work). In Dreamweaver Im used to FTP to upload/download files to/from a webserver to syncronice my files on the current computer Im working on.What is best option in Visual Studio 2010 to sync project files between home & work computers? I have seen there is a built in FTP, but seems only it can upload files, limited functionality?
My root problem is that I get the following error message from my CruiseControl server :
errorMSB4019: The imported project "C:Program FilesMSBuildMicrosoftVisualStudiov10.0WebApplicationsMicrosoft.WebApplication.targets" was not found.
I know all i have to do to workaround this issue is to copy the files to the folder but I just can't found anyone having thoses files and based on this thread I tried to "explicitly install the Web Application Project support on my machine" BUT I don't have such an option from the Microsoft Visual Studio 2010 Professional Setup tool ...where can I found the content of the following folder : C:Program
when i opened my Visual Studio 2010 i noticed that my ajax tab was missing from my toolbox and ajax control kit too.Then i noticed even that when i create new website, there is no web.config in it and it should be.WHAT IS GOIN ON???? :/
For now, I just want to use the <audio> and <video> tags and maybe try out the drag and drop features since these are supported by Firefox 3.6. The project will just be a test project, not necessarily for production.
So I got a copy of Visual studio 2010 ultimate through my university and MSDN AA. I've been unable though to create any MVC2 projects in it. Even worse when I save my project from school and attempt to just open it at home I keep getting errors that it can't load the project (this included just open a basic empty project). I've tried a complete reinstall, and even manually downloading the MVC2 RC.
i have 4 project in my solution, framework , domain objects,business objects and website ...but this morning website project couldnt be loaded... when i tried firsttime to open solution... "The solution file has been modified outside the enviroment" message seemed and press reload then error is project file is corrupted... how can it happen
I even tried webapplication setup project is it not ready to deploy with RC ?
<compilation debug="true" targetFramework="4.0">
Description: An error occurred during the processing of a configuration file required to service this request. review the specific error details below and modify your configuration file appropriately. Parser Error Message: Unrecognized attribute 'targetFramework'. Note that attribute names are case-sensitive.
Today in one of the computer i installed visual studio 2010 professional edition, and successfully installed. But in my new project template "Asp.net MVC 2 website" is missing. Also I'm not able to open an already created MVC 2 project also. I'm also having MVC 2 installed with VS 2008 Sp1 in the same machine and is working fine. I uninstalled and installed again, the same is happening.
I have existing ASP.NET 3.5 project I migrated to Visual Studio 2010. I didn't migrate it to .NET 4.0. Every time I try to edit .aspx page, it alters the .designer.cs class to point to System.Web.UI.WebControls.WebParts.UpdatePanel class instead of
class and then the build of course produces an error. The project properties says ".NET3.5".Also the "design" tab produces just one box saying "unknown server tag asp:UpdatePanel". It seems like it is looking at .NET4.0 to generate the desgn view, not 3.5
When I start a new ASP.NET project in Visual Studio 2010, I can either create a new ASP.NET Web Site or an ASP.NET Web Application. What's the difference between these two project types? Why would I choose one over the other?
note: this question is an exact duplicate of this one, but I'm asking specifically about Visual Studio 2010 (there are no answers targeted at VS 2010 in the original question). So are the answers of the other question still valid or are there any changes with VS2010 which results in different answers?