I am developing MVC 3 application and using razor syntax.(EF 4.0)
I am trying to add controller to my App. but whenever I try to add the controller I get the following error.
I am trying to add controller in test copy as well sourcesafe copy...
And the error is....
When I try add the controller in SourceSafe copy of the same application , below error comes...
How to solve it ?
Look into this article, your solution is most likely there.
Edit
Please take a look into this article dealing with specifically "Unsopported context type" during controller scaffolding: Unsupported context type in controller wizard.
Hope you can get ideas and solution from there...
Hope this helps
Related
Base URL to run the my MVC app is:
http://localhost/RealSuiteApps/RealHelp/-1/Inbox/
And... I get this exception:
I know what it means :) But I dont understand why I get it, I have everything in place and the exact same code was working perfectly yesterday. What could go wrong?
Here is the code, you see I have InboxController, Index action in it, and of course the view under Views/Inbox/Index view
Most likely, this is a routing issue. Based on the error message, the Index action that's being loaded is actually in HomeController. MVC is searching /Views/Home/ for the view, so that means the controller is HomeController. You should probably post your RouteConfig.cs file for a more thorough answer, but generally, I can tell you that you need to look at your routes and figure out why the URL is not going where it should.
I try to implement Telerik Report in my WebApp and get runtime error.
Exception Details: System.TypeLoadException:
GenericArguments[0],'BuilkReport.Areas.Report.Template.PoReport', on
'Telerik.Reporting.XmlSerialization.Current.ReportSerializable`1[TReport]'
violates the constraint of type parameter 'TReport'.
These are the methods I use:
Create a telerik report and create parameters for its constructor
Create a model using Telerik.Reporting.InstanceReportSource as one of data members
Use controller to get proper parameter for the model, then pass it to the view
These steps worked fine, with data going correctly as planned. In the view part, I use method found in this demo : http://www.telerik.com/community/code-library/reporting/general/using-telerik-web-reportviewer-in-asp-net-mvc-application.aspx
I simply copy those views into my project and pass the model from controller to be passed to ReportViewer1.ReportSource (instead of creating a new one like in the demo project)
Can anyone please help me with this? Thanks.
There is released a preview of the beta HTML5 Report Viewer - Bringing the Power of HTML5 to Telerik Reporting
Please try the steps outlined here -
http://blogs.telerik.com/careypayette/posts/13-03-26/telerik-reporting-in-mvc-sure-it-takes-8-quick-steps-
To start off, I'm using Asp.Net MVC 4, and I've modified my solution to contain the CodeTemplates folder by following this tutorial. (I think my issue might be MVC related?)
I've replaced the code in the Ajax grid template with a with my own JQgrid-template, which was fine for getting my project started. But I'm having trouble creating completely new controller templates (well the having them show up in the create new controller menu)
any ideas?
Update
I've taken a few stabs at using the scaffolding feature, but it's not exactly what i had in mind (although it does work like expected. I watched a video by steve sanderson on the topic that was quite informative), any way to get my custom views/controllers inside the add controller gui?
As far as my understanding of your problem goes, you cannot manage two controllers within one .ps1 file, which corresponds to your "AddController" directory.
You have to use the Package Manager and issue a command like
Scaffold CustomScaffolder <choose-name>
This will generate another subfolder below CodeTemplates with the name . From there, you open and edit t4 files like you did with your existing one.
More info here
I'm evaluating MVC 3 and Razor. All was going well until I tried right clicking on Views\Shared and Add..View... I check the 'Create a partial' checkbox, strongly typed view, choose an entity, Razor, Empty... When I press OK, I get a huge error. Template Processing resulted in 1 Errors. The following exception was thrown: System.IO.FileNotFoundException: Could not load file or assembly 'Domain, Version-1.0.0.0... Trying this on a coworkers machine gave me no problems. We have the same version of MVC 3 installed. Any ideas why her's works just fine but I am getting this error? I have tried running as Administrator as well. Still no luck. Oddly if I uncheck strongly typed view, the partial view is created without a problem. Does anyone know how I can remedy this?
Thanks For any tips or help,
~ck in San Diego
I'm new to this and have the same issue. A workaround seems to be to remove the reference, create the partial view and than add the reference again. So it seems to be something inside this reference (corrupt).
I followed the guidance in the Professional Asp.net 1.0 Wrox book for adding the MVC references to an exisiting web application and it works well except for the scaffolding options. When i right click a controller i do not get the scaffold view options that you get in a new asp.net mvc app. I am sure there is a .csproj hack that is needed to get the scaffold options but i can't find any references anywhere. Has anyone else run into this and found a solution?
Well google to the rescue. I found an answer at the following blog: http://wildermuth.com/Tag/ASP.NET+MVC
You need to edit the .csproj file and add to ProjectTypeGuids {603c0e0b-db56-11dc-be95-000d561079b0}. Order seems to matter. Originally i added to the end of the guid list and the project would not load and threw an unsupported error. I created an empty mvc site and looked at the guids and the guid above was listed 1st. So i added it to the beginning and everything worked fine.
Have you looked at how you register the data context in you Global.asax file?
This link may have more details that can help:
http://msdn.microsoft.com/en-us/library/system.web.dynamicdata.metamodel.registercontext.aspx
and this:
http://msdn.microsoft.com/en-us/library/system.web.dynamicdata.metamodel.aspx