MVC :: Unity Setup - Which IOC's Are Most Suitable For MVC3 & EF4, And .Net 4 Framework
Jan 19, 2011
I would like to implement IOC and DI and have been looking at the various open source IOC's such as Unity, StructureMap, Ninject, and Castle Windsor, but I noticed that some of them are based on .Net 3.5 framework. Does this matter? Which IOC's would be most suitable or easily integrates for use in an MVC3, EF4, and .NET 4 framework application? Which would be the simplest to implement?
View 5 Replies
Similar Messages:
Feb 19, 2011
Would like to add a third party test framework (such as NUnit or MbUnit) to the drop-down list of test projects for the ASP.NET MVC3 type project in Visual Studio 2010.
This had worked before for ASP.NET MVC2 and prior, but the msdn instructions are not accurate and does not work. Creating the registry keys in the HKEY_CURRENT_USER seem to delete the keys every time the VS-2010 starts, the HKEY_LOCAL_MACHINE does not follow the same tree structure.
how to add a third party framework under ASP.NET MVC3?
View 3 Replies
Mar 7, 2011
while installing .net framework 3.5 sp1 i am getting setup error
View 3 Replies
Jan 27, 2010
my application is in vs2005 (2.0 framwork) , now i wnt to add ajaxcontrol on my applicaiton its ok and also working fine , now the problem is when i m using an ajax control its generate script so because of that page loading takes time ,
i also search the way to optiomize that , and i found need to[Code]....
i have also search the metod on how to combile that and all , some ppl using various way to combile that
one of that i found this article , + if you use 3.5 then can also
[Code]....
ut my framework is 2.0 and most of them functioning is avialble on (3.5 famework )
so wht is good idea shall i remove my 2.0 framework and again install 3.5 , will it affect my current application
i m only using (ajaxcontrol) feaures nothing else
coz i have seen if i use 3.5 i can use LINQ also and this <compositescript> too
View 6 Replies
Oct 23, 2010
When I tried to deploy the project using DotNet 2.0 using VS2010, it failed and no error message. I make sure all the Framework checkboxes have 2.0 checked. In the prerequisies window, I only checked the installer 3.1. In the Detected Dependencies, The Microsoft .NET Framework is 2.0. The development and target PCs are both XP - SP3. When I unpack the .msi file in the target PC and run the application, it crashed.The only way to make that work is to use VS2005 to perform the setup. Of course, copying the files over to the target PC directory works. So, the VS2010 setup is unpacking something at the target that makes it crash. VS2010 fixed the code-behind fatal bugs and I cannot go back to VS2005 or VS2008. I also noticed that you need to install 3.5 before you can use 2.0 in VS2010... Anybody knows what is going on ?
View 3 Replies
Sep 9, 2010
I am new to this, and I am trying to implement a linq query similar to db.Genres.Include("Albums") command from
mvc music store using my current DB setup. I realize that the tutorial mentions Checlking the "Include foreign key columns in the method" when creating the tables in ADO.NET, but if I am using LINQ to SQL classes, then how can I obtain the same effect. And how do I use
db.Genres.Include("Albums") to simplify my life?
View 2 Replies
Sep 17, 2010
what is unity of asp.net framework lib. how to use it.
what is the benifit of using this
View 3 Replies
Sep 21, 2010
I'm having trouble setting up a custom NEW User Screen. Here is my situation, I have a Request for Access Screen that uses the CreateNewUser Wizard Control. I want to leave the Question and Answer for this, however I also want a custom NEW User Setup which I build myself to allow the system administrators to setup users, but for this setup I don't want the administrators to have to pick the question and answer for the NEW user, so I would like to bypass this for this setup. However, my Membership.CreateUser keeps asking for it. How can I accomplish this? I've included a copy of my current web.config file. You will notice a AspNetAdminMemberhip which I use to allow the System Administrators to reset passwords.
<?
<
<
<
<
<
<
<
<
</
</
</
</
<
<
<
<
</
<
<
<
<
xml
version="1.0"?><configuration>configSections>sectionGroup
name="system.web.extensions"
type="System.Web.Configuration.SystemWebExtensionsSectionGroup,
System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">sectionGroup
name="scripting"
type="System.Web.Configuration.ScriptingSectionGroup,
System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">section
name="scriptResourceHandler"
type="System.Web.Configuration.ScriptingScriptResourceHandlerSection,
System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
requirePermission="false"
allowDefinition="MachineToApplication"/>sectionGroup
name="webServices"
type="System.Web.Configuration.ScriptingWebServicesSectionGroup,
System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">section
name="jsonSerialization"
type="System.Web.Configuration.ScriptingJsonSerializationSection,
System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
requirePermission="false"
allowDefinition="Everywhere"/>section
name="profileService"
type="System.Web.Configuration.ScriptingProfileServiceSection,
System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
requirePermission="false"
allowDefinition="MachineToApplication"/>section
name="authenticationService"
type="System.Web.Configuration.ScriptingAuthenticationServiceSection,
System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
requirePermission="false"
allowDefinition="MachineToApplication"/>sectionGroup>sectionGroup>sectionGroup>configSections>connectionStrings>add
name="LBX_ChangeControlConnectionString"
connectionString="Data
Source=10.31.30.26;Initial Catalog=LBX_ChangeControl;Persist Security Info=True;User ID=sa;Password=wstinol"
providerName="System.Data.SqlClient"/>remove
name="LocalSqlServer"/>add
name="LocalSqlServer"
connectionString="Data
Source=10.31.30.26;Initial Catalog=LBX_ChangeControl;Persist Security Info=True;User ID=sa;Password=wstinol"
providerName="System.Data.SqlClient"/>connectionStrings>system.web>membership>providers>add
name="AspNetAdminMembership"
type="System.Web.Security.SqlMembershipProvider"
connectionStringName="LocalSqlServer"
applicationName="/"
enablePasswordReset="true"
requiresQuestionAndAnswer="false"
enablePasswordRetrieval="false"
maxInvalidPasswordAttempts="5"
minRequiredPasswordLength="8"
minRequiredNonalphanumericCharacters="1"
/>
</
</
<
<
<
<
<
<
<
<
providers>membership>roleManager
enabled="true"/>authentication
mode="Forms"/>profile
enabled="true">properties>add
name="FirstName"
type="string"/>add
name="LastName"
type="string"/>add
name="Gender"
type="string"/>add
name="ProfileImageID"
type="string"/>add
name="Department"
type="string"/>add
name="PhoneNumber"
type="string"/>properties>profile>pages>controls>add
tagPrefix="asp"
namespace="System.Web.UI"
assembly="System.Web.Extensions,
Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>controls>pages>
Set compilation debug="true" to insert debugging
symbols into the compiled page. Because this affects performance, set this value to true only during development.
<
<
<
<
<
<
</
<
<
-->compilation
debug="true">assemblies>add
assembly="System.Web.Extensions,
Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>add
assembly="System.Design,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>add
assembly="System.Web.Extensions.Design,
Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>add
assembly="System.Windows.Forms,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/><add
assembly="CrystalDecisions.CrystalReports.Engine,
Version=10.2.3600.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/><add
assembly="CrystalDecisions.ReportSource,
Version=10.2.3600.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/><add
assembly="CrystalDecisions.Shared,
Version=10.2.3600.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/><add
assembly="CrystalDecisions.Web,
Version=10.2.3600.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/><add
assembly="CrystalDecisions.ReportAppServer.ClientDoc,
Version=10.2.3600.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/><add
assembly="CrystalDecisions.Enterprise.Framework,
Version=10.2.3600.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/><add
assembly="CrystalDecisions.Enterprise.InfoStore,
Version=10.2.3600.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/></assemblies>compilation>httpHandlers>remove
verb="*"
path="*.asmx"/>add
verb="*"
path="*.asmx"
validate="false"
type="System.Web.Script.Services.ScriptHandlerFactory,
System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>add
verb="*"
path="*_AppService.axd"
validate="false"
type="System.Web.Script.Services.ScriptHandlerFactory,
System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>add
verb="GET,HEAD"
path="ScriptResource.axd"
type="System.Web.Handlers.ScriptResourceHandler,
System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
validate="false"/>add
verb="GET"
path="CrystalImageHandler.aspx"
type="CrystalDecisions.Web.CrystalImageHandler,
CrystalDecisions.Web, Version=10.2.3600.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/></httpHandlers>httpModules>add
name="ScriptModule"
type="System.Web.Handlers.ScriptModule,
System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>httpModules>system.web>system.webServer>validation
validateIntegratedModeConfiguration="false"/>modules>add
name="ScriptModule"
preCondition="integratedMode"
type="System.Web.Handlers.ScriptModule,
System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>modules>handlers>remove
name="WebServiceHandlerFactory-Integrated"/>add
name="ScriptHandlerFactory"
verb="*"
path="*.asmx"
preCondition="integratedMode"
type="System.Web.Script.Services.ScriptHandlerFactory,
System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>add
name="ScriptHandlerFactoryAppServices"
verb="*"
path="*_AppService.axd"
preCondition="integratedMode"
type="System.Web.Script.Services.ScriptHandlerFactory,
System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>add
name="ScriptResource"
preCondition="integratedMode"
verb="GET,HEAD"
path="ScriptResource.axd"
type="System.Web.Handlers.ScriptResourceHandler,
System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>handlers>system.webServer>location
allowOverride="true"
inheritInChildApplications="true">appSettings>add
key="CrystalImageCleaner-AutoStart"
value="true"
/>add
key="CrystalImageCleaner-Sleep"
value="60000"
/>add
key="CrystalImageCleaner-Age"
value="120000"
/>appSettings>location>system.net>mailSettings>smtp
from="Lockbox@tdbanknorth.com">network
host="ME6AWMAIL01.bkng.net"
password=""
userName=""
/>smtp>mailSettings>system.net>configuration>
View 1 Replies
Dec 5, 2010
i see most MVC database application are developed using one form or another ORM. Is it suitable to develop MVC application without ORM (e.g. no Entity Framework 4, nor Linq to SQL) ?
View 5 Replies
Mar 1, 2011
After about 30 Minutes the whole Unity Container is away, that means that all my Dependencies rises null exceptions, because they can't get resolved.
Global.asax:
[Code]....
[Code]....
View 3 Replies
Mar 19, 2010
here's my error:
Error 1 'ASP.admin_new_user2_aspx.GetTypeHashCode()': no suitable method found to override c:WINDOWSMicrosoft.NETFrameworkv2.0.50727Temporary ASP.NET Files eststatus2production7e352623d1efa770App_Web_cx7fp0f_.18.cs 4443
here's the code:
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
public override int GetTypeHashCode() {
return 210248864;
}
View 10 Replies
Nov 12, 2010
I'm going through this tutorial [URL]
[Code]....
When I compile, this error message comes up: 'Framework.ImportControllerFactory.CreateController(System.Web.Routing.RequestContext, string)': no suitable method found to override I have navigated to the definition in the DefaultControllerFactory, and it's (snipping the comments):
[Code]....
View 1 Replies
Oct 17, 2010
I want to move all the website (developed in ASP.NET) images to another server. The image hosting server should be dedicated only image processing like image resizing and etc.
Which server is best suitable for this? Taking another IIS server would require more investment again. Instead can I go for Apache or Lighttpd?
Also the server should be capable to process / resize images even though there is heavy load.
View 4 Replies
Oct 30, 2010
I'm using Microsoft Unity. I have an interface ICustomerService and its implementation CustomerService. I can register them for the Unity container using the following code:
container.RegisterType<ICustomerService, CustomerService>(new TransientLifetimeManager());
If CustomerService has a certain parameter in its constructor (e.g. ISomeService1), I use the following code (I need to specify SomeService1):
container.RegisterType<ICustomerService, CustomerService>(new TransientLifetimeManager(), new InjectionConstructor(new SomeService1()));
No problems here. The problem appears when CustomerService class has two parameters (not one param as in the previous example) in its constructor (e.g. ISomeService1 and ISomeService2). It works fine when I'm using the following code: container.RegisterType(new TransientLifetimeManager(), new InjectionConstructor(new SomeService1(), new SomeService2()));The problem is that I do not want specify SomeService2() for the second parameter. I want to specify only first parameter - SomeService1(). But I get the error that I need to specify none or both of parameters. How can I specify only first parameter of constructor?
View 3 Replies
Nov 25, 2010
in my implementation, I have an interface as: ICachingManager. I've got now one implementation. I also created a manager class as:
public class CachingManager
{
#region Members
private ICachingManager service;
[Code]....
In case I had one implementation, then I can easily register the CachingManager class with Unity, automatically Unity resolves and injects the ICachingManager.
In case I had more than one implementation using named types, then how can I can make use of Unity? Do I need to make use of an Abstract Factory to decide on which named type to initialize?
Is it a good idea to make use of such a composite class or use directly implementations of the interface with Abstract Factory?
View 1 Replies
Mar 7, 2011
I am using unity, entity framework 4 with POCO classes, repository pattern for DAL and services for Business Logic control.I also want to use Unit of Work so I can package together CRUD operations which I perform on different services and then commit them all together.My question is what would be the proper way to inject the Unit Of Work mechanism into my application using Microsoft Unity?I understand that I can put the IUnitOfWork together with the repository on the constructor of the proper service and then if Unity mapping is specified it would auto initiate the proper instances, but this way I do not pass the global unit of work but rather create a new instance on each level, which can't be a smart way to do it (actually the repository is initiated even before the service).
private IUnitOfWork _uow;
/// <summary>
/// Returns the active object context
/// </summary>
private ObjectContext ObjectContext
[code]...
View 2 Replies
Mar 8, 2010
Im faced with an impending upgrade to an ASP.NET site and I am thinking of introducing DI using Unity. I have researched the ASP.NET DI side of things and have 2 options (Global.asax or IHttpModule). Im happy to use either. As always, there is a legacy object model in place that I would like to upgrade/change. I would like to go down the route of Constructor injection (passing in the DAO) however, each object has a mix of static and instance methods that both currently call into the DB using SqlCommand objects themselves. I want this removed to provide DB independence, therefore can anyone suggest the best way to do the DI in this case? Im open to drastic changes if they are needed.
public class ExampleClass
{
public ExampleClass(int test)
{
TestProperty = test;
}
public int TestProperty {get; set;}
public int Save()
{
// Call DB and Save
[Code]....
View 1 Replies
Apr 13, 2010
I'm writing messages to a Message Queue in C# as follows:
ObjectMsg objMsg = new ObjMsg(1,"ascii",20090807);
Message m = new Message();
m.Formatter = new BinaryMessageFormatter();
m.body = objMsg;
queue.Send(m);
and I'm trying to read the messages as follows:
Message m = new Message()
m.Formatter = new BinaryMessageFormatter();
MessageQueue mq = new MessageQueue("./pqueue");
m = mq.Recieve();
ObjMsg msg = (ObjMsg )m.Body;
However I'm getting an error message which says: "Cannot find a formatter capable of reading this message."
View 1 Replies
Mar 15, 2010
I am building a web application that has multiple alternative paths to most of the use cases. These paths I perceive as business rules. I would like to code my application first for main scenarios and then apply alternative scenarios as business rules (rules can be added and removed even when application is in production).I think my application deserves a rule engine. I haven't used any in the past. So I have few queries, but before that here is the profile of my application:
Web based application (data intensive)Somewhat critical (related to health care) - dynamism needs to be accounted for Microsoft .Net platform (ASP.Net, MS SQL Server, WCF)Here are some queries:
How best to externalize rules?
Is it possible to apply rules immediately or batch-wise is the only possibility?
How can Business User be in control of rules?
What best (suitable) rule engine is there? (I prefer to accommodate an open source product)
View 2 Replies
Jan 20, 2011
I have looked at various options for uploading files asynchronously in ASP.NET. the default Microsoft control does full postback, AsyncFileUpload control has only one button and cannot change the text and appearance and I need two buttons browse and upload. not interested in flash based controls. I found this
http://mattberseth.com/blog/2008/07/aspnet_file_upload_with_realti/.
html close to what I need. it uses iframe to achieve this, but I would like a simplified version of this. I just want to display an image while uploading, I don't need number of bytes transferred etc. how can I achieve this? I just need to upload the file asynchronously without page flickering and save the file to the server and update the page contents after the upload is complete.
View 1 Replies
Jan 31, 2011
I have an ASP.NET web forms site using Master Pages. It is using Unity as my IoC container. I have created an HTTP Module to build up the container using a couple of tutorials i found online. I need the dependency injection to work for User Controls and the only way i was able to get this to work was to hook into the Pages PreInit event as can be seen from the code below.
[code]....
I also have autoeventwireup set to true on the pages and master page. Can anyone shed any light on why the events are not firing? Is my Unity http module causing this to happen by dropping the event wiring? I can get this to work no problem in a basic example with no IoC involved.
View 1 Replies
Apr 28, 2010
I have the following generic lifetime manager
[code]...
causes the following error
Cannot create an instance of UI.Common.Unity.RequestLifetimeManager`1[T] because Type.ContainsGenericParameters is true.How do you reference generic lifetime managers?
View 1 Replies
Sep 7, 2010
Does anyone have any good examples of how to make Unity 1.2 or 2.0 work with ASP.NET WebForms?
I thought I had this figured out, but evidently I'm missing something. Now I'm getting the error; "No parameterless constructor defined for this object". I remember getting this error a couple years ago, I and just don't remember what I did.
Obviously Unity isn't working as it should because somewhere along the way I've forgotten something.
Here's some of my code:
Global.asax
[code]....
View 2 Replies
Jul 19, 2010
I am trying to create my own membership system. Therefore I created my own membershipuser class and membership provider class. But I am getting the following error on Createuser method of My membership provider class; no suitable method found to override
This is how my CreateUser method looks like:
public override MyMembershipUser CreateUser(string username, string password, string email, string status, int registerd_on, out UserCreationStatus creation_status)
[code...]
View 6 Replies
May 31, 2012
I have applied your code to print all pages of grid view, and it is throwing an exception that grid view control must be placed in Form tag with runat=server, my gridview control is already in Form tag with runat=server,
Then I tried to override VerifyRenderingInServerForm even as you explianed, i am using asp.net 2.0, when i write
publicoverridevoid VerifyRenderingInServerForm(Control control) {
/* Verifies that the control is rendered */
}
It gives an error that no suitable method found for override...
View 1 Replies