Hangfire Job throws - System.TypeLoadException - hangfire

I have used Hangfire (1.6.17) on .net core application for scheduling and recurring jobs…it works fine for 2 3 job en-queued but when it get more than 2 or 3 jobs at same time to be execute, some job gets failed and some goes in retry section and some of them gets success.
Exception
Failed
Can not change the state to ‘Enqueued’: target method was not found.
System.TypeLoadException
Could not load type ‘MyApp.Repository.AsyncScrumRepository.AsyncScrumRepository’ from assembly ‘MyApp.Repository, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null’.
System.TypeLoadException: Could not load type ‘MyApp.Repository.AsyncScrumRepository.AsyncScrumRepository’ from assembly ‘MyApp.Repository, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null’.
at System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMarkHandle stackMark, IntPtr pPrivHostBinder, Boolean loadTypeFromPartialName, ObjectHandleOnStack type, ObjectHandleOnStack keepalive)
at System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean loadTypeFromPartialName)
at System.RuntimeType.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark)
at System.Type.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase)
at Hangfire.Storage.InvocationData.Deserialize()
When I manually triggered that failed and retry section job via UI Dashboard, by 1 or 2 trigger, all job gets success. I am using this in production server and didn’t expect this kind of issue and now I have to trigger jobs in my production manually.
Here is the screenshot of exception
I have searched the Git and blog discussion
github issue 430
same issue
related issue
I have updated my application - Having same version of Hangfire in every project of solution, every dependent method to be called from Hangfire job are now public method and having specific queue name for my jobs.

Related

convert system date to timestamp format [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 5 months ago.
Improve this question
I want to pass timestampe to third party server from sysdate. Below is the required format suppose to send as timedate.
2022-09-23T15:38:47.6927242-05:00
I have tried using below to get timestampe
select systimestamp from dual
While i pass this to payload i am getting below error
The server encountered an error processing the request. Please see the <a rel="help-page" href="https://ws.aramex.net/ShippingAPI.V2/Shipping/Service_1_0.svc/Xml/help">service help page</a> for constructing valid requests to the service. The exception message is 'The formatter threw an exception while trying to deserialize the message: There was an error while trying to deserialize parameter http://ws.aramex.net/ShippingAPI/v1/:Shipments. The InnerException message was 'There was an error deserializing the object of type System.Collections.Generic.List`1[[Corp.ShippingAPI.FrontEnd.Contracts.Shipment, Corp.ShippingAPI.FrontEnd.Contracts, Version=1.287.0.0, Culture=neutral, PublicKeyToken=null]]. The value '' cannot be parsed as the type 'DateTime'.'. Please see InnerException for more details.'. See server logs for more details. The exception stack trace is: </p>
<p> at System.ServiceModel.Dispatcher.DataContractSerializerOperationFormatter.DeserializeParameterPart(XmlDictionaryReader reader, PartInfo part, Boolean isRequest)
at System.ServiceModel.Dispatcher.DataContractSerializerOperationFormatter.DeserializeParameters(XmlDictionaryReader reader, PartInfo[] parts, Object[] parameters, Boolean isRequest)
at System.ServiceModel.Dispatcher.DataContractSerializerOperationFormatter.DeserializeBody(XmlDictionaryReader reader, MessageVersion version, String action, MessageDescription messageDescription, Object[] parameters, Boolean isRequest)
at System.ServiceModel.Dispatcher.OperationFormatter.DeserializeBodyContents(Message message, Object[] parameters, Boolean isRequest)
at System.ServiceModel.Dispatcher.OperationFormatter.DeserializeRequest(Message message, Object[] parameters)
at System.ServiceModel.Dispatcher.DemultiplexingDispatchMessageFormatter.DeserializeRequest(Message message, Object[] parameters)
at System.ServiceModel.Dispatcher.UriTemplateDispatchFormatter.DeserializeRequest(Message message, Object[] parameters)
at System.ServiceModel.Dispatcher.DispatchOperationRuntime.DeserializeInputs(MessageRpc& rpc)
at System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc& rpc)
at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(MessageRpc& rpc)
at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage11(MessageRpc& rpc)
at System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContext
If you have to pass such a format, then format value returned by the SYSTIMESTAMP function.
For example:
SQL> select to_char(systimestamp,'yyyy-mm-dd"T"hh24:mi:ss:ff7TZR') val from dual;
VAL
-------------------------------------------------------------
2022-09-23T13:15:53:7027320+02:00
SQL>

Sitecore Core database index Update issue

We are using a multi server environment with 1 CMS and 2 CD configuration. The CORE and WEB of CMS are being shared by CD 2 only and CD 1 as its own web and core.
The issue is- log files of CD2 are capturing the below mentioned error:
ManagedPoolThread #14 00:00:05 INFO Job started:Index_Update_IndexName=sitecore_core_index
ManagedPoolThread #14 00:00:05 ERROR Exception
Exception: System.Reflection.TargetInvocationException
Message: Exception has been thrown by the target of an invocation.
Source: mscorlib
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)
at (Object , Object[] )
at Sitecore.Pipelines.CorePipeline.Run(PipelineArgs args)
at Sitecore.Jobs.Job.ThreadEntry(Object state)
Nested Exception
Exception: System.InvalidOperationException
Message: Configuration
Source: Sitecore.ContentSearch.LuceneProvider
at Sitecore.ContentSearch.LuceneProvider.LuceneIndex.EnsureInitialized()
at Sitecore.ContentSearch.LuceneProvider.LuceneIndex.CreateUpdateContext()
at Sitecore.ContentSearch.LuceneProvider.LuceneIndex.PerformUpdate(IEnumerable`1 indexableUniqueIds, IndexingOptions indexingOptions)
As we researched, we found that this type of error gets captured when issue with Core database index update. Further this was also confirmed by crawling log and checking the configuration within the \App_Config\Include\Sitecore.ContentSearch.Lucene.Index.Core which has this job defined for Index update.
Crawling log entries getting captured
INFO [Index=sitecore_core_index] IntervalAsynchronousUpdateStrategy executing.
INFO [Index=sitecore_core_index] Event Queue is forced
As a next step we took following steps but problem still exist:
Deleted old Core indexes and rebuilt for CMS and CD2 both.
My Questions:
If we have same core for CMS and CD2 then do we require index rebuilt for both environment because as per my info the index get saved in disk.
Secondly we are facing caching issue for CD2 only, is this related to index update.
Thirdly the config details Sitecore.ContentSearch.Lucene.Index.Core are present in CMS and CD2 also so is this responsible for these exception as two processs are updating indexes for the same Core indexes.
Lastly we have a separate core and web for CD1 with replication enabled but we still see these error being captured in CD1 as well. We are seeing this errors from past few months and recently the frequency of errors has increased due to which it is eating a huge chunk of physical memory in CD2 and causing application higher response time.
I figured out what the problem in my environment was. Look in your log file and before you seeing that exeption, do you see the following:
ManagedPoolThread #11 10:07:24 INFO Loading Dictionary from database. Domain: 'Dictionary'. Language: 'en'.
ManagedPoolThread #11 10:07:24 ERROR Error saving {sitecore file path}\Website\temp\dictionary.dat.
Exception: System.IO.IOException
Message: The file '{sitecore file path}\Website\temp\dictionary.dat' already exists.
Source: mscorlib
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize)
at Sitecore.Globalization.Translate.Save()
If so, delete that and restart your site. This should fix the issue that you are seeing.

RavenDB connection issues

We have seen a noticeable uptick in problems related to RavenDB connections. We're using the IIS server connection method.
I've checked the index errors and I don't see anything listed.
This server is replicated with a MySQL server and there is one error related to replication in the log from today. Could the client stack trace errors actually be coming from the replicated server and not Raven?
EDIT
The client in this case is a single job that runs a few hundred times a day...succeeding many of those times but increasing in failures due to these errors.
Sql Replication failure to replication
Here are the partial stack trace errors from the client log:
[WebException: Unable to connect to the remote server]
System.Net.HttpWebRequest.GetRequestStream(TransportContext& context):367
System.Net.HttpWebRequest.GetRequestStream():3
Raven.Abstractions.Connection.HttpRequestHelper.WriteDataToRequest(HttpWebRequest req, String data, Boolean disableCompression):7
Raven.Client.Connection.ServerClient.DirectBatch(IEnumerable`1 commandDatas, String operationUrl):171
Raven.Client.Connection.ReplicationInformer.TryOperation[T](Func`2 operation, String operationUrl, Boolean avoidThrowing, T& result, Boolean& wasTimeout):35
Raven.Client.Connection.ReplicationInformer.ExecuteWithReplication[T](String method, String primaryUrl, Int32 currentRequest, Int32 currentReadStripingBase, Func`2 operation):169
Raven.Client.Connection.ServerClient.ExecuteWithReplication[T](String method, Func`2 operation):33
Raven.Client.Document.DocumentSession.SaveChanges():65
and
[WebException: Unable to connect to the remote server]
System.Net.HttpWebRequest.GetResponse():570
Raven.Client.Connection.HttpJsonRequest.ReadJsonInternal(Func`1 getResponse):45
Raven.Client.Connection.HttpJsonRequest.ReadResponseJson():206
Raven.Client.Connection.ServerClient.DirectGet(String[] ids, String operationUrl, String[] includes, String transformer, Dictionary`2 queryInputs, Boolean metadataOnly):631
Raven.Client.Connection.ServerClient+<>c__DisplayClass77.<Get>b__76(String u):51
Raven.Client.Connection.ReplicationInformer.TryOperation[T](Func`2 operation, String operationUrl, Boolean avoidThrowing, T& result, Boolean& wasTimeout):35
Raven.Client.Connection.ReplicationInformer.ExecuteWithReplication[T](String method, String primaryUrl, Int32 currentRequest, Int32 currentReadStripingBase, Func`2 operation):169
Raven.Client.Connection.ServerClient.ExecuteWithReplication[T](String method, Func`2 operation):33
Raven.Client.Document.HiLoKeyGenerator.GetDocument(IDatabaseCommands databaseCommands):41
Raven.Client.Document.HiLoKeyGenerator.GetNextRange(IDatabaseCommands databaseCommands):109
Raven.Client.Document.HiLoKeyGenerator.NextId(IDatabaseCommands commands):58
Raven.Client.Document.HiLoKeyGenerator.GenerateDocumentKey(IDatabaseCommands databaseCommands, DocumentConvention convention, Object entity):9
Raven.Client.Document.MultiTypeHiLoKeyGenerator.GenerateDocumentKey(IDatabaseCommands databaseCommands, DocumentConvention conventions, Object entity):174
Raven.Client.Document.DocumentStore+<>c__DisplayClass4.<Initialize>b__2(String dbName, IDatabaseCommands databaseCommands, Object entity):20
Raven.Client.Document.DocumentConvention.GenerateDocumentKey(String dbName, IDatabaseCommands databaseCommands, Object entity):164
Raven.Client.Document.GenerateEntityIdOnTheClient.GenerateDocumentKeyForStorage(Object entity):46
Raven.Client.Document.InMemoryDocumentSessionOperations.StoreInternal(Object entity, Etag etag, String id, Boolean forceConcurrencyCheck):79
Raven.Client.Document.InMemoryDocumentSessionOperations.Store(Object entity):23
The error says the client cannot connect to the the server. Maybe the client is offline. Or the server is. Or a firewall is in the way. Or maybe the server is there but blows up before returning a response to the client. If the issue is intermittent, and users arent complaining, it's probably just a connectivity thing that you can ignore. If users are complaining, you should look in server-side logs.

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

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

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