sharp-architecture

A storage mechanism has already been configured for this application

匆匆过客 提交于 2021-02-08 13:27:04
问题 I am getting this error whenever my S#arp Architecture attempts to start and this is an problem with SQL Server (for example: SQL Server is not runing), after I start SQL Server and hit refresh, I get this error: A storage mechanism has already been configured for this application 回答1: Try to add this line before calling NHibernateSession.Init() to clear any previous initiation. try{ NHibernateSession.Reset(); } catch { } 回答2: NHibernateSession.Init() or InitStorage() is being called more

Using SharpArchitecture's NHibernateSession in conjunction with a different thread

若如初见. 提交于 2020-01-13 05:08:52
问题 I'm using SharpArchitecture in an ASP.NET MVC 3 application. Everything works wonderfully. Using SharpArchitecture's NHibernateInitializer to initialize a new Session per request like so: protected void Application_BeginRequest(object sender, EventArgs e) { NHibernateInitializer.Instance().InitializeNHibernateOnce(InitializeNHibernateSession); } private void InitializeNHibernateSession(ISessionStorage sessionStorage) { NHibernateSession.ConfigurationCache = new

Using SharpArchitecture's NHibernateSession in conjunction with a different thread

痴心易碎 提交于 2020-01-13 05:08:11
问题 I'm using SharpArchitecture in an ASP.NET MVC 3 application. Everything works wonderfully. Using SharpArchitecture's NHibernateInitializer to initialize a new Session per request like so: protected void Application_BeginRequest(object sender, EventArgs e) { NHibernateInitializer.Instance().InitializeNHibernateOnce(InitializeNHibernateSession); } private void InitializeNHibernateSession(ISessionStorage sessionStorage) { NHibernateSession.ConfigurationCache = new

T4 for Sharp Architecture/Northwind Problem

。_饼干妹妹 提交于 2019-12-18 19:45:11
问题 I have just downloaded sharparchitecture/Northwind and i'm trying to get crud scaffolding to work. I have changed nothing except adding missing reference to this class library. I try to run ScaffoldingGeneratorCommand.tt and I hit following 3 errors. Error 1 Compiling transformation: Invalid token 'this' in class, struct, or interface member declaration file:BaseTemplate.tt Error 2 Compiling transformation: Class, struct, or interface method must have a return type file:BaseTemplate.tt Error

ASP.NET MVC3 and Windows Auth on IIS keeps redirecting to /Account/Login

瘦欲@ 提交于 2019-12-17 05:38:43
问题 I'm running MVC3 and a windows auth web application. When I deploy to IIS6 it runs great until I hit a page that requires authentication. It then is auto-redirecting to /Account/Login when I have no trace of that in my application and my web.config is configured to windows auth. Any ideas? Here is my entire web.config file: http://pastie.org/1568510 回答1: Check whether you have WebMatrix.Data.dll and/or WebMatrix.WebData.dll deployed in the bin directory of your application. If they are there

DropDownListFor Not Displaying/Persisting Null for First Choice in List

喜欢而已 提交于 2019-12-11 07:44:12
问题 I have an MVC app via SharpArch. In the view I have: Html.DropDownListFor(x => x.Location, new SelectList(Model.PossibleLocations, "Id", "Address"), "-- No Location --") I have 2 issues. The Dropdown is not getting updated when the view gets bound to the model. A selection gets persisted correctly except when I try the top "no location". I was able to take care of the first point by changing x.Location to x.Location.Id but then I had other issues. I can find plenty of examples for

T4 for Sharp Architecture/Northwind Problem

让人想犯罪 __ 提交于 2019-11-30 18:41:24
I have just downloaded sharparchitecture/Northwind and i'm trying to get crud scaffolding to work. I have changed nothing except adding missing reference to this class library. I try to run ScaffoldingGeneratorCommand.tt and I hit following 3 errors. Error 1 Compiling transformation: Invalid token 'this' in class, struct, or interface member declaration file:BaseTemplate.tt Error 2 Compiling transformation: Class, struct, or interface method must have a return type file:BaseTemplate.tt Error 3 Compiling transformation: Type expected file:BaseTemplate.tt Compiler says they occur in the first

Override for fluent NHibernate for long text strings nvarchar(MAX) not nvarchar(255)

℡╲_俬逩灬. 提交于 2019-11-28 07:58:51
When ever you set a string value in fluent NHibernate it alwasy sets the DB vales to Nvarchar(255), I need to store quite a lot of long string which are based on user inputs and 255 is impractical. Just to add this is an issue with the automapper as I am using fluent NHibernate to build the database. Lachlan Roche Adding this convention will set the default length for string properties to 10000. As others have noted, this will be a nvarchar(max) column. public class StringColumnLengthConvention : IPropertyConvention, IPropertyConventionAcceptance { public void Accept(IAcceptanceCriteria

Override for fluent NHibernate for long text strings nvarchar(MAX) not nvarchar(255)

半腔热情 提交于 2019-11-27 02:02:30
问题 When ever you set a string value in fluent NHibernate it alwasy sets the DB vales to Nvarchar(255), I need to store quite a lot of long string which are based on user inputs and 255 is impractical. Just to add this is an issue with the automapper as I am using fluent NHibernate to build the database. 回答1: Adding this convention will set the default length for string properties to 10000. As others have noted, this will be a nvarchar(max) column. public class StringColumnLengthConvention :

ASP.NET MVC3 and Windows Auth on IIS keeps redirecting to /Account/Login

梦想的初衷 提交于 2019-11-26 21:32:50
I'm running MVC3 and a windows auth web application. When I deploy to IIS6 it runs great until I hit a page that requires authentication. It then is auto-redirecting to /Account/Login when I have no trace of that in my application and my web.config is configured to windows auth. Any ideas? Here is my entire web.config file: http://pastie.org/1568510 Check whether you have WebMatrix.Data.dll and/or WebMatrix.WebData.dll deployed in the bin directory of your application. If they are there (and you know you don't use them) then try removing them and accessing a page that requires authentication.