All Questions
Tagged with enterprise-library asp.net-mvc
43 questions
1
vote
1
answer
879
views
Use ASP.NET MVC Unity for Data Caching
I have a ASP.Net MVC project running on .NET 4.6.1 Framework.
I have recently added Unity.Mvc 5 IoC framework for dependency injection
In order to have flexibility for unit testing and other, I moved ...
0
votes
0
answers
197
views
Prevent errors, warnings from being logged to event viewer
I would like to stop writing logs (error, warning) to event viewer. I am already using EnterpriseLibrary.Logging to Rolling Flat file.
But want to stop to write to event log. Is there any ...
0
votes
1
answer
40
views
How do i find which config file is read when using EnterpriseLibraryContainer.Current.GetInstance<SqlDatabase>(connectionName)?
This line SqlDatabase sqlDatabase = EnterpriseLibraryContainer.Current.GetInstance<SqlDatabase>(connectionName);
in my application is used to retrieve connection string from config file but the ...
4
votes
1
answer
6k
views
Migrate Enterprise Library 5 to 6
Trying to move from Enterprise Library 5.0 to 6.0, I ran into some troubles. Maybe this will help others.
Following configuration is an example for (silent) exception logging to database:
<...
0
votes
1
answer
684
views
Execute stored procedure for viewmodel class returntype
i am trying to write some code in mvc to get the userdata by id. Here i am using Viewmodel class that contains all the parameters as Database table. and i am using enterprise library to execute the ...
2
votes
1
answer
3k
views
Enterprise Library Logging Block Rolling Flat File Not Writing to File
I'm implementing a multi-tier web solution using ASP.NET MVC 5 for the web stack and WebApi 2.2 for the back end services stack. These will be on different servers when deployed, but running in two ...
0
votes
1
answer
2k
views
What does Database.AddInParameter() method do?
I was debugging datahandler for an mvc4 application, and I came across the
AddInParameter(DbCommand, String, DbType);
and I looked for the same in MSDN, but there its mentioned as retired ...
0
votes
1
answer
1k
views
Enterprise Library Logging isn't log on SQL
I'm using EntLib 6 in order to log one webapp. Because I'm using n-layers, I wanted to put the logging in one library, accessible from all layers.
I'm trying to run the logging but nothing happens, ...
1
vote
2
answers
346
views
Model state invalid when using custom RegexAttribute
Regex not working in code but works in tool:
\+?\(?([0-9]{2})\)?([ .-]?)([0-9]{4})\2([0-9]{4})
This regex is used in Custom Attribute in MVC application. Where it always invalidate the model. While ...
6
votes
2
answers
2k
views
Enterprise Library Logging - Remove hyphen from format
I'm using Enterprise Library Logging block in a ASP.NET MVC application. When I write the log message in a text file it always adds 2 rows of hyphens before and after the message:
--------------------...
0
votes
1
answer
382
views
(Microsoft.Practices.EnterpriseLibrary.SemanticLogging) Injection EventSource in SqlDatabaseLog.EnableEvents
I have just recently added Microsoft.Practices.EnterpriseLibrary.SemanticLogging (v6) with SqlServer silk in my MVC 4 application.
var sqlListener = SqlDatabaseLog.CreateListener("SampleEventLogger",...
0
votes
1
answer
263
views
AppDomainName customization with Enterprise Library on an ASP.Net MVC App
I been using Microsoft’s Enterprise Library for Logging. I want to be able to query the Log table based on the AppDomainName, which is not a problem on executables as they log the AssemblyName as the ...
1
vote
2
answers
2k
views
How to make sure that Enterprise library Logger.Write() worked?
I am using Enterprise library 5.0 for Logging mechanism. I am using flat file and DB listeners. I want to make sure that the errors were logged into the db and in case some error occurred while doing ...
1
vote
0
answers
185
views
How to use from EnterpriseLibrary Validation Instead DataAnnotations Attribiute in mvc ajax form?
I have a model like this
using Microsoft.Practices.EnterpriseLibrary.Validation;
using Microsoft.Practices.EnterpriseLibrary.Validation.Validators;
namespace MvcValidationTest.Models
{
public ...
0
votes
1
answer
478
views
asp.net mvc3 how to set connection string for enterprise library
I am trying to learn mvc3/4 by trying to build my current project. How do you set the connection string for enterprise library? I have downloaded the libraries and added as reference. But I dont know ...
0
votes
1
answer
259
views
Validation Application Block with ASP.NET MVC4 applications
I want to use the Enterprise Library Validation Application Block with my ASP.NET MVC4 application. Which version of Enterprise Library is recommended?
Can anyone provide an example of XML ...
0
votes
1
answer
322
views
how to combine PolicyInjection.Create and UnityContainer.RegisterType?
My web application uses UnityContainer.
I want to add Policy injection.
How can I use both of them side by side?
meaning who should be responsible of the types registration?
policy injsection:
...
0
votes
0
answers
57
views
enterprise library causes slowness?
I have added Enterprise Libarary cache to my web application.
My web-services becomes really slow after few hundreds of requests (simulated with fiddler).
after a few hours the performance is good ...
0
votes
1
answer
402
views
http.cache vs. EnterpriseLibrary.cache
I want to refactor some existing code.
A controller with two actions.
Each action calls a repository which is layered on top of a StronglyTyped enterpriseLibrary cache manager.
The repository tries ...
3
votes
5
answers
4k
views
Enterprise Library Validation - Allow Nulls but verify other properties?
I have a list of properties setup in a class on a property that looks like:
[ValidatorComposition(CompositionType.Or, Ruleset = "BillingEmail", MessageTemplate = Constants.ERROR_INVALID_EMAILADDRESS)]...
0
votes
1
answer
372
views
Has anybody used Ninject and the MS Enterprise Caching application block?
I am putting together a reporting service based on a very slow connection to a backing (dare I say legacy) data store. The only access I have to the data store is via a web services SDK written in ...
0
votes
1
answer
825
views
SqlClient login fail when trying to connect to database
This is so weird. Ok here's my connection string in the web.config of my MVC 4 project:
Here is the connection string in my Unit Test Project's App.Config file:
<add name="ConnectionString" ...
1
vote
2
answers
1k
views
Integrate ASP.NET MVC validation with Enterprise Library validation
I am already using Enterprise Library 5 Validation for my model (which is used also in WCF methods), so I decided that I would like to avoid redundant validators from ASP.NET 4 MVC with ...
0
votes
2
answers
526
views
Validation Application Block - How to use validation metada class
I'm using VAB to validate some classes with attributes and I'm using a metadata class to share the same validation among different classes.
When i try to validate an object in the controller (btw i'm ...
1
vote
1
answer
90
views
Enterprise Library slidingExpirationTime
My web application uses enterprise library caching module. I've a config value below for Enterprise Library 4.0.
<cacheOptions>
<add name="Cache" cachePartition="Content" ...
0
votes
1
answer
739
views
Self validation using enterprise library, on ASP.MVC & WCF
I have an asp.mvc based website, that calls an app server using WCF. The controller receives a request as follows:
[HttpPost]
public ActionResult foo(MyClass mc)
{
using (var client = new ...
0
votes
1
answer
1k
views
Logging with EntLib Policy Injection Block + StructureMap + log4net
I'm trying to add logging through AOP in an ASP.NET MVC application using:
Enterprise Library Policy Injection application Block
StructureMap
log4net
This is what I have:
web.config
<...
4
votes
4
answers
3k
views
Exception management in an ASP.NET MVC Application using Enterprise Library [closed]
I need some information about best practices in exception management. Not how to code it, there is plenty of information about that, but more like what to do with it in different layers (we have MVC ...
1
vote
5
answers
992
views
Logging good/proven practices - EntLib
I'm currently working on logging for our enterprise application. We (team) agreed on using Enterprise library. And i would need to do some document on this topic, but I'm quite newbie and it's quite ...
0
votes
1
answer
691
views
Using Unity.BuildUp in one class breaks injection in other class
I've got a membership provider that creates a problem with dependency injection. I would like to understand why it happens.
This is some parts of a base controller. (It works like it should.)
...
2
votes
2
answers
524
views
Can MVC UpdateModel use Enterprise Library VAB?
...or should I say, what's the cleanest way to use Enterprise Library 5 VAB with MVC?
I currently use the form:
ActionResult Save(int id, FormCollection form)
{
SomeModel model = somehowgetbyid(...
0
votes
1
answer
2k
views
How can I log both the Request.InputStream and Response.OutputStream traffic in my ASP.NET MVC3 Application for specific Actions?
For a specific set of Actions I am required to log the incoming Requests InputStream as well as the outgoing Response.OutputStream.
I envision using an ActionFilterAttribute for this and overriding ...
1
vote
1
answer
2k
views
Could not load EnterpriseLibrary assemblies when rendering view in MVC application
When rendering a view in an ASP.NET MVC application, I am getting the following Yellow Screen of Death. It will occur only once during the server lifecycle, subsequent renders work fine. I don't have ...
11
votes
1
answer
4k
views
When to use ExternallyControlledLifetimeManager?
I was going through different LifetimeManagers available in Unity and was wondering when will we use ExternallyControlledLifetimeManager? Can somebody give me an real life example? The MSDN doc says "...
4
votes
3
answers
11k
views
Enable/Disable Enterprise Library logging on production
On my production, I don't want to have log entry with severity Verbose (or Debug). I need only the info, error etc. What is the right method to enable and disable logging (the debug entries)?
I did ...
0
votes
2
answers
3k
views
Entity Framework + Unity Framework
I beginning a new project and I need to create a Project for implementing Entity Framework 4.0 and Unity Framework 2.0 along with Enterprise Library 5.0.
I am very new to Entity Framework and Unity ...
0
votes
1
answer
207
views
Making validation part of application settings
I am looking for examples of configuration based validation using Validation Application Block. I've found this
I want to ask if someone has an alternative solution to using EL VAB 5.0 to achieve ...
0
votes
2
answers
280
views
enterprise library VAB Implementation issues
I have an issue with the implementation of VAB. We are using ASP.NET MVC 1.0
I have a property "First Name" and we want to have 2 validations.
Not Null Validator
RegEx Validator (to stop some ...
1
vote
1
answer
834
views
Can you have a log file per user with Enterprise Library 5 in Asp.net Mvc 2?
There were 2 solutions suggested so far Environment variables using %username% in the filename section, and low level unmanaged code to accomplish it. Environment variables would be susceptible to ...
1
vote
2
answers
709
views
SelfValidation in DataAnnotations?
With Validation Application block, there's the following functionality:
Creating Custom attributes
Creating SelfValidation on the type
Ability to read from external config file
I plan to use the ...
7
votes
1
answer
47k
views
"Could not load file or assembly 'Microsoft.Practices.EnterpriseLibrary.Validation" exception
I am currently getting the following exception while trying to use the Enterprise Library Validation Application Block:
An error occurred creating the configuration section handler for validation: ...
1
vote
0
answers
907
views
How to log WCF exception shielding's {Guid} in client
I'm using WCF Exception Shielding to map various exceptions to FaultContracts so I can limit what information I expose to the client. I had hoped to leverage the {Guid} mapping property so I could ...
0
votes
2
answers
1k
views
Policy Injection with ASP.NET MVC Controllers
I'm running into an issue with the Policy Injection Application Block from Enterprise Library in conjunction with ASP.NET MVC.
In my ControllerFactory, I'm creating the controller and then calling ...