How to correct issue with creating Web API 2 OData Controller with Actions using EF code-gen template with VS 2013? - entity-framework

I have a couple of dev environments. In my older VS 2013 Ultimate, I can execute the Web API 2 OData Controller with Actions using Entity Framework template code to create classes.
The second is Visual Studio 2013 Ultimate with Update 2 RC. I can create other classes, however in trying to create the aforementioned, I get the following error:
Microsoft Visual Studio Error
There was an error running the selected code generator:
'Exception has been thrown by the target of an invocation.'
Since I have installed other components, I reset all settings through Tools / Import Export Settings / Reset All Settings.
I even completely uninstalled/re-installed - same issue on all fronts.
In both environments the code is exactly the same, connection to the same db.
I have tried using the code templates folder from the working env in the newer env - no go.
I also tried removing Update 2 RC through Windows / Installed Updates, but the request is rejected, indicating VS requires this update to run.
Suggestions?

Related

New Service Fabric Stateless Web Api Core Project will not compile

I open visual studio and do file->new project.
I select cloud->service fabric application. Then I pick Stateless ASP.NET Core. In the last window I select Web API and change the authentication to windows authentication.
When I do this and then compile the application, I get errors saying that System.Fabric, Microsoft.ServiceFabric.* are missing.
How can I get this to work?
NOTE: I have Visual Studio 2017 15.2. I downloaded and installed what I think is the most recent tools for service fabric. My "Extensions and Updates" says I have version 1.6.20170504.1.
UPDATE - This was due to the project having a dash in the name. It appears that the template cannot cope with dash casing your project name. (It had nothing to do with Windows Authentication.)
UPDATE - This was due to the project having a dash in the name. It appears that the template cannot cope with dash casing your project name.
This seems to be a problem with the template. If you don't select Windows Authentication, then it will compile fine.
In a project without windows authentication, the Nuget assemblies are:
Microsoft.ApplicationInsights.AspNetCore
Microsoft.AspNetCore
Microsoft.AspNetCore.Mvc
Microsoft.Extensions.Logging.Debug
Microsoft.ServiceFabric
Microsoft.ServiceFabric.AspNetCore.WebListener
Microsoft.ServiceFabric.Data
Microsoft.ServiceFabric.Services
When you select Windows Authentication, only the top 4 are added to the project.
If you add the four missing NuGet packages (the ones in bold above) then the project will compile just fine.

OpsHub Visual Studio Online Migration Utility - User Mapping, MetadataException OpsHub-014371

I am using the OpsHub Visual Studio Online Migration Utility and when I go to the User Mapping screen, I receive the following dialog box:
Error
"com.opshub.eai.metadata.MetadataException: OpsHub-014371: Could not instantiate metadata implementation for For User List | TFS Source 1437692124799 ALM TFS 1437692124807, due to (301)Moved Permanently"
Also, I installed the utility on multiple computers, tried connecting to different TFS 2010 instances, but always receive similar error messages.
Does anyone have any experience troubleshooting this issue?

Visual Studio Online Build access denied

I'm very new to TFS but am using Visual Studio Team Services... which i believe are largely the same configurations and technologies.
Now its possible that VS Team Services only supports web projects but they to be the only type of project that i'm able to build. I've tried several other (non-web) project types including the default console project but I always get a build error similar to one below....
C:\Users\Mark\Documents\Visual Studio 2013\Projects\App1\App1\App.config:
Access to the path 'C:\Users\Mark\Documents\Visual Studio 2013\Projects\App1\App1' is denied.
I'll get a error like the one above for every file in the project.
Can someone confirm whether Visual Studio Team Services does support building other types of projects. If so, is there some special permission or additional setting in build definition that needs to be set prior to triggering build?
Thanks. Turns out all i needed to do was to switch the build template under Build Definition->Process--> Build Process file from default to 'TfvcTemplate.12.xaml'.

Call between ambigious RenderActions

