ASP.NET MVC 6 project not recognised as web project - c#

I'm developing a small website and I decided to try ASP.NET MVC 6. I wrote some code on my computer and now I want to test it on the server, first in Visual Studio to debug it. I copied the whole solution folder and pasted on the server, but I cannot run the project. VS complains:
The selected debug option is IIS Express but this project is not a web project. To use IIS Express you need to add the wwwroot attribute to project.json.
Google returns nothing for the error message, which is always a bad sign. Apparently there's a problem with the wwwroot folder, but I don't understand what it's trying to tell me. Note that the wwwroot in the solution explorer is displayed as a normal folder (as opposed to the globe icon I have on my dev machine).
I created the project from the template and everything was working out of the box. Did I miss something when copying the project?

Found it. It turns out that ASP.NET 5 runtime was not installed at the server.

Related

Fix .net core error when pulling from git repo

So I made a .net core web api project and pushed it to a git repo. After pulling down the repo and attempting to run the IIS express server locally, I'm getting the error
Unable to run your project. The "RunCommand" property is not defined.
If I create a new web api project on this computer, it works fine. So it's only the project that I've pulled from git that won't work. Is there some command I need to run to make it...I don't know, update for this computer?
I've done almost nothing to this project. I added one new controller and that's it. Everything else is the default project settings.
The exact project is:
Templates -> .NET Core -> ASP.Net Core Web Application
.NET Framework 4.5.2
Edit: I've compared the new project I created with the one I cloned and everything looks the same. So I'm baffled.
Make sure that the OutputType of the project is set to Exe and that the project file starts with <Project Sdk="Microsoft.NET.Sdk.Web">.
Both are important to give VS:
The command to run when executing the project
Turn on the capabilities to generate and use a Properties/launchSettings.json file.
If your app doesn't launch, i suggest deleting a Web.config file (if exists) and Properties/launchSettings.json, then re-open the solution.
I needed to delete the
bin, obj, and .vs directories.
I just need to ignore those directories with gitignore and I won't have this issue anymore.

have to open ASP.NET MVC3 project in a (MVC3 + MVC4) evnrioment

it seems ASP.NET MVC3 project cannot be opened in a (MVC3 + MVC4) environment.
we have a shared development environment which has both MVC3 and MVC4 environments (VS2010 and VS2013 on Windows 8.1)
and I was trying to open a MVC3 project using visual studio 2010, and I got an error "The project type is not supported by this installation."
I checked project type list in the project file.
<ProjectTypeGuids>{E53F8FEA-EAE0-44A6-8774-FFD645390401};{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
Also, I checked the reference to System.Web.Mvc.dll and it is pointing to C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET MVC 3\Assemblies\System.Web.Mvc.dll, and the physical dll does exist.
I have other projects which have <ProjectTypeGuids>{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids> only,
and they are all loaded fine in VS2010.
it seems the issue is about ASP.NET MVC 3 {E53F8FEA-EAE0-44A6-8774-FFD645390401} in VS2010 with MVC4 installed.
I can't upgrade the project and have to use this MVC3+MVC4 environment.
Any ideas of how to load MVC3 project in a (MVC3 + MVC4) environments?
thanks a lot.
Victor
As CodeCaster suggested, I removed MVC3, and reinstalled, but it doesn't help.
But I found the other way to trigger web platform installer to 'repair' the environment. I am not sure if this is a typical case, but If you did try all kind of ideas to load a MVC3 project in a MVC3+MVC4 evnriroment, but don't work.
you can try this one.
my case is in the project file, we have ASP.NET MVC 3 {E53F8FEA-EAE0-44A6-8774-FFD645390401} in the project type already, and we have MVC3, Visual Studio tools and ASP.NET Web Pages installed, but we still can not load MVC3 project,
the error is "The project type is not supported by this installation.".
and if you launch web platform installer, it tells you "... already installed."
if this is your case, try what we just did, it seems can resolve the issue.
1) manually open the project file, remove {E53F8FEA-EAE0-44A6-8774-FFD645390401}, and compile the project, you should be able to compile the project, because you have MVC3 environment installed.
2) then manually open the project file again, add back {E53F8FEA-EAE0-44A6-8774-FFD645390401}, and open project, I remember I waited for about 10 seconds,
and it showed up a message about missing "Microsoft ASP.NET web Pages - Visual Studio 2010 Tools" (actually in control panel => program list, it got installed already), and ask me to install it using ASP.NET install consol. I clicked yes, after the installation is done, I can open the project and compile it.
Hope this helps your case.
In general Mvc3 is not supported after VS2010,I use VS2010SP1 btw.
You may make it work but it will bite you in the end.
So i recomend choosing matching VS and MVC versions(check the official microsoft site to see the connenction)

What is the possible solution if the asp.net hosting provider does not allow .exe files which I require for Roslyn Compiler?

I have developed a responsive asp.net website using Visual Studio 2015 Community by choosing the default ASP.NET Forms template . On my local computer, the website runs perfectly fine, but when I uploaded all the files of the website to the internet server, I found that I am not able to upload three files with .exe extension namely "csc.exe","vbc.exe" and "VBCSCompiler.exe" under the path "/Bin/roslyn". I raised a ticket to my hosting provider net4india and they are saying that they don't allow .exe files to be uploaded on server as they may be potential viruses. I had earlier developed this website on Visual Studio 2010 and was working perfectly fine on the hosting server also , but I wanted to make it responsive and I don't know how to use bootstrap, so I had choosen the template for ready-made coding, but now this is a big problem. I have googled a lot on this issue, but not found anything even near to what I am facing , even on stackoverflow. How can I resolve this issue ? Is any work-around possible for this like converting the .exe to .dll files or anything like that ? Please help.
You can deploy even without Roslyn with no change in code. Open NuGet Package Manager window and uninstall Microsoft.CodeDom.Providers.DotNetCompilerPlatform package and rebuild & republish. This will solve your purpose. Basically this will not generate any csc.exe, vbc.exe files inside bin folder.
No hosting provider will allow you to run exe files. If you really want that, you should go for (virtual) dedicated server.

pre compile website in Setup & Deployment

Every time I use Setup & Deployment to create a new Web Setup, and run it (after edit all the nice things in the properties), the output is always a copy of the Web Site project...
How can I output a PreCompile version of the WebSite project?
What I did was, publish the Web Site (so I get the precompiled version), add this new precompiled web site as an existing Web site to my solution and add it to the content output of the Setup...
well, the idea was good but I get an error saying:
"This application is already precompiled."
alt text http://www.balexandre.com/temp/stackoverflow_precompiledquestion.png
:-(
Bottom line is that I just want a Setup file that gives me the precompiled version of my Web project, how can I accomplish this?
I see you tried the standard Web Setup project from VS.
Scott Gu's blog post takes you to this page:
Visual Studio 2008 Web Deployment Projects
which is a plugin for Visual Studio that activates an additional "right click" option to any Web Site project to add such a deployment project. You can see here what I created.... And the output is a pre-compiled web application. Now, if you add a regular Web Setup project to your solution, and point it to the previously created Web Deploy project as its content, ... I got a valid build, no errors and an MSI file was created...with dlls inside it.
http://img222.imageshack.us/img222/6177/71881923mj9.jpg
I hope this helps you.
I was searching for this solution from google for long days. What i did is i precompiled my website to one folder and added that folder as a new website to my
solution(While adding it will give a warning message that it was already precompiled content. No probs). Now add this project output to the my setup project and one more important thing is in my web deployment project i just disabled Building of my precompiled
website.
I just got my thinks working. If you want you can try that.
Regards,
Rousseau.A
you may be having "PrecompiledApp.config" file in the root of your web application (please check in solution explorer).
I faced this issue and removed "PrecompiledApp.config" from solution explorer and solved the issue.

Properly using file Designer Files in ASP.NET Web Sites

I need to get existing web pages into an existing ASP.NET web site project in Visual Studio 2008. I simply tried to drag and drop the whole file folder content into the Visual Studio Solution Explorer or even to copy them into the web site folder.
Both ways, Visual Studio seems unable to map the .designer.cs files to the corresponding .aspx (or .master) file, even after restarting the whole IDE. The Solution Explorer entry looks in a way like this:
- Main.aspx
Main.aspx.cs
Main.aspx.designer.cs
Can I make Visual Studio file the designer-file below the aspx-file in any way? I strongly hope there is a simpler way than manually creating each file and copying and pasting the contents into each file by hand.
It sounds like you are trying to bring web application files into a web site. IIf that is the case, The designer files are not even needed. Just dont include them. They are generated and compiled in at runtime when the website runs.
Kind of partially self-answering my question:
In a web project - in contrast to a web site - it works perfectly through drag and drop onto the solution explorer, as I did for the web site before. To make the decision which type of "web site unit" to use there is another thread here on stackoverflow: ASP.NET Web Site or Web Project.
In a web site I can't even use YonahW's solution, because I can't just put files into the proper web site directory without causing them to be added to the web site automatically. Thanks to you anyway, YonahW. :-)
try copying the files through the filesystem and then right clicking on the project and selecting to add an existing item at which point you can choose all at once and this usually puts them in the proper places.

Categories

Resources