the command exited with code 4 with EntityFramework.SqlServerCompact nuget packge - asp.net-mvc

I am having an issue when I try to use 'EntityFramework.SqlServerCompact nuget packge'.
I have created my model classes and I am also using the new ASP.NET MVC Tools Update MVcScaffolding out for the box feature when creating a new controller. this tooling feature also creates my DbContext class.
as it is explaind here :
http://www.hanselman.com/blog/Mix11WebPlatformAndToolsKeynoteDemoScript.aspx
Everything is fine. But, when I add the 'EntityFramework.SqlServerCompact nuget packge' and try to compile, I am getting the following error;
My machine is windows vista, 32bit and I am using VS 2010 pro if it matters.

I shared the link of this question on Scott Hanselman's blog post as comment and he gets back to me in an hour or so. the answer is as follows;
Perhaps a character in your path? Does
it work in a folder like c:\dev?
and it totally worked. the problem related to folder chars and I tried it inside the c:\apps folder. thanks Scott !

Related

Where are the predefined file templates located for Razor?

I've just started playing around with JetBrains Rider IDE using one of my existing ASP.NET MVC projects. When attempting to create a new Razor View from template, I've been unable to find any templates which refer to Razor as stated here. These are all the templates I can see when adding a file template to a chosen folder.
Am I missing something like a plugin, nuget etc...? If worst comes to worst, then I don't mind creating them, it's just a slight annoyance that it clearly states they should be there.
OS: Windows 10 Build 17134
JetBrains Rider: 2018.1 Build #RD-181.4379.1191, built on April 14,
2018
Update
I've raised this with JetBrains support and so far they've advised that some predefined templates (Razor being one) are only available in subfolders of Views folder. More info can be found here. Sadly it's still not working for me but thought I'd add as it may help someone.
It's a bug! It's seems to be okay when creating a new solution but then at corrupts the template analytics when updating nugets and/or adding OWIN (I'm guessing the Startup.cs in the root of the project has something to do with it as well).
YouTrack: https://youtrack.jetbrains.com/issue/RSRP-469774
Update
It took nearly 5 years but they finally fixed it. I don't even use that IDE anymore lol!

Adding API controller in same project as MVC controllers

How can an API controller be added to a project with existing MVC (non-API) controllers?
Problem:
I've created a very basic "hello world" MVC project with only one model, view, and controller. When I attempt to add the API controller (not using scaffolding), I can't get using System.Web.Http; to show in IntelliSense. using System.Web will show up, but the .Http part is not available. What do I need to do or change?
Details:
I'm using VS2013 Express on a Win7 machine.
David Tansey pointed in the right direction with his comments, but after researching there's more to this than I realized as a beginner.
First, this wasn't available in the using statement because I didn't have a reference for system.web.http in my project. Digging further, I found the reference wasn't even available! So, I had to install using NuGet Package Manager Console Powershell.
In powershell, I can't just do install-package System.Web.Http. That package doesn't exist. But, thanks to one answer that David Tansey's comments pointed to, I noticed I could do install-package microsoft.aspnet.webapi. Wonderful! Now System.Web.Http is listed under References in my project, and I can write the using statement in my API controller code: using System.Web.Http;
For a beginner like me, a lot of steps to go through, and a lot of material to comprehend, to get started.

Monodevelop MVC3 razor - what is the trick to get it to work?

I use monodevelop 3.0.4.7 and mono 2.11.4 on mac OS 10.8.
When I create a new solution from scratch in monodevelop I can create several types of ASP.NET mvc3 projects with razor views, but the projects get created with references to system.web.helpers and system.web.webpages that are "not available for Mono/.net 4.0 in mono 2.11.4" and won't build.
If I change my .net version to 4.5 in the project options I get the system.web.webpages reference resolved, and if I simply remove the reference to system.web.helpers I am able to build the default site. However, it is unable to make use of .cshtml views, it only looks for aspx views.
I have tried different things related to references and versions of mono, changing the viewengine to razor in global.asax.cs and even copied dll's from a windows-based asp.net mvc application, but something new breaks all the time.
It seems strange that there are project types included that don't work from scratch, so I'm guessing/hoping I'm missing something much simpler?
I was sitting with the exact same problem, on Linux though, so I decided to ask on the mono mailing list (see the answer to my question here: http://lists.ximian.com/pipermail/mono-list/2012-October/049022.html).
The short answer is: no, you're not missing anything simple.
Long version: The current version of mono is not compiling the System.Web.Helpers.dll, so you have to do some footwork your self, to get it compiled. That is described in the link above.
I guess we just have to wait a little longer before this becomes part of the mono framework :/
I happened across a solution for this issue here:
http://blog.miraclespain.com/archive/2013/Jun-24.html
Basically in xamarin studio you can add a version of nuget from the following add-in repository source:
http://mrward.github.com/monodevelop-nuget-addin-repository/4.0/main.mrep
Once nuget is installed, you can create a new mvc3 razor project, notice the missing references for system.web.helpers and system.web.pages and just remove them, then use nuget to add the microsoft aspnet web pages 2 package which solves the missing references.

MVC 2 to MVC 3: MvcScaffolding fails due to "could not load file or assembly" error

Setup:
I am using MVC 3, EF 4.1, Visual Studio 2010 SP1 with Power Tools updated to latest version.
With the above installations, I don't need the NuGet packages that were required previously. Everything is RTM.
The project has been upgraded from MVC 2 to MVC 3. I initially tried the upgrade tool, but that gave me grief, so I did it manually as per the instructions in the MVC 3 Read Me file.
Problem:
When trying to use the new scaffolding of controllers and views for CRUD functionality (against Code First DbContext), the scaffolding fails with the error:
Could not load file or assembly 'file:///C:\[PATH TO MY APP]\bin\Lanap.BotDetect.dll'
or one of its dependencies. Operation is not supported.
(Exception from HRESULT: 0x80131515)
Question:
Lanap.BotDetect is a Captcha control. It works fine and is there, I use it in other pages no problems, the solution compiles, etc, etc. So there is no problem with this dll.
However, this error is stopping me using the new scaffolding capabilities.
I can't see what it has to do with the scaffolding of a new controller and its views, so there must be some configuration that is wrong.
Any suggestions as to where I can look? Googling has drawn a blank.
EDIT 1:
I am trying to see the failed assembly binding using Fusion Log as suggested in a comment. No failed binding showing (but that might be my fault) but the question remains:
Why would MvcScaffolding NEED to load the Captcha .dll at all? It is just scaffolding a controller, and nothing in the T4 says anything about this .dll
(NOTE: I haven't edited the scaffolding T4 code)
EDIT 2:
I tried removing the reference to Lanap.BotDetect, and the error changed to not being able to open the config file that has the connection strings (I shunt the connection strings out to a db.config string, just gives me less visual pain when looking at a config file).
I am giving up on scaffolding on this app. It works in clean, new apps, but not this one where there is a lot of pre existing code.
I found another solution to this. Turns the issue for me was that the issue was it was being built over a network drive. So when I moved the project over to a location local to my machine and rebuilt the project it corrected everything. I detailed everything with screen shots and here...
http://ryandunn.co/mvc-growing-pains-could-not-load-file-controller-dll
Put simply check the location of your project and move it to C: after that a quick rebuild had me back and working normally.
So I know that you have moved on but I ran into the same problem and just found the solution. It turns out the error is due to the assembly not being trusted i.e. you downloaded it from the internet.
You can right click the .dll and unblock it to fix the problem. For info on how to unblock see the following
http://blogs.msdn.com/b/brada/archive/2009/12/11/visual-studio-project-sample-loading-error-assembly-could-not-be-loaded-and-will-be-ignored-could-not-load-file-or-assembly-or-one-of-its-dependencies-operation-is-not-supported-exception-from-hresult-0x80131515.aspx

"the project type is not supported by this installation" error

I have installed VS 2008 SP1 on W2k3 OS. After I installed ASP.NET MVC beta and tried creating ASP.NET MVC type project I get the following error.
"the project type is not supported by this installation"
Let me know if you have fixed this issue.
I tried some of the solutions posted here but still no joy. Finally I replaced the ProjectTypeGuids to this one below in the project file and it loaded fine
<ProjectTypeGuids>{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
I came across something while having issues of my own.
In short, try:
Run the Visual Studio Command Prompt as Admin.
Execute:
devenv /setup
It then whirs away for a bit (VS2008 will not open), once the prompt returns fire up VS and all (may) be back to normal.
I came across this when my MVC projects got messed up when trying to get the Entity Framework up and running :)
The problem is that MVC 2 is not completely backward compatible. Visual Studio cannot open MVC 1 apps without MVC 1 installed. So if you just install MVC 1, which can install together with MVC 2 you should be just fine.
http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=53289097-73ce-43bf-b6a6-35e00103cb4b
I had the same problem with MVC v1. Turns out that I hadn't installed the "Visual Web Developer" feature.
This SO user had the same issue.
My situation was slightly different: I was trying to open an existing MVC 3 project. Turns out I didn't have MVC 3, installing it from here fixed the problem for me.
i installed visual web developer from the Visual studio 2008 installation dvd and that fixed the problem
Tried to install ASP.NET MVC 1.0. It works to me.
ewalshe - same thing worked for me. I know this is an old post, just wanted to put this out there for anybody else. I had an existing solution in source control (Vault), and wanted to set up my home computer for development. I installed Visual Studio 2008 at home without the following options:
C++
Visual Basic
Visual Web Developer
When I pulled down the solution from source control, all projects loaded EXCEPT my web project - VS simply did not recognize it. A fresh installation using the default options and a restart fixed my problem. I do not have the time nor the desire to really figure out which of the above is necessary for Web Application projects to work... maybe somebody will chime in.
~ryan
I was getting the same error and found this question in a Google search for the answer. Most answers unearthed in the search suggested that old project types were being moved onto a machine with a different version of Visual Studio installed. None of which applied to me.
I've got VS2008 installed on a machine (running 64bit Vista) at work and recently installed the ASP.NET MVC beta, without any problems.
I wanted to replicate my work environment on my Mac, so I installed VS2008 with the ASP.NET MVC beta into a WinXp installation running within a Parallels VM. When I went to create a project with the ASP.NET MVC Web Application template I got the "the project type is not supported by this installation" error.
I finally got things working by yet another reinstall of VS2008 (a clean install, not a repair). This time I choose the default installation options, rather than customising things as I usually do. I normally deselect VB, the mobile device, office and other non C# development stuff - I don't have much free space on my Mac.
After the clean install of VS2008 I did a windows update, installed VS2008 SP1 and finally installed the ASP.NET MVC beta.
It seems that when I customised the VS2008 install, I deselected something essential for the correct operation of the MVC beta. I don't have clue what that something is, I'm just happy that after three days I can play the the MVC stuff at home.
Its been a month since you posted the question. Have you made any progress since?
This is sometimes caused by running a version of Visual Studio which doesn't support MSTest.
This might be obvious, but it fixed it for me. I had installed ASP.NET MVC prior to installing Visual Studio 2008. Once I removed MVC and reinstalled, I no longer had the problem.
install ASP.NET MVC 1.0. It works to me.
In Windows 7 if you are not running as the local "Administrator" and have UAC turned on the install will silently fail. The solution is to disable UAC, reboot, and the install should succeed.
I kept running into this problem. Running devenv /setup and devenv /resetskippkgs did not work for me. Nor did removing project guids. I installed MVC 1.0 and it still didnt work. Then I installed MVC 2.0 and that seemed to do it.
I had MVC 2 installed on my machine and I was still getting this error message. I installed MVC 1, no GO. i installed web Developer No GO. I finally uninstalled MVC1 and MVC2 and then reinstalled MVC2: http://www.microsoft.com/Downloads/en/details.aspx?familyid=C9BA1FE1-3BA8-439A-9E21-DEF90A8615A9&displaylang=en
The re installation of MVC 2 solved the problem for me. Hope this helps someone else.
Thanks
If you are trying to run an MVC application, try running AspNetMVC1.msi. It worked for me, so hopefully it will resolve your problem.
VS2008; ASP.NET MVC 2 on 64-bit machine receiving the issue:
"the project type is not supported by this installation"
Solution: Thanks to Bert Huijben from above. Under the VS install in the start menu, in the VS Tool folder, ran VS2008 x64 Cmd Prompt. Executed commands:
devenv /setup
...still project errored and didn't open, then ran
devenv.exe /resetskippkgs
... and then success!
I had to rebuild my development VM to solve this one. Clean install FTW.
Tried #ryan and #Rob Cooper answers with no joy. Running this in a vhd on Win7.
Zoned in on Mvc and that's where problem lies. Not 100% but think issue is that I was trying to open a project that didn't have latest Mvc release, which new build had.
Temporary solution is to rollback to previous version of Mvc. Then when that's happy, upgrade project to latest Mvc and then machine.
Ran into this problem when I had VS2008 running by accident when I started the ASP.NET MVC install. Closed VS, uninstalled ASP.NET MVC, then reinstalled it and everything worked fine.
Vivek Ayer's solution also worked for MbUnit projects. Additionally, simply deleting the first GUID (rather than replacing it with "{349c5851-65df-11da-9384-00065b846f21}") worked.
If you are running Visual Studio 2010 and want to open/create MVC 3 solutions you have to have the Visual Web Developer component of Visual Studio installed.
If you have done a default installation without customization then this component is installed.
If you do a customized installation and say thought you only wanted C# stuff installed you may have unchecked the Visual Web Developer component thinking you didn't need it. You need it for any MVC development. Simply re-run your VS setup and make sure this component is selected.
The MVC 3 download and installation will work properly even without this component installed. However, you will not be able to open or create a MVC 3 solution.
The trick to getting around this problem is the ProjectTypeGUID, but the GUIDS listed elsewhere in this and other posts didn't work for me.
In the end (and this is my suggestion), I created a new MVC project, then open the *.vbProj file and copy out the ProjectTypeGUIDs I found there. When I transposed those into the vbproj file of the project I was having trouble with, everything started working.
In my case (for an existing VS10 VB project), the right GUIDs were:
<ProjectTypeGuids>{F85E285D-A4E0-4152-9332-AB1D724D3325};{349c5851-65df-11da-9384-00065b846f21};{F184B08F-C81C-45F6-A57F-5ABD9991F28F}</ProjectTypeGuids>

Resources