I recently uploaded my ASP.NET MVC 2 Preview 2/.NET 4 application (Built using VS 2010 Beta 2) to MaximumASP.com's beta websites and when I try to run it I get the following error:
CS0121: The call is ambiguous between the following methods or properties: 'System.Web.Mvc.Html.ChildActionExtensions.RenderAction(System.Web.Mvc.HtmlHelper, string, string)' and 'Microsoft.Web.Mvc.ViewExtensions.RenderAction(System.Web.Mvc.HtmlHelper, string, string)'
This error doesn't show up on my developer machine (Windows 7, VS 2010). Any idea what could be causing this?
UPDATE
I made sure that the .dlls I uploaded with my project are the ones that are working fine with Visual Studio 2010 Beta 2, but I still get the same error when I upload it to my host.
My host is using the newest version of ASP.NET MVC 2 (Beta), but I'm referencing the old Preview .dlls in my web.config and uploading them in the BIN folder, but still nothing.
-
In my case, removing the reference to the old Microsoft.Web.Mvc library from ASP.NET MVC 1 solved the problem.
MVC is NOT supported in VS2010 ... So is this Preview 2 (Although RenderAction is part of MVC2 Beta?)?
http://haacked.com/archive/2009/11/17/asp.net-mvc-2-beta-released.aspx
Unfortunately, because Visual Studio
2010 Beta 2 and ASP.NET MVC 2 Beta
share components which are currently
not in sync, running ASP.NET MVC 2
Beta on VS10 Beta 2 is not supported.
Can you give us the output of typeof(Controller).Assembly.GlobalAssemblyCache, both on your dev machine and on your host? If your controller code is able to run, you can just Response.Write() it, then Response.End(). This will cause your view not to render, so hopefully you can avoid that error.
Edit:
Since your hoster has GACed the MVC binary, you need to compile your site against the same version of the binary that your hoster is using; bin-deployment won't work. If your hoster has installed MVC 2 Beta, you need to compile your site against the MVC 2 Beta binary. Unfortunately this means that you'll have to compile your site with VS2008 + MVC 2 Beta, as VS2010 Beta 2 includes MVC 2 Preview 2, which is an earlier version than what your hoster has deployed.
As a completely unsupported workaround that might make MVC 2 Beta run on VS2010 Beta 2, check this comment on Phil's blog. Note that I mean completely unsupported - it might affect other parts of VS, prevent uninstallation and require reformatting the machine, cause your machine to turn radioactive, etc.
Alternatively, smack your hoster for GAC-deploying Beta binaries and get them to un-GAC it. :) Then you can bin-deploy the particular binary you're compiling against.
Two things I can think of; First, you could make sure not to import one of the namespaces on all of the pages (eg, remove Microsoft.Web.Mvc.ViewExtensions from any <% Import %> statements and from the system.web/pages/namespaces area of the web.config. This unfortunately means that you can't easily reference the extension methods in that assembly however.
An alternative option provided on the MSDN forums would be to write an extension method of your own that just wraps the one you want to call and has a completely different name (eg, BaddieRenderAction()).
Neither option is all that great, but with the second option at least you can get up and running easily and then in the future when MVC 2 is released and your providers GACed assemblies don't cause a problem, you can do a Search and Replace for "BaddieRenderAction" -> "RenderAction" and it's all fixed.
Rather than wrap the Render Action, just explicitly call the extension method as follows:
Microsoft.Web.Mvc.ViewExtensions.RenderAction(Html, ...)

installing asp.mvc 2 beta nunit project templates untrusted component error

I've been trying to get nunit 2.5 to work with mvc 2 (VS2008) after following some guides and updating registries. I though I was done. I can select nunit when choosing my testing frame work but there is no test project created. When I create a new mvcapplication.nunit.tests template it fails with the error.
Error: this template attempted to load an untrusted component 'Microsoft.VisualStudio.Web.Extensions', Version 9.0.0.0 Culture=neutral, PublicKeyToken=31bf3856ad364e35'
I'm a little lost as to where to find the component and how to make it trusted.
I think the best answer at this point is to change the problem...
Use Visual Studio 2010, the MVC3 platform and this plugin via nuget
https://nuget.org/packages/nunit