Skip to content

Instantly share code, notes, and snippets.

View robertgreiner's full-sized avatar

Robert Greiner robertgreiner

View GitHub Profile
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: Microsoft.IdentityModel.Tokens.AudienceUriValidationFailedException: ID1038: The AudienceRestrictionCondition was not valid because the specified Audience is not present in AudienceUris.
Audience: 'http://localhost:54012'
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:
@robertgreiner
robertgreiner / apply_migrations.ps1
Created May 10, 2012 17:50
Apply SQL Azure Migrations
Update-Database -StartUpProjectName "ToTheCloud.Infrastructure" -ConnectionString "Server=tcp:<server_name>.database.windows.net,1433;Database=<database_name>;User ID=<db_user_name>@<server_name>;Password=<password>;Trusted_Connection=False;Encrypt=True;MultipleActiveResultSets=True;Max Pool Size=100;" -ConnectionProviderName "System.Data.SqlClient"
@robertgreiner
robertgreiner / revert_migrations.ps1
Created May 10, 2012 17:49
Revert SQL Azure Migrations
Update-Database -TARGETMIGRATION:$InitialDatabase -StartUpProjectName "ToTheCloud.Infrastructure" -ConnectionString "Server=tcp:<server_name>.database.windows.net,1433;Database=<database_name>;User ID=<db_user_name>@<server_name>;Password=<password>;Trusted_Connection=False;Encrypt=True;MultipleActiveResultSets=True;Max Pool Size=100;" -ConnectionProviderName "System.Data.SqlClient"
<script src="https://gist.github.com/<gist_id>.js"> </script>
@robertgreiner
robertgreiner / post.html
Created April 23, 2012 20:06
Creating a Gist that looks good on your blog and is compatible with Google Reader
<p>
<script src="https://gist.github.com/<gist_id>.js"> </script>
<noscript>
<pre>
//Your code here
//Be sure you escape your tags with &lt; and &gt; when displaying things like HTML.
</pre>
</noscript>
</p>
@robertgreiner
robertgreiner / ServiceDefinition.csdef
Created April 19, 2012 21:58
Fixed! Change the taskType to simple and your local emulator role instances will start properly
<Startup>
<Task commandLine="Startup\IdentityGac.cmd" executionContext="elevated" taskType="background"></Task>
</Startup
@robertgreiner
robertgreiner / ServiceDefinition.csdef
Created April 19, 2012 21:57
Broken! The local Windows Azure emulator never loads and after waiting for a while you get a message box saying "role instances are taking longer than expected to start, do you want to continue waiting"
<Startup>
<Task commandLine="Startup\IdentityGac.cmd" executionContext="elevated" taskType="simple"></Task>
</Startup
@robertgreiner
robertgreiner / PackageManagerLog
Created April 19, 2012 15:31
How to fix the TargetInvocationException with EntityFramework Code First Migrations
PM> Add-Migration BlogCreated
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.ArgumentException: The parameter is incorrect. (Exception from HRESULT: 0x80070057 (E_INVALIDARG))
--- End of inner exception stack trace ---
at System.RuntimeType.InvokeDispMethod(String name, BindingFlags invokeAttr, Object target, Object[] args, Boolean[] byrefModifiers, Int32 culture, String[] namedParameters)
at System.RuntimeType.InvokeMember(String name, BindingFlags bindingFlags, Binder binder, Object target, Object[] providedArgs, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParams)
at System.Management.Automation.ComMethod.InvokeMethod(PSMethod method, Object[] arguments)
Exception has been thrown by the target of an invocation.
PM> Add-Migration BlogCreated -StartupProjectName "Blog.Infrastructure"
public interface ITaxType
{
decimal Calculate(decimal subTotal);
}
var kernel = new StandardKernel(new AppModule());
salesTax = kernel.Get<ITaxType>();
var total = salesTax.Calculate(100.00m);
Console.WriteLine(total);