MissingMethodException: Method not found: 'System.Delegate System.Reflection.MethodInfo.CreateDelegate(System.Type)' - orm

I am getting missing method exception in Sitecore while using Glass mapper.
This is working in Sitecore 7 project but when I tried to use same in Sitecore 6.6 project it fails.
I am not getting that how to find what is the problem in underlying method invocation going on.
I guess this may be due to .net framework version difference in Sitecore 6.6 and Sitecore 7.0
I am using Glass.Mapper.Sc.CastleWindsor nuget package version 3.0.3.7
[MissingMethodException: Method not found: 'System.Delegate System.Reflection.MethodInfo.CreateDelegate(System.Type)'.]
Glass.Mapper.Utilities.CreateConstructorDelegates(Type type) +0
Glass.Mapper.Pipelines.ConfigurationResolver.Tasks.OnDemandResolver.OnDemandLoader`1.Load() +102
System.Linq.WhereSelectArrayIterator`2.MoveNext() +110
System.Linq.Enumerable.Aggregate(IEnumerable`1 source, Func`3 func) +123
Glass.Mapper.Context.Load(IConfigurationLoader[] loaders) +284
Glass.Mapper.Pipelines.ConfigurationResolver.Tasks.OnDemandResolver.ConfigurationOnDemandResolverTask`1.Execute(ConfigurationResolverArgs args) +155
Glass.Mapper.Pipelines.AbstractPipelineRunner`2.Run(T args) +210
Glass.Mapper.AbstractService.InstantiateObject(AbstractTypeCreationContext abstractTypeCreationContext) +77
Glass.Mapper.Sc.SitecoreService.CreateType(Type type, Item item, Boolean isLazy, Boolean inferType, Object[] constructorParameters) +297
Glass.Mapper.Sc.SitecoreService.CreateType(Item item, Boolean isLazy, Boolean inferType) +109
Glass.Mapper.Sc.Web.Ui.GlassUserControl`1.GetModel() +147
Glass.Mapper.Sc.Web.Ui.GlassUserControl`1.OnLoad(EventArgs e) +28
System.Web.UI.Control.LoadRecursive() +71
System.Web.UI.Control.LoadRecursive() +190
System.Web.UI.Control.LoadRecursive() +190
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3048
Also I am not able to find complete source anywhere for Glass mapper.

It's your .NET framework version. Am guessing your Sitecore 7 runs as .NET 4.5 and your 6.6 solution on something lower.
Recent builds of 6.6 (as of atleast 130404) support .NET Framework Version 4.5
System.Delegate System.Reflection.MethodInfo.CreateDelegate(System.Type)
http://sdn.sitecore.net/Products/Sitecore%20V5/Sitecore%20CMS%206/ReleaseNotes/ChangeLog/Release%20History%20SC66.aspx#660update6

Related

Cannot setup Windows Authentication without a valid commercial license

NServiceBus 3+ uses RavenDB for persistence by default. Several articles (this, this and this) mention that as long as RavenDB is used only to store NServiceBus data (Subscription, Saga, Timeouts), NServiceBus license is enough and separate RavenDB license is not required. However, the current version of RavenDB (Build 2700) doesn't allow the authentication to be setup on the server and throws below error (Cannot setup Windows Authentication without a valid commercial license). Does this mean that we can no longer use RavenDB (at least the latest version) with NServiceBus without a separate license? This works fine at least until build 2380. That is when the version is changed from v2.0 to v2.5. Using persistence without authentication is not an option as while Subscription and Timeouts are NServiceBus specific data, sagas can and do contain sensitive data that cannot be allowed to be accessible via http to everyone (even within LAN). Buying a license for RavenDB is not that big an issue but so far we understood that we only need NServiceBus license as long as RavenDB is not used for anything other than NServiceBus data. It would be great to get a clarification on this from NServiceBus or RavenDB team.
Server Error:
-----------------------------------------
/bulk_docs
Raven.Abstractions.Exceptions.OperationVetoedException: PUT vetoed by Raven.Database.Server.Security.Triggers.WindowsAuthPutTrigger because: Cannot setup Windows Authentication without a valid commercial license.
at Raven.Database.DocumentDatabase.AssertPutOperationNotVetoed(String key, RavenJObject metadata, RavenJObject document, TransactionInformation transactionInformation) in c:\Builds\RavenDB-Stable\Raven.Database\DocumentDatabase.cs:line 931
at Raven.Database.DocumentDatabase.<>c__DisplayClass4b.<Put>b__43(IStorageActionsAccessor actions) in c:\Builds\RavenDB-Stable\Raven.Database\DocumentDatabase.cs:line 779
at Raven.Storage.Esent.TransactionalStorage.Batch(Action`1 action) in c:\Builds\RavenDB-Stable\Raven.Database\Storage\Esent\TransactionalStorage.cs:line 605
at Raven.Database.DocumentDatabase.Put(String key, Etag etag, RavenJObject document, RavenJObject metadata, TransactionInformation transactionInformation) in c:\Builds\RavenDB-Stable\Raven.Database\DocumentDatabase.cs:line 772
at Raven.Database.Extensions.CommandExtensions.Execute(ICommandData self, DocumentDatabase database, BatchResult batchResult) in c:\Builds\RavenDB-Stable\Raven.Database\Extensions\CommandExtensions.cs:line 50
at Raven.Database.Extensions.CommandExtensions.ExecuteBatch(ICommandData self, DocumentDatabase database) in c:\Builds\RavenDB-Stable\Raven.Database\Extensions\CommandExtensions.cs:line 23
at Raven.Database.DocumentDatabase.ProcessBatch(IList`1 commands) in c:\Builds\RavenDB-Stable\Raven.Database\DocumentDatabase.cs:line 2086
at Raven.Database.DocumentDatabase.<>c__DisplayClass107.<Batch>b__103(IStorageActionsAccessor actions) in c:\Builds\RavenDB-Stable\Raven.Database\DocumentDatabase.cs:line 2048
at Raven.Storage.Esent.TransactionalStorage.ExecuteBatch(Action`1 action, EsentTransactionContext transactionContext) in c:\Builds\RavenDB-Stable\Raven.Database\Storage\Esent\TransactionalStorage.cs:line 663
at Raven.Storage.Esent.TransactionalStorage.Batch(Action`1 action) in c:\Builds\RavenDB-Stable\Raven.Database\Storage\Esent\TransactionalStorage.cs:line 615
at Raven.Database.DocumentDatabase.Batch(IList`1 commands) in c:\Builds\RavenDB-Stable\Raven.Database\DocumentDatabase.cs:line 2046
at Raven.Database.Server.Responders.DocumentBatch.Batch(IHttpContext context) in c:\Builds\RavenDB-Stable\Raven.Database\Server\Responders\DocumentBatch.cs:line 124
at Raven.Database.Server.Responders.DocumentBatch.Respond(IHttpContext context) in c:\Builds\RavenDB-Stable\Raven.Database\Server\Responders\DocumentBatch.cs:line 41
at Raven.Database.Server.HttpServer.DispatchRequest(IHttpContext ctx) in c:\Builds\RavenDB-Stable\Raven.Database\Server\HttpServer.cs:line 782
at Raven.Database.Server.HttpServer.HandleActualRequest(IHttpContext ctx) in c:\Builds\RavenDB-Stable\Raven.Database\Server\HttpServer.cs:line 645
-----------------------------------------
at Raven.Studio.Infrastructure.InvocationExtensions.Catch(Task parent, Func`2 func)
at Raven.Studio.Infrastructure.InvocationExtensions.Catch(Task parent, Action`1 action)
at Raven.Studio.Infrastructure.InvocationExtensions.Catch(Task parent)
at Raven.Studio.Infrastructure.Command.Execute(Object parameter)
at System.Windows.Controls.Primitives.ButtonBase.ExecuteCommand()
at System.Windows.Controls.Primitives.ButtonBase.OnClick()
at System.Windows.Controls.Button.OnClick()
at System.Windows.Controls.Primitives.ButtonBase.OnMouseLeftButtonUp(MouseButtonEventArgs e)
at System.Windows.Controls.Control.OnMouseLeftButtonUp(Control ctrl, EventArgs e)
at MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr unmanagedObjArgs, Int32 argsTypeIndex, Int32 actualArgsTypeIndex, String eventName, UInt32 flags)
Client side exception:
System.Net.WebException: [HttpWebRequest_WebException_RemoteServer]
Arguments: NotFound
Debugging resource strings are unavailable. Often the key and arguments provide sufficient information to diagnose the problem. See http://go.microsoft.com/fwlink/?linkid=106663&Version=5.1.20125.0&File=System.Windows.dll&Key=HttpWebRequest_WebException_RemoteServer
at System.Net.Browser.ClientHttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
at System.Func`2.Invoke(T arg)
at System.Threading.Tasks.TaskFactory`1.FromAsyncCoreLogic(IAsyncResult iar, Func`2 endFunction, Action`1 endAction, Task`1 promise)
Have you contacted NServiceBus support?
We will gladly send you a RavenDB license, just contact us!

VB.NET issue connecting to Oracle 11g

OS: Windows 7 64bit
VB: Visual Studio 2010
Oracle Client: 11g
I am developing an application that connects to an Oracle 11g server. I am able to connect to the Oracle server via Oracle SQL Developer, ODBC (in SYSWOW64), and in VB Server Explorer.
I am using the .NET reference Oracle.DataAccess located at: C:\Oracle\product\11.2.0\client_32\ODP.NET\bin\2.x\Oracle.DataAccess.dll
I have tried adding the .DLL files to my bin folder as suggested by other questions and that does not work.
Does anyone have any other suggestions?
When I run my application, I get the following:
Here are the details:
System.TypeInitializationException was unhandled
Message=The type initializer for 'Oracle.DataAccess.Client.OracleConnection' threw an exception.
Source=Oracle.DataAccess
TypeName=Oracle.DataAccess.Client.OracleConnection
StackTrace:
at Oracle.DataAccess.Client.OracleConnection..ctor(String connectionString)
at Orc_Test_1.Form1.Button1_Click(Object sender, EventArgs e) in c:\Visual Studio 2010\Projects\Orc_Test_1\Orc_Test_1\Form1.vb:line 9
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun()
at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel()
at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[] commandLine)
at Orc_Test_1.My.MyApplication.Main(String[] Args) in 17d14f5c-a337-4978-8281-53493378c1071.vb:line 81
at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
InnerException: Oracle.DataAccess.Client.OracleException
DataSource=""
ErrorCode=-2147467259
Message=The provider is not compatible with the version of Oracle client
Number=-11
Procedure=""
Source=Oracle Data Provider for .NET
StackTrace:
at Oracle.DataAccess.Client.OracleInit.Initialize()
at Oracle.DataAccess.Client.OracleConnection..cctor()
InnerException:
VB.NET Code:
Imports System.Data
Imports Oracle.DataAccess.Client ' ODP.NET Oracle managed provider
Imports Oracle.DataAccess.Types
Public Class Form1
Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
Dim oradb As String = "Data Source=SERVER1;Persist Security Info=True;User ID=username;Password=password;Unicode=True" 'From Server Explorer
'Dim oradb As String = "Data Source=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=Server1.host.net)(PORT=1522))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=Server1))); USER ID = username;Password = password;" 'From TNSnames.ora
Dim conn As New OracleConnection(oradb) '<--- Error happens on this line
conn.Open()
Dim cmd As New OracleCommand
cmd.Connection = conn
cmd.CommandText = "select system_id from schema1.system_impacted where system_name = AWESOME"
cmd.CommandType = CommandType.Text
Dim dr As OracleDataReader = cmd.ExecuteReader()
dr.Read()
Label1.Text = dr.Item("system_id")
conn.Dispose()
End Sub
End Class
I feel your pain, just went through something similar in a deployment situation. You probably have multiple clients installed, and your environment is pulling dlls for older releases (even if you have a latest oracle.dataaccess.dll correctly referenced in your project). Fixing this on your dev environment is one thing, a prod deployment server is another. Not sure what your deployment situation is, but here's what worked for me.
After struggling with trying to upgrade odp.net in existing oracle home, adding new oracle home, etc., I found the easiest way to fix everything is to download the latest odac with xcopy deployment from Oracle, and follow the readme (and see here for an older article on this also). Basically you'll run an install.bat file to setup locally (in separate folder, mine was c:\oracle_odac), then change your project reference to point to the oracle.dataaccess.dll in this new folder (I used 4 instead of 2.x), and add the new folder's bin dirs to front of your path (c:\oracle_odac\bin and c:\oracle_odac\odp.net\bin\4). On your deployment server, you'll just need to copy the entire c:\oracle_odac folder over (via xcopy or however), and setup the path.
That said, I anxiously await the production release of the fully managed odp.net from Oracle (in beta now).
EDIT: Just to add that you can avoid messing with PATHs if you setup in your app or web config file the dllpath. For example:
<configuration>
...
<configSections>
<section name="oracle.dataaccess.client" type="System.Data.Common.DbProviderConfigurationHandler, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
...
<oracle.dataaccess.client>
<settings>
<add name="DllPath" value="c:\oracle_odac\bin"/>
</settings>
</oracle.dataaccess.client>
...
This will override other settings such as registry or machine.config. And it will allow multiple odp.net configurations to exists peacefully, and allow each app to point to the version it needs on the same server.
Usually happens when you're building x64 application which is trying to pick up x32 drivers that doesn't really work.
What you do in this case (and it's quite painful):
Install x32 oracle client to oraclehome1
Install x64 oracle client to oraclehome2
Make sure your application build (x64, x32) is pointed to correct oraclehome. I don't have that code handy, but I believe it is something along the lines of "Home=oraclehome2" in the connection string or similar.
I removed all of the oracle clients that were available in the 'Programs' section of 'Control Panel'. Then I went into the registry searched for 'Oracle' and removed all instances/references of Oracle client(s). After 3 hours of registry removal and a reboot, I installed the 11g client and everything worked as expected.
Note: when searching the registry for "Oracle", there may be references to the VB version of Oracle, or a reference to Crytsal Reports driver for 'Oracle'. I did not remove these. So pay attention to the file location and/or the syntax of the registry item you are deleting.
/Reading. It works.
download ODAC 32/ ODAC 64 bit ,depending upon on the compatibility of OS, VS and oracle 11g .
Use oracle 11g 32,os 32 bit,oracle 32 bit or oracle 64 bit,os 64 bit and oracle 11g 64 bit.
In my experience, after trying tbone's suggestion, playing with PATH env variable and other unsuccessful plays, the solution that worked immediately was to save a copy of the 8 DLLs files listed below RIGHT ON THE SAME FOLDER of the vb.net executable, and then add a reference to Oracle.DataAccess.dll in the same folder.
C:\Users\Legarcia\Documents\Visual Studio 2010\Projects\LabRetention\LabRetention\bin\Debug>dir *.dll
Volume in drive C is OS
Volume Serial Number is 10EC-8C5D
Directory of C:\Users\Legarcia\Documents\Visual Studio 2010\Projects\LabRetention\LabRetention\bin\Debug
09/30/2008 07:57 PM 348,160 msvcr71.dll
10/01/2008 02:22 AM 520,192 oci.dll
10/01/2008 01:56 AM 352,256 ociw32.dll
08/12/2009 07:13 AM 1,011,712 Oracle.DataAccess.dll
09/18/2008 08:47 PM 1,130,496 orannzsbb11.dll
10/01/2008 01:48 AM 868,352 oraocci11.dll
10/01/2008 02:45 AM 117,604,352 oraociei11.dll
08/12/2009 07:21 AM 413,696 OraOps11w.dll
8 File(s) 122,249,216 bytes
0 Dir(s) 238,127,943,680 bytes free
When developing/testing/debuging, the set of DLLs is copied to ..\projects\{Your project}\bin\Debug
e.g.: [C:\Users\Legarcia\Documents\Visual Studio 2010\Projects\LabRetention\LabRetention\bin\Debug]
And when releasing the application for the users just copy the DLLs to the same dir of your EXE
This seems to isolate all other Ora client installations.
The connection string used in the VB.net app is created from the info in TNSNAMES.ORA file found on some other client directory.
Regards.
LE+

Ninject Runtime Exception occuring frequently - System.InvalidOperationException: Collection was modified; enumeration operation may not execute

I am using Ninject 2.2.1.0 with Ninject.Web 2.2.0.0 in a webforms application.
I am getting daily error reports of the following...
System.InvalidOperationException: Collection was modified; enumeration
operation may not execute.
at System.ThrowHelper.ThrowInvalidOperationException(ExceptionResource
resource)
at System.Collections.Generic.List1.Enumerator.MoveNextRare()
at System.Collections.Generic.List1.Enumerator.MoveNext()
at System.Linq.Enumerable.WhereSelectListIterator2.MoveNext()
at Ninject.Infrastructure.Language.ExtensionsForIEnumerableOfT.Map[T](IEnumerable1
series, Action`1 action) in
c:\Projects\Ninject\ninject\src\Ninject\Infrastructure\Language\ExtensionsForIEnumerableOfT.cs:line
22
at Ninject.OnePerRequestModule.DeactivateInstancesForCurrentHttpRequest()
in
c:\Projects\Ninject\ninject\src\Ninject\OnePerRequestModule.cs:line
63
at Ninject.OnePerRequestModule.b__0(Object
o, EventArgs e) in
c:\Projects\Ninject\ninject\src\Ninject\OnePerRequestModule.cs:line
36
at System.Web.HttpApplication.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep
step, Boolean& completedSynchronously)
Seems to be occuring at peak times. Is there a stable release with this patched yet?
Creation of kernel instances is not thread safe at the moment. This will probably be changed with 2.4

Could not find stored procedure 'dbo.aspnet_CheckSchemaVersion'

I am using WinHost.com to host my site. The SQL Database/membership system works perfectly on my local computer, but when uploaded to the server it doesn't work. I've followed all steps correctly. And I have contacted support for my service but it's been over 2weeks and no reply.
I keep getting this error when i try to login or register a new user on my membership page on my site.
Server Error in '/' Application.
--------------------------------------------------------------------------------
Could not find stored procedure 'dbo.aspnet_CheckSchemaVersion'.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Data.SqlClient.SqlException: Could not find stored procedure 'dbo.aspnet_CheckSchemaVersion'.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[SqlException (0x80131904): Could not find stored procedure 'dbo.aspnet_CheckSchemaVersion'.]
System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) +1953274
System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +4849707
System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +194
System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +2392
System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString) +204
System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async) +954
System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result) +162
System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe) +175
System.Data.SqlClient.SqlCommand.ExecuteNonQuery() +137
System.Web.Util.SecUtility.CheckSchemaVersion(ProviderBase provider, SqlConnection connection, String[] features, String version, Int32& schemaVersionCheck) +378
System.Web.Security.SqlMembershipProvider.CheckSchemaVersion(SqlConnection connection) +89
System.Web.Security.SqlMembershipProvider.GetPasswordWithFormat(String username, Boolean updateLastLoginActivityDate, Int32& status, String& password, Int32& passwordFormat, String& passwordSalt, Int32& failedPasswordAttemptCount, Int32& failedPasswordAnswerAttemptCount, Boolean& isApproved, DateTime& lastLoginDate, DateTime& lastActivityDate) +815
System.Web.Security.SqlMembershipProvider.CheckPassword(String username, String password, Boolean updateLastLoginActivityDate, Boolean failIfNotApproved, String& salt, Int32& passwordFormat) +105
System.Web.Security.SqlMembershipProvider.CheckPassword(String username, String password, Boolean updateLastLoginActivityDate, Boolean failIfNotApproved) +42
System.Web.Security.SqlMembershipProvider.ValidateUser(String username, String password) +78
System.Web.UI.WebControls.Login.AuthenticateUsingMembershipProvider(AuthenticateEventArgs e) +60
System.Web.UI.WebControls.Login.OnAuthenticate(AuthenticateEventArgs e) +119
System.Web.UI.WebControls.Login.AttemptLogin() +115
System.Web.UI.WebControls.Login.OnBubbleEvent(Object source, EventArgs e) +101
System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +37
System.Web.UI.WebControls.Button.OnCommand(CommandEventArgs e) +118
System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +166
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +36
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1565
--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.4200; ASP.NET Version:2.0.50727.4016
Can somebody please tell me why this error has occured (obviously it can't find something...), and how I can fix it?
Thank you all
Bael
Did you run aspnet_regsql.exe against WinHost.com's sql server?
aspnet_regsql.exe -S DBServerName -U DBLogin -P DBPassword -A all -d DBName
If you don't know where to run above command then you can simply run 'aspnet_regsql.exe' executable file.
In order to locate this file open your RUN Command Box by pressing Windows Key + r and put below command in that %windir%\Microsoft.NET\Framework\v4.0.30319 and Hit enter then find 'aspnet_regsql.exe' file. It will open a wizard that you can follow to resolve this error.
This error mostly occurs when you didn't enabled Roles in your asp.net mvc project At starting before aspnet identity table automatically created.
You will need to make sure you run this so that the tables and objects are created on WinHost.com's SQL server.
Open visual studio command prompt from the Visual studio tools folder from the start menu
and type
aspnet_regsql
and follow the wizard to register the database for asp.net membership and role providers.
I've seen this before. The database you are using doesn't have the required database elements for the membership, role management and profile features. So you've got a couple of options:
Copy across the tables, stored procedures & views from your local SQL Server using SQL Management Studio or a similar application
Use the aspnet_regsql.exe tool to install the scripts from anew as per the instructions in this post (I don't believe you can use the tool against a remote database if it's locked down. So you'll have to export the scripts and run them manually)
I have the same problem- i copy/paste connectionString from SQL Object manager in Visual Studio and forget to type Initial Catalog=YourDatabaseName.
Check the schema the stored procedure belongs to on your host - it could be that it's not in the "dbo" schema.
e.g.
if it's within SomeOtherSchema, your call would need to be "SomeOtherSchema.aspnet_CheckSchemaVersion"
I had the exact same error when I had enabled <roleManager> believing I was enabling ASP.NET Identity 2. They are not the same! The <roleManager> enabled an old version of identity management which uses a different table structure to ASP.NET Identity 2 (which doesn't need "enabling" by the way - it's just there).
If you are intentionally using the old role-manager and still getting the error you might be looking at the default localdb instead of your database, in which case you can modify <roleManager> to point at any connection string you want:
<roleManager
enabled="true"
cacheRolesInCookie="true"
defaultProvider="OurSqlRoleProvider"
>
<providers>
<add
connectionStringName="DefaultConnection"
applicationName="/"
name="OurSqlRoleProvider"
type="System.Web.Security.SqlRoleProvider" />
</providers>
</roleManager>
If you are are after using ASP.NET Identity 2, here's an article on it:
http://johnatten.com/2014/04/20/asp-net-mvc-and-identity-2-0-understanding-the-basics/
In short you should recompile the aspnet provider dll using the sql username you were assigned from your hosting.
Download the
http://download.microsoft.com/download/a/b/3/ab3c284b-dc9a-473d-b7e3-33bacfcc8e98/ProviderToolkitSamples.msi
Replace from the source code all the
references to dbo with your hosting
database username
Compile (you need Visual Studio) and
place the
ProviderToolkitSampleProviders.dll in
the Bin folder
In your web.config replace the "type"
attribute of every line with
“Microsoft.Samples.,
ProviderToolkitSampleProviders”
Replace in you local sql server all dbo references with your hosting database username
Export the sql object creation script and run them on the remote database
Copy the records from your local sql table aspnet_SchemaVersions to the remote database
Another option, pheraps simpler to try, is to replace the dbo references in your local sql server database with your hosting database username, then upload and attach your mdf file.
Hope it helps
Thomas
The simplest solution is to add to the web.config file
<modules>
<remove name="RoleManager" />
</modules>
As Gabriel McAdams mentioned, I used aspnet_regsql.exe but because I am using Integrated Security=True in the connection string I used different flags and also note that the -S flag refers to the SQL Server instance name (in my case localhost\SQLEXPRESS) instead of the server name:
C:\Windows\Microsoft.NET\Framework\v4.0.30319>aspnet_regsql -S DBInstanceName -E -A all -d DBName

Problems with Castle DynamicProxy2 on .Net 3.5 SP1 on Win2003 Server

I've an mvc + nh asp.net application. On my dev machine (win 7 Ent) all works fine, if deployed on a Win 2k3 (tried 2 different vm and one phisical machine) I got the following error..
anyone can help? Cannot explain this issue (tried the same build, so i think it'a machine configuration issue)..
Derived method 'set_ID' in type 'CustomerProxy75950979a2a048e889584c21696f7f1b' from assembly 'DynamicProxyGenAssembly2, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' cannot reduce access
[TypeLoadException: Derived method 'set_ID' in type 'CustomerProxy75950979a2a048e889584c21696f7f1b' from assembly 'DynamicProxyGenAssembly2, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' cannot reduce access.]
System.Reflection.Emit.TypeBuilder._TermCreateClass(Int32 handle, Module module) +0
System.Reflection.Emit.TypeBuilder.CreateTypeNoLock() +915
System.Reflection.Emit.TypeBuilder.CreateType() +108
Castle.DynamicProxy.Generators.Emitters.AbstractTypeEmitter.BuildType() +48
Castle.DynamicProxy.Generators.ClassProxyGenerator.GenerateCode(Type[] interfaces, ProxyGenerationOptions options) +3821
Castle.DynamicProxy.DefaultProxyBuilder.CreateClassProxy(Type classToProxy, Type[] additionalInterfacesToProxy, ProxyGenerationOptions options) +84
Castle.DynamicProxy.ProxyGenerator.CreateClassProxy(Type classToProxy, Type[] additionalInterfacesToProxy, ProxyGenerationOptions options, Object[] constructorArguments, IInterceptor[] interceptors) +92
Castle.DynamicProxy.ProxyGenerator.CreateClassProxy(Type classToProxy, Type[] additionalInterfacesToProxy, IInterceptor[] interceptors) +21
NHibernate.ByteCode.Castle.ProxyFactory.GetProxy(Object id, ISessionImplementor session) +283
found the issue. I had a duplicate property in my derived class (same as the base class defined with a template).
just had this error, and again this issue was having a duplicate property of id in my derived classes.