tag:blogger.com,1999:blog-7044749230113435462024-02-07T19:49:08.722-08:00Rodolfo's blogRodolfohttp://www.blogger.com/profile/16896641814844792472noreply@blogger.comBlogger176125tag:blogger.com,1999:blog-704474923011343546.post-14591997088330223262020-10-01T12:40:00.001-07:002020-10-01T12:40:02.385-07:00Node Sass does not yet support your current environment: Windows 64-bit with Unsupported runtime (83)<p><span style="background-color: white; font-family: verdana; font-size: medium;"> This is an easy solution, you need to recompile SAAS using:</span></p><p><span style="background-color: white; white-space: pre-wrap;"><span style="font-family: verdana; font-size: medium;"><i>npm rebuild node-sass</i></span></span></p><p><span style="font-size: medium;"><br /></span></p><p><br /></p>Rodolfohttp://www.blogger.com/profile/16896641814844792472noreply@blogger.com0tag:blogger.com,1999:blog-704474923011343546.post-31975633648289870052020-08-05T15:40:00.004-07:002020-08-05T15:40:37.095-07:00Android emulator not recognizing localhost<span style="font-family: verdana;">While configuring Google as an authentication provider for a react native app, I had to configure the redirect uri, which usually points to localhost.</span><div><span style="font-family: verdana;"><br /></span></div><div><span style="font-family: verdana;">However, the android emulator could not figure out the redirect uri, and that's because the android emulator and my PC are in different networks. localhost works on my PC, but the android emulator is its own network. The way to fix it is with <i><b>adb reverse</b></i>. Like this:</span></div><div><span style="font-family: verdana;"><br /></span></div><div><span style="font-family: verdana;">adb reverse tcp:44371 tcp:44371</span></div><div><span style="font-family: verdana;"><br /></span></div><div><span style="font-family: verdana;">The port number does not necessarily need to match, it can be different. The first port is the emulator's, and the second port is obviously your PC.</span></div>Rodolfohttp://www.blogger.com/profile/16896641814844792472noreply@blogger.com0tag:blogger.com,1999:blog-704474923011343546.post-18380168149253181122020-07-18T08:54:00.003-07:002020-07-18T08:54:59.950-07:00Connecting to IIS Express from an Android emulator<span style="font-family: Verdana, sans-serif;">I've been struggling with this. While working on a proof of concept of an Android app connecting to an API running in my localhost, the Android app could not to IIS Express. At first, I thought it had to do with using a self-signed certificate. But even without SSL I still got a network error. This is how I fixed it:</span><br />
<span style="font-family: Verdana, sans-serif;"><br /></span>
<span style="font-family: Verdana, sans-serif;">1) First, the Android app should connect to the local ipv4 address, not localhost, not 127.0.0.1</span><br />
<span style="font-family: Verdana, sans-serif;"><br /></span>
<span style="font-family: Verdana, sans-serif;">2) Modify the file </span><span style="background-color: white; color: #333333; font-family: "Libre Franklin", "Helvetica Neue", helvetica, arial, sans-serif; font-size: 16px; font-weight: 700;">applicationhost.config </span><span style="font-family: Verdana, sans-serif;">as indicated here </span><a href="https://blogs.blackmarble.co.uk/rfennell/2012/11/06/using-iisexpress-for-addresses-other-than-localhost/" style="font-family: Verdana, sans-serif;">https://blogs.blackmarble.co.uk/rfennell/2012/11/06/using-iisexpress-for-addresses-other-than-localhost/</a><span style="font-family: Verdana, sans-serif;">, by replacing localhost with *</span><br />
<span style="font-family: Verdana, sans-serif;"><br /></span>
<span style="font-family: Verdana, sans-serif;">3) Restart IIS Express</span><br />
<span style="font-family: Verdana, sans-serif;"><br /></span>
<span style="font-family: Verdana, sans-serif;">And that's it!</span><br />
<span style="font-family: Verdana, sans-serif;"><br /></span>
<span style="font-family: Verdana, sans-serif;"><br /></span>
<span style="font-family: Verdana, sans-serif;"><br /></span>
<span style="font-family: Verdana, sans-serif;"><br /></span>Rodolfohttp://www.blogger.com/profile/16896641814844792472noreply@blogger.com0tag:blogger.com,1999:blog-704474923011343546.post-16297569132645051202020-07-16T08:19:00.004-07:002020-07-16T08:19:59.444-07:00Installing yarn on Debian - No such file or directory: 'global'<span style="font-family: Verdana, sans-serif;">This was happening while trying to install the ignite bowser demo app (<a href="https://github.com/infinitered/ignite/">https://github.com/infinitered/ignite</a>).</span><br />
<span style="font-family: Verdana, sans-serif;"><br /></span>
<span style="font-family: Verdana, sans-serif;">The final solution was to run the following to fix the problem:</span><br />
<span style="font-family: Verdana, sans-serif;"><br /></span>
<span style="font-family: Verdana, sans-serif;">sudo apt remove cmdtest </span><br />
<span style="font-family: Verdana, sans-serif;"></span><br />
<span style="font-family: Verdana, sans-serif;">sudo apt install yarn</span><br />
<span style="font-family: Verdana, sans-serif;"><br /></span>
<span style="font-family: Verdana, sans-serif;">Which I found here (<a href="https://github.com/yarnpkg/yarn/issues/3708">https://github.com/yarnpkg/yarn/issues/3708</a>)</span>Rodolfohttp://www.blogger.com/profile/16896641814844792472noreply@blogger.com0tag:blogger.com,1999:blog-704474923011343546.post-65290382937259993472020-07-15T08:28:00.000-07:002020-07-15T08:28:02.026-07:00Accessing WSL files from Windows<span style="font-family: Verdana, sans-serif;">I've been playing with WSL2 and accessing the Linux files is quite easy as indicated here <a href="https://superuser.com/questions/1110974/how-to-access-linux-ubuntu-files-from-windows-10-wsl">https://superuser.com/questions/1110974/how-to-access-linux-ubuntu-files-from-windows-10-wsl</a>. You only need to fire up File Explorer and type \\wsl$\Ubuntu\home\<<username>></span><br />
<span style="font-family: Verdana, sans-serif;"><br /></span>
<span style="font-family: Verdana, sans-serif;">Of course, you need to replace <<username>> with your actual username.</span>Rodolfohttp://www.blogger.com/profile/16896641814844792472noreply@blogger.com0tag:blogger.com,1999:blog-704474923011343546.post-70919056464680400332020-07-09T08:53:00.000-07:002020-07-15T08:53:11.362-07:00Copying files ignoring errors on Windows<span style="font-family: Verdana, sans-serif;">When copying a directory between Linux and Windows a lot of errors might be thrown, so I like to use this command to silent and ignore the errors:</span><br />
<pre style="border-radius: 3px; border: 0px; box-sizing: inherit; color: #242729; font-size: 13px; font-stretch: inherit; font-variant-east-asian: inherit; font-variant-numeric: inherit; line-height: inherit; margin-bottom: 1em; max-height: 600px; overflow-wrap: normal; overflow: auto; padding: 12px 8px; vertical-align: baseline; width: auto;"><code style="border: 0px; box-sizing: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline; white-space: inherit;"><span style="font-family: Verdana, sans-serif;">
</span></code></pre>
<pre style="border-radius: 3px; border: 0px; box-sizing: inherit; color: #242729; font-size: 13px; font-stretch: inherit; font-variant-east-asian: inherit; font-variant-numeric: inherit; line-height: inherit; margin-bottom: 1em; max-height: 600px; overflow-wrap: normal; overflow: auto; padding: 12px 8px; vertical-align: baseline; width: auto;"><code style="border: 0px; box-sizing: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline; white-space: inherit;"><span style="font-family: Verdana, sans-serif;">xcopy $SOURCE $DESTINATION /C /E /Q </span></code></pre>
Rodolfohttp://www.blogger.com/profile/16896641814844792472noreply@blogger.com0tag:blogger.com,1999:blog-704474923011343546.post-45341091197807402932020-07-08T19:39:00.000-07:002021-02-23T19:40:12.416-08:00Talks 2 Code Conference<p><span style="font-family: verdana;"> Check out my talk for the magazine Software Guru. It's in Spanish though.</span></p><p><span style="font-family: verdana;"><br /></span></p><p><span style="font-family: verdana;">https://youtu.be/DyotAYEa5AU</span></p><p><br /></p><p><span style="font-family: verdana;"></span></p><div class="separator" style="clear: both; text-align: center;"><span style="font-family: verdana;"><iframe allowfullscreen="" class="BLOG_video_class" height="266" src="https://www.youtube.com/embed/DyotAYEa5AU" width="320" youtube-src-id="DyotAYEa5AU"></iframe></span></div><span style="font-family: verdana;"><br /></span><p></p>Rodolfohttp://www.blogger.com/profile/16896641814844792472noreply@blogger.com0tag:blogger.com,1999:blog-704474923011343546.post-63628042750076651332020-07-01T08:29:00.002-07:002020-07-15T08:46:37.648-07:00WslRegisterDistribution failed with error: 0xffffffff<font face="verdana">While setting up WSL2 I came across this error. This seems like a scary error "WslRegisterDistribution failed with error: 0xffffffff", but all it means is port 53 is taken. </font><div><font face="verdana"><br /></font></div><div><font face="verdana">The solution for me was to run this in cmd:</font></div><div><font face="verdana"><div>netstat -aon | findstr ":53"</div><div><br /></div><div>And then find the PID that was using port 53, go to the task manager and kill it.</div><div><br /></div><div>I also stopped the Docker services just in case (in the Windows "Services" UI).</div><div><br /></div></font></div>Rodolfohttp://www.blogger.com/profile/16896641814844792472noreply@blogger.com0Mexico23.634501 -102.552784-3.2962940085904116 -137.709034 50.565296008590408 -67.396534tag:blogger.com,1999:blog-704474923011343546.post-24529976670831624512020-06-26T15:19:00.000-07:002020-06-26T15:19:34.480-07:00React native error: EPERM: operation not permitted, lstat signing-config.json<span style="font-family: "verdana" , sans-serif;">So I started working with React native. While setting up a project in Visual Studio Code, this error came up. What ended up fixing the error is deleting the file "android/app/build/intermediates/signing_config/debug/out/signing-config.json".</span><br />
<div>
<span style="font-family: "verdana" , sans-serif;"><br /></span></div>
<div>
<span style="font-family: Verdana, sans-serif;"><span style="font-family: Verdana, sans-serif;">I found that solution here </span><a href="https://reactnativecode.com/android-project-not-found/">https://reactnativecode.com/android-project-not-found/</a></span></div>
Rodolfohttp://www.blogger.com/profile/16896641814844792472noreply@blogger.com0tag:blogger.com,1999:blog-704474923011343546.post-45623063243637107042020-05-25T16:48:00.003-07:002020-05-25T16:48:30.917-07:00Bind a list of non-sequential indexes<span style="font-family: "verdana" , sans-serif;">I recently discovered a bug in an application. There was a list of items in a form, each with an index (0, 1, 2, 3...) and if I removed item 2 only items 0 and 1 would get posted.</span><br />
<span style="font-family: "verdana" , sans-serif;"><br /></span>
<span style="font-family: "verdana" , sans-serif;">This seemed to me a rather common problem and something more people would have encountered by now. Luckily, I came across this post from 2008 by Phil Haack (</span><a href="https://haacked.com/archive/2008/10/23/model-binding-to-a-list.aspx/"><span style="font-family: Verdana, sans-serif;">https://haacked.com/archive/2008/10/23/model-binding-to-a-list.aspx/</span></a>) <span style="font-family: "verdana" , sans-serif;">in which he basically says we need a hidden input with the Index suffix for each item we need to bind to the list.</span><br />
<span style="font-family: "verdana" , sans-serif;"><br /></span>
<span style="font-family: "verdana" , sans-serif;">And guess what? It works!!</span>Rodolfohttp://www.blogger.com/profile/16896641814844792472noreply@blogger.com0tag:blogger.com,1999:blog-704474923011343546.post-6989632290284497412020-04-18T18:21:00.003-07:002020-04-18T18:21:52.091-07:00Upgrade to .NET Core 3.1 - Could not load file or assembly Microsoft.IntelliTrace.Core<span style="font-family: Verdana, sans-serif;">The last error I came across was this one, "Could not load file or assembly Microsoft.IntelliTrace.Core". This happened while debugging a test.</span><br />
<span style="font-family: Verdana, sans-serif;"><br /></span>
<span style="font-family: Verdana, sans-serif;">The initial fix was upgrading the referenced nuget packages to their latest version. However, after this, I still got the error. The solution was to update Visual Studio 2019 to it's latest version. Not very intuitive, but it worked.</span><br />
<br />Rodolfohttp://www.blogger.com/profile/16896641814844792472noreply@blogger.com0tag:blogger.com,1999:blog-704474923011343546.post-14467232012480247062020-04-17T18:22:00.000-07:002020-04-18T18:22:55.889-07:00Upgrade to .NET Core 3.1 - Using StructureMap in .NET 3.1<span style="font-family: Verdana, sans-serif;">In short, you should stop using StructureMap. It's no longer supported. Instead, use Lamar, and only have to make minimal changes. It's written by the same guy who wrote StructureMap.</span><br />
<span style="font-family: Verdana, sans-serif;"><br /></span>
<span style="font-family: Verdana, sans-serif;">In your Program.cs:</span><br />
<span style="font-family: Verdana, sans-serif;"><br /></span>
<span style="font-family: Verdana, sans-serif;"> public static IHostBuilder CreateHostBuilder(string[] args) =></span><br />
<span style="font-family: Verdana, sans-serif;"> Host.CreateDefaultBuilder(args)</span><br />
<span style="font-family: Verdana, sans-serif;"> .UseLamar()</span><br />
<span style="font-family: Verdana, sans-serif;"> .ConfigureWebHostDefaults(webBuilder =></span><br />
<span style="font-family: Verdana, sans-serif;"> {</span><br />
<span style="white-space: pre;"><span style="font-family: Verdana, sans-serif;"> </span></span><br />
<span style="font-family: Verdana, sans-serif;">In your Startup.cs:</span><br />
<span style="font-family: Verdana, sans-serif;"><br /></span>
<span style="font-family: Verdana, sans-serif;"> public void ConfigureContainer(ServiceRegistry services)</span><br />
<span style="font-family: Verdana, sans-serif;"> {</span><br />
<span style="font-family: Verdana, sans-serif;"> ...</span><br />
<span style="white-space: pre;"><span style="font-family: Verdana, sans-serif;"> </span></span><span style="font-family: Verdana, sans-serif;">services.Scan(scan =></span><br />
<span style="font-family: Verdana, sans-serif;"> {</span><br />
<span style="font-family: Verdana, sans-serif;"><span style="white-space: pre;"> </span>...</span>Rodolfohttp://www.blogger.com/profile/16896641814844792472noreply@blogger.com0tag:blogger.com,1999:blog-704474923011343546.post-24331341812344223632020-04-15T18:23:00.000-07:002020-04-18T18:23:43.077-07:00Upgrade to .NET Core 3.1 - Could not find an IRouter associated with the ActionContext. If your application is using endpoint routing then you can get a IUrlHelperFactory with dependency injection and use it to create a UrlHelper<span style="font-family: Verdana, sans-serif;">The error itself exposes the solution. You need to stop using: </span><br />
<span style="font-family: Verdana, sans-serif;"><br /></span>
<span style="font-family: Verdana, sans-serif;"> return new UrlHelper(helper.ViewContext).DisplayLink(action, linkText, returnLink);</span><br />
<span style="font-family: Verdana, sans-serif;"><br /></span>
<span style="font-family: Verdana, sans-serif;">And instead use (notice I'm not using DI, but you should use DI to retrieve IUrlHelperFactory):</span><br />
<span style="font-family: Verdana, sans-serif;"><br /></span>
<span style="font-family: Verdana, sans-serif;"> var urlHelperFactory = ServiceLocator.Current.GetInstance<IUrlHelperFactory>();</span><br />
<span style="font-family: Verdana, sans-serif;"> return urlHelperFactory.GetUrlHelper(helper.ViewContext).DisplayLink(action, linkText, returnLink);<span style="white-space: pre;"> </span></span>Rodolfohttp://www.blogger.com/profile/16896641814844792472noreply@blogger.com0tag:blogger.com,1999:blog-704474923011343546.post-4171304446755875432020-04-14T18:26:00.000-07:002020-04-18T18:27:05.870-07:00Upgrade to .NET Core 3.1 - Migration warning CS0618 'RazorViewAttribute' is obsolete<span style="font-family: "verdana" , sans-serif;">This error is simple, you can even find the answer is SO. It's caused by one of your nugets, you only need to update it to the latest version. Finding the offending nuget is another story. Hopefully you don't have too many nugets to update.</span>Rodolfohttp://www.blogger.com/profile/16896641814844792472noreply@blogger.com0tag:blogger.com,1999:blog-704474923011343546.post-47626906406650392282020-04-12T18:36:00.000-07:002020-04-18T18:36:20.167-07:00Upgrade to .NET Core 3.1<span style="font-family: Verdana, sans-serif;">Last week I had the task of upgrading a project written in .NET Core 2.1 to .NET Core 3.1. I'll be posting solutions to the errors I came across. But first, I'll show important sections of my Startup.cs and Program.cs:</span><br />
<span style="font-family: Verdana, sans-serif;"><br /></span>
<span style="font-family: Verdana, sans-serif;">I'll start with Program.cs:</span><br />
<span style="font-family: Verdana, sans-serif;"><br /></span>
<span style="font-family: Verdana, sans-serif;"><br /></span>
<span style="font-family: Verdana, sans-serif;"> public static void Main(string[] args)</span><br />
<span style="font-family: Verdana, sans-serif;"> {</span><br />
<span style="font-family: Verdana, sans-serif;"> var host = CreateHostBuilder(args).Build();</span><br />
<span style="font-family: Verdana, sans-serif;"> host.Run();</span><br />
<span style="font-family: Verdana, sans-serif;"> }</span><br />
<span style="font-family: Verdana, sans-serif;"><br /></span>
<span style="font-family: Verdana, sans-serif;"> public static IHostBuilder CreateHostBuilder(string[] args) =></span><br />
<span style="font-family: Verdana, sans-serif;"> Host.CreateDefaultBuilder(args)</span><br />
<span style="font-family: Verdana, sans-serif;"> .UseLamar()</span><br />
<span style="font-family: Verdana, sans-serif;"> .ConfigureWebHostDefaults(webBuilder =></span><br />
<span style="font-family: Verdana, sans-serif;"> {</span><br />
<span style="font-family: Verdana, sans-serif;"> webBuilder.UseStartup<Startup>();</span><br />
<span style="font-family: Verdana, sans-serif;"> }).ConfigureLogging(builder =></span><br />
<span style="font-family: Verdana, sans-serif;"> {</span><span style="font-family: Verdana, sans-serif;"> </span><br />
<span style="font-family: Verdana, sans-serif;"> ...</span><br />
<span style="font-family: Verdana, sans-serif;"><br /></span>
<span style="font-family: Verdana, sans-serif;"> builder.AddApplicationInsights();</span><br />
<br />
<span style="font-family: Verdana, sans-serif;"> });</span><br />
<span style="font-family: Verdana, sans-serif;"><br /></span>
<span style="font-family: Verdana, sans-serif;">On to the file Startup.cs</span><br />
<br />
<span style="font-family: Verdana, sans-serif;"> public class Startup</span><br />
<span style="font-family: Verdana, sans-serif;"> {</span><br />
<span style="font-family: Verdana, sans-serif;"> public Startup(IConfiguration configuration)</span><br />
<span style="font-family: Verdana, sans-serif;"> {</span><br />
<span style="font-family: Verdana, sans-serif;"> Configuration = configuration;</span><br />
<span style="font-family: Verdana, sans-serif;"> }</span><br />
<span style="font-family: Verdana, sans-serif;"><br /></span>
<span style="font-family: Verdana, sans-serif;"> public IConfiguration Configuration { get; }</span><br />
<span style="font-family: Verdana, sans-serif;"><br /></span>
<span style="font-family: Verdana, sans-serif;"> public void ConfigureContainer(ServiceRegistry services)</span><br />
<span style="font-family: Verdana, sans-serif;"> {</span><br />
<span style="font-family: Verdana, sans-serif;"> services.Configure<CookiePolicyOptions>(options =></span><br />
<span style="font-family: Verdana, sans-serif;"> {</span><br />
<span style="font-family: Verdana, sans-serif;"><span style="white-space: pre;"> </span>...</span><br />
<span style="font-family: Verdana, sans-serif;"> });</span><br />
<span style="font-family: Verdana, sans-serif;"><br /></span>
<span style="font-family: Verdana, sans-serif;"> services.AddAuthentication(AzureADDefaults.AuthenticationScheme)</span><br />
<span style="font-family: Verdana, sans-serif;"> .AddAzureAD(options => Con</span><br />
<span style="white-space: pre;"><span style="font-family: Verdana, sans-serif;"> </span></span><br />
<span style="font-family: Verdana, sans-serif;"> services.AddMediatR();</span><br />
<span style="font-family: Verdana, sans-serif;"> services.AddAutoMapper();</span><br />
<span style="font-family: Verdana, sans-serif;"> services.AddSession();</span><br />
<span style="font-family: Verdana, sans-serif;"><br /></span>
<span style="font-family: Verdana, sans-serif;"><span style="white-space: pre;"> </span>...</span><br />
<span style="font-family: Verdana, sans-serif;"> services.AddControllersWithViews(options =></span><br />
<span style="font-family: Verdana, sans-serif;"> {</span><br />
<span style="font-family: Verdana, sans-serif;"> var policy = new AuthorizationPolicyBuilder()</span><br />
<span style="font-family: Verdana, sans-serif;"> .RequireAuthenticatedUser()</span><br />
<span style="font-family: Verdana, sans-serif;"> .Build();</span><br />
<span style="font-family: Verdana, sans-serif;"><br /></span>
<span style="font-family: Verdana, sans-serif;"> options.Filters.Add(typeof(AzureAuthorizationFilter));</span><br />
<span style="font-family: Verdana, sans-serif;"><span style="white-space: pre;"> </span>...</span><br />
<span style="font-family: Verdana, sans-serif;"> options.UseModelBinding();</span><br />
<span style="font-family: Verdana, sans-serif;"> });</span><br />
<span style="font-family: Verdana, sans-serif;"> services.AddRazorPages().SetCompatibilityVersion(CompatibilityVersion.Latest).AddNewtonsoftJson(options => options.SerializerSettings.ContractResolver = new DefaultContractResolver())</span><br />
<span style="font-family: Verdana, sans-serif;"> .AddTypedRouting()</span><br />
<span style="font-family: Verdana, sans-serif;"> .AddNewtonsoftJson(x => x.SerializerSettings.ReferenceLoopHandling = ReferenceLoopHandling.Ignore);</span><br />
<span style="font-family: Verdana, sans-serif;"> services.AddAuthorization();</span><br />
<span style="font-family: Verdana, sans-serif;"> services.Configure<RazorViewEngineOptions>(options => { </span><br />
<span style="font-family: Verdana, sans-serif;"><span style="white-space: pre;"> </span>...</span><br />
<span style="font-family: Verdana, sans-serif;"> });</span><br />
<span style="font-family: Verdana, sans-serif;"><br /></span>
<span style="font-family: Verdana, sans-serif;"> services.AddSignalR();</span><br />
<span style="font-family: Verdana, sans-serif;"><br /></span>
<span style="font-family: Verdana, sans-serif;"> services.Scan(scan =></span><br />
<span style="font-family: Verdana, sans-serif;"> {</span><br />
<span style="font-family: Verdana, sans-serif;"> scan.TheCallingAssembly();</span><br />
<span style="font-family: Verdana, sans-serif;"><span style="white-space: pre;"> </span>...</span><br />
<span style="font-family: Verdana, sans-serif;"> scan.WithDefaultConventions();</span><br />
<span style="font-family: Verdana, sans-serif;"> });</span><br />
<span style="font-family: Verdana, sans-serif;"> services.For<IPrincipal>().Use(x => Thread.CurrentPrincipal);</span><br />
<span style="font-family: Verdana, sans-serif;"><span style="white-space: pre;"> </span>...</span><br />
<span style="font-family: Verdana, sans-serif;"> }</span><br />
<span style="font-family: Verdana, sans-serif;"><br /></span>
<span style="font-family: Verdana, sans-serif;"> // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.</span><br />
<span style="font-family: Verdana, sans-serif;"> public void Configure(IApplicationBuilder app, IWebHostEnvironment env)</span><br />
<span style="font-family: Verdana, sans-serif;"> {</span><br />
<span style="font-family: Verdana, sans-serif;"> if (env.IsDevelopment())</span><br />
<span style="font-family: Verdana, sans-serif;"> {</span><br />
<span style="font-family: Verdana, sans-serif;"> app.UseDeveloperExceptionPage();</span><br />
<span style="font-family: Verdana, sans-serif;"> }</span><br />
<span style="font-family: Verdana, sans-serif;"> else</span><br />
<span style="font-family: Verdana, sans-serif;"> {</span><br />
<span style="font-family: Verdana, sans-serif;"> app.UseExceptionHandler("/Home/Error");</span><br />
<span style="font-family: Verdana, sans-serif;"> app.UseHsts();</span><br />
<span style="font-family: Verdana, sans-serif;"> }</span><br />
<span style="font-family: Verdana, sans-serif;"><br /></span>
<span style="font-family: Verdana, sans-serif;"> app.UseHttpsRedirection();</span><br />
<span style="font-family: Verdana, sans-serif;"> app.UseStaticFiles();</span><br />
<span style="font-family: Verdana, sans-serif;"> app.UseCookiePolicy();</span><br />
<span style="font-family: Verdana, sans-serif;"><br /></span>
<span style="font-family: Verdana, sans-serif;"> app.UseAuthentication();</span><br />
<span style="font-family: Verdana, sans-serif;"> app.UseSession();</span><br />
<span style="font-family: Verdana, sans-serif;"> app.UseRouting();</span><br />
<span style="font-family: Verdana, sans-serif;"> app.UseAuthorization();</span><br />
<span style="font-family: Verdana, sans-serif;"> app.UseEndpoints(endpoints =></span><br />
<span style="font-family: Verdana, sans-serif;"> {</span><br />
<span style="font-family: Verdana, sans-serif;"> endpoints.MapControllerRoute(</span><br />
<span style="font-family: Verdana, sans-serif;"> "default",</span><br />
<span style="font-family: Verdana, sans-serif;"> "{controller=Home}/{action=Index}/{id?}");</span><br />
<span style="font-family: Verdana, sans-serif;"><br /></span>
<span style="font-family: Verdana, sans-serif;"> endpoints.MapHub<NotificationHub>("/pushHub");</span><br />
<span style="font-family: Verdana, sans-serif;"> });</span><br />
<span style="font-family: Verdana, sans-serif;"> }</span><br />
<span style="font-family: Verdana, sans-serif;"></span><br />
<span style="font-family: Verdana, sans-serif;"> }</span>Rodolfohttp://www.blogger.com/profile/16896641814844792472noreply@blogger.com0tag:blogger.com,1999:blog-704474923011343546.post-38119100748586063752017-05-16T08:18:00.000-07:002017-05-16T08:18:06.149-07:00Cannot import the following key file. The key file may be password protected. To correct this, try to import the certificate again or manually install the certificate<span style="font-family: Verdana, sans-serif;">I got an error when compiling a project in TeamCity. This particular project had assemblies signed. TeamCity threw an error that said:</span><br />
<span style="font-family: Verdana, sans-serif;"><br /></span>
<span style="font-family: Verdana, sans-serif;">Cannot import the following key file. The key file may be password protected. To correct this, try to import the certificate again or manually install the certificate to the Strong Name CSP with the following key container name: VS_KEY_FFA0xxxxx</span><br />
<span style="font-family: Verdana, sans-serif;"><br /></span>
<span style="font-family: Verdana, sans-serif;">The fix to this problem is quite simple:</span><br />
<span style="font-family: Verdana, sans-serif;"><br /></span>
<span style="font-family: Verdana, sans-serif;">1) Open the Developer Command Prompt for VS 2017</span><br />
<span style="font-family: Verdana, sans-serif;">2) Type:</span><br />
<span style="font-family: Verdana, sans-serif;"><br /></span>
<span style="font-family: Verdana, sans-serif;"> sn -i "c:\path to your pfx\file.pfx" VS_KEY_xxxxxx</span><br />
<span style="font-family: Verdana, sans-serif;"><br /></span>
<span style="font-family: Verdana, sans-serif;">where the VS_KEY is what Team City said</span><br />
<br />Rodolfohttp://www.blogger.com/profile/16896641814844792472noreply@blogger.com0tag:blogger.com,1999:blog-704474923011343546.post-82103511879576692932017-04-09T11:04:00.000-07:002017-04-09T11:04:54.117-07:00ASP.NET Identity - Invalid token error<span style="font-family: Verdana, sans-serif;">I was generating a code for a user to reset her password. However, this error came up when trying to reset the password. I had 2 problems:</span><br />
<span style="font-family: Verdana, sans-serif;"><br /></span>
<span style="font-family: Verdana, sans-serif;">1) The token was being generated in a computer that was not where the token was actually used. I read in SO that the token is tied to a key in the web.config, so either the web.config -keep in mind that ASP.NET has a hierarchy of web.config files, so there's more than 1- needs to match or you need to generate and use the token in the same server.</span><br />
<span style="font-family: Verdana, sans-serif;">2) The token contained the plus sign (+). When using it, the server encoded it as a space, so you need to do string.Replace(" ", "+")</span>Rodolfohttp://www.blogger.com/profile/16896641814844792472noreply@blogger.com0tag:blogger.com,1999:blog-704474923011343546.post-12811417448738528562017-01-22T13:00:00.003-08:002017-01-22T13:00:48.075-08:00Web deploy error when publishing to azure: String larger than expected<span style="font-family: Verdana, sans-serif;">This happened to me while trying to deploy 1 files (a dll) to azure. I couldn't find any answers on SO or other sites. The solution was to deploy all files as opposed to deploying only 1 file</span>Rodolfohttp://www.blogger.com/profile/16896641814844792472noreply@blogger.com1tag:blogger.com,1999:blog-704474923011343546.post-42991538339857340832016-12-11T11:49:00.001-08:002016-12-11T11:49:35.228-08:00Azure returning a 404 for woff files<span style="font-family: Verdana, sans-serif;">This is actually a configuration error, as described here</span><br />
<br />
http://www.codepal.co.uk/show/WOFF_files_return_404_in_Azure_Web_Sites<br />
<span style="font-family: Verdana, sans-serif;"><br /></span>
<span style="font-family: Verdana, sans-serif;">The solution was to add the following to the web.config:</span><br />
<span style="font-family: Verdana, sans-serif;"><br /></span>
<span style="font-family: Verdana, sans-serif;"><br /></span>
<span style="font-family: Verdana, sans-serif;"> <system.webServer></span><br />
<span style="font-family: Verdana, sans-serif;"> <staticContent></span><br />
<span style="font-family: Verdana, sans-serif;"> <mimeMap fileExtension="woff" mimeType="application/font-woff" /></span><br />
<span style="font-family: Verdana, sans-serif;"> <mimeMap fileExtension="woff2" mimeType="application/font-woff" /> </span><br />
<span style="font-family: Verdana, sans-serif;"></span><br />
<span style="font-family: Verdana, sans-serif;"> </staticContent></span><br />
<br />Rodolfohttp://www.blogger.com/profile/16896641814844792472noreply@blogger.com0tag:blogger.com,1999:blog-704474923011343546.post-52272972713659942212016-09-15T18:17:00.001-07:002016-09-15T18:17:37.945-07:00OpenVPN not changing my IP address<span style="font-family: Verdana, sans-serif;">When I installed the OpenVPN client and connected to a VPN it changed my IP address correctly. However, subsequent times it didn't change it. It turned out I had to run the application as an administrator, and that was it.</span>Rodolfohttp://www.blogger.com/profile/16896641814844792472noreply@blogger.com0tag:blogger.com,1999:blog-704474923011343546.post-43512003756803967982016-06-27T10:04:00.001-07:002016-06-27T11:07:20.883-07:00How to return a 401 status code using ASP.NET MVC 5 and OWIN<span style="font-size: small;"><span style="font-family: "verdana" , sans-serif;">This time I was trying to force users to the login page after an Ajax request failed because of an expired session. I was getting something like this in the response:</span></span><br />
<br />
<code class="csharp plain" style="-webkit-text-stroke-width: 0px; background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: black !important; float: none !important; font-family: Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace !important; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; height: auto !important; left: auto !important; letter-spacing: normal; line-height: 15.4px; margin: 0px !important; min-height: auto !important; orphans: auto; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; text-align: left; text-indent: 0px; text-transform: none; top: auto !important; vertical-align: baseline !important; white-space: pre; widows: 1; width: auto !important; word-spacing: 0px;">X-Responded-JSON: {</code><code class="csharp string" style="-webkit-text-stroke-width: 0px; background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: blue !important; float: none !important; font-family: Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace !important; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; height: auto !important; left: auto !important; letter-spacing: normal; line-height: 15.4px; margin: 0px !important; min-height: auto !important; orphans: auto; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; text-align: left; text-indent: 0px; text-transform: none; top: auto !important; vertical-align: baseline !important; white-space: pre; widows: 1; width: auto !important; word-spacing: 0px;">"status"</code><code class="csharp plain" style="-webkit-text-stroke-width: 0px; background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: black !important; float: none !important; font-family: Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace !important; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; height: auto !important; left: auto !important; letter-spacing: normal; line-height: 15.4px; margin: 0px !important; min-height: auto !important; orphans: auto; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; text-align: left; text-indent: 0px; text-transform: none; top: auto !important; vertical-align: baseline !important; white-space: pre; widows: 1; width: auto !important; word-spacing: 0px;">:401,</code><code class="csharp string" style="-webkit-text-stroke-width: 0px; background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: blue !important; float: none !important; font-family: Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace !important; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; height: auto !important; left: auto !important; letter-spacing: normal; line-height: 15.4px; margin: 0px !important; min-height: auto !important; orphans: auto; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; text-align: left; text-indent: 0px; text-transform: none; top: auto !important; vertical-align: baseline !important; white-space: pre; widows: 1; width: auto !important; word-spacing: 0px;">"headers"</code><code class="csharp plain" style="-webkit-text-stroke-width: 0px; background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: black !important; float: none !important; font-family: Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace !important; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; height: auto !important; left: auto !important; letter-spacing: normal; line-height: 15.4px; margin: 0px !important; min-height: auto !important; orphans: auto; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; text-align: left; text-indent: 0px; text-transform: none; top: auto !important; vertical-align: baseline !important; white-space: pre; widows: 1; width: auto !important; word-spacing: 0px;">:...</code><br />
<code class="csharp plain" style="-webkit-text-stroke-width: 0px; background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: black !important; float: none !important; font-family: Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace !important; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; height: auto !important; left: auto !important; letter-spacing: normal; line-height: 15.4px; margin: 0px !important; min-height: auto !important; orphans: auto; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; text-align: left; text-indent: 0px; text-transform: none; top: auto !important; vertical-align: baseline !important; white-space: pre; widows: 1; width: auto !important; word-spacing: 0px;"> </code><span style="font-size: small;"><code class="csharp plain" style="background: transparent none repeat scroll 0% 0% ! important; border-radius: 0px ! important; border: 0px none ! important; bottom: auto ! important; box-sizing: content-box ! important; color: black ! important; float: none ! important; font-family: Consolas,"Bitstream Vera Sans Mono","Courier New",Courier,monospace ! important; font-style: normal; font-variant: normal; font-weight: normal; height: auto ! important; left: auto ! important; letter-spacing: normal; line-height: 15.4px; margin: 0px ! important; min-height: auto ! important; outline: 0px none ! important; overflow: visible ! important; padding: 0px ! important; position: static ! important; right: auto ! important; text-align: left; text-indent: 0px; text-transform: none; top: auto ! important; vertical-align: baseline ! important; white-space: pre; width: auto ! important; word-spacing: 0px;"><span style="font-family: "verdana" , sans-serif;"> </span></code></span><br />
<span style="font-size: small;"><code class="csharp plain" style="background: transparent none repeat scroll 0% 0% ! important; border-radius: 0px ! important; border: 0px none ! important; bottom: auto ! important; box-sizing: content-box ! important; color: black ! important; float: none ! important; font-family: Consolas,"Bitstream Vera Sans Mono","Courier New",Courier,monospace ! important; font-style: normal; font-variant: normal; font-weight: normal; height: auto ! important; left: auto ! important; letter-spacing: normal; line-height: 15.4px; margin: 0px ! important; min-height: auto ! important; outline: 0px none ! important; overflow: visible ! important; padding: 0px ! important; position: static ! important; right: auto ! important; text-align: left; text-indent: 0px; text-transform: none; top: auto ! important; vertical-align: baseline ! important; white-space: pre; width: auto ! important; word-spacing: 0px;"><span style="font-family: "verdana" , sans-serif;">I investigated a little and turned out you have to add this code to your </span></code></span><span style="background-color: #fafafa; color: #333333; display: inline; float: none; font-family: "helvetica neue light" , , "helvetica neue" , "helvetica" , "arial" , sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 19.6px; text-align: justify; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;"><span style="color: black;"><span style="font-size: small;"><span style="font-family: "verdana" , sans-serif;">Startup.Auth.cs file:</span></span></span></span><br />
<br />
<span style="font-size: small;"><span style="font-family: "times" , "times new roman" , serif;"><code class="csharp plain" style="background: transparent none repeat scroll 0% 0% ! important; border-radius: 0px ! important; border: 0px none ! important; bottom: auto ! important; box-sizing: content-box ! important; color: black ! important; float: none ! important; font-style: normal; font-variant: normal; font-weight: normal; height: auto ! important; left: auto ! important; letter-spacing: normal; line-height: 15.4px; margin: 0px ! important; min-height: auto ! important; outline: 0px none ! important; overflow: visible ! important; padding: 0px ! important; position: static ! important; right: auto ! important; text-align: left; text-indent: 0px; text-transform: none; top: auto ! important; vertical-align: baseline ! important; white-space: pre; width: auto ! important; word-spacing: 0px;"><code class="csharp plain" style="background: transparent none repeat scroll 0% 0% ! important; border-radius: 0px ! important; border: 0px none ! important; bottom: auto ! important; box-sizing: content-box ! important; color: black ! important; float: none ! important; font-style: normal; font-variant: normal; font-weight: normal; height: auto ! important; left: auto ! important; letter-spacing: normal; line-height: 15.4px; margin: 0px ! important; min-height: auto ! important; outline: 0px none ! important; overflow: visible ! important; padding: 0px ! important; position: static ! important; right: auto ! important; text-align: left; text-indent: 0px; text-transform: none; top: auto ! important; vertical-align: baseline ! important; white-space: pre; width: auto ! important; word-spacing: 0px;"> Provider = </code><code class="csharp keyword" style="background: transparent none repeat scroll 0% 0% ! important; border-radius: 0px ! important; border: 0px none ! important; bottom: auto ! important; box-sizing: content-box ! important; color: rgb(0, 102, 153) ! important; float: none ! important; font-style: normal; font-variant: normal; font-weight: bold ! important; height: auto ! important; left: auto ! important; letter-spacing: normal; line-height: 15.4px; margin: 0px ! important; min-height: auto ! important; outline: 0px none ! important; overflow: visible ! important; padding: 0px ! important; position: static ! important; right: auto ! important; text-align: left; text-indent: 0px; text-transform: none; top: auto ! important; vertical-align: baseline ! important; white-space: pre; width: auto ! important; word-spacing: 0px;">new</code><span style="background-color: white; color: #333333; display: inline; float: none; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 15.4px; text-align: left; text-indent: 0px; text-transform: none; white-space: pre; word-spacing: 0px;"> </span><code class="csharp plain" style="background: transparent none repeat scroll 0% 0% ! important; border-radius: 0px ! important; border: 0px none ! important; bottom: auto ! important; box-sizing: content-box ! important; color: black ! important; float: none ! important; font-style: normal; font-variant: normal; font-weight: normal; height: auto ! important; left: auto ! important; letter-spacing: normal; line-height: 15.4px; margin: 0px ! important; min-height: auto ! important; outline: 0px none ! important; overflow: visible ! important; padding: 0px ! important; position: static ! important; right: auto ! important; text-align: left; text-indent: 0px; text-transform: none; top: auto ! important; vertical-align: baseline ! important; white-space: pre; width: auto ! important; word-spacing: 0px;">CookieAuthenticationProvider</code> </code></span></span><br />
<div class="line number23 index22 alt2" style="background: white none repeat scroll 0% 0% ! important; border-radius: 0px ! important; border: 0px none ! important; bottom: auto ! important; box-sizing: content-box ! important; color: #333333; float: none ! important; font-style: normal; font-variant: normal; font-weight: normal; height: auto ! important; left: auto ! important; letter-spacing: normal; line-height: 15.4px; margin: 0px ! important; min-height: auto ! important; outline: 0px none ! important; overflow: visible ! important; padding: 0px 1em ! important; position: static ! important; right: auto ! important; text-align: left; text-indent: 0px; text-transform: none; top: auto ! important; vertical-align: baseline ! important; white-space: pre ! important; width: auto ! important; word-spacing: 0px;">
<span style="font-size: small;"><span style="font-family: "times" , "times new roman" , serif;"><code class="csharp plain" style="background: transparent none repeat scroll 0% 0% ! important; border-radius: 0px ! important; border: 0px none ! important; bottom: auto ! important; box-sizing: content-box ! important; color: black ! important; float: none ! important; font-style: normal ! important; font-weight: normal ! important; height: auto ! important; left: auto ! important; line-height: 1.1em ! important; margin: 0px ! important; min-height: auto ! important; outline: 0px none ! important; overflow: visible ! important; padding: 0px ! important; position: static ! important; right: auto ! important; text-align: left ! important; top: auto ! important; vertical-align: baseline ! important; width: auto ! important;">{</code></span></span></div>
<div class="line number24 index23 alt1" style="background: white none repeat scroll 0% 0% ! important; border-radius: 0px ! important; border: 0px none ! important; bottom: auto ! important; box-sizing: content-box ! important; color: #333333; float: none ! important; font-style: normal; font-variant: normal; font-weight: normal; height: auto ! important; left: auto ! important; letter-spacing: normal; line-height: 15.4px; margin: 0px ! important; min-height: auto ! important; outline: 0px none ! important; overflow: visible ! important; padding: 0px 1em ! important; position: static ! important; right: auto ! important; text-align: left; text-indent: 0px; text-transform: none; top: auto ! important; vertical-align: baseline ! important; white-space: pre ! important; width: auto ! important; word-spacing: 0px;">
<span style="font-size: small;"><span style="font-family: "times" , "times new roman" , serif;"><code class="csharp spaces" style="background: transparent none repeat scroll 0% 0% ! important; border-radius: 0px ! important; border: 0px none ! important; bottom: auto ! important; box-sizing: content-box ! important; float: none ! important; font-style: normal ! important; font-weight: normal ! important; height: auto ! important; left: auto ! important; line-height: 1.1em ! important; margin: 0px ! important; min-height: auto ! important; outline: 0px none ! important; overflow: visible ! important; padding: 0px ! important; position: static ! important; right: auto ! important; text-align: left ! important; top: auto ! important; vertical-align: baseline ! important; width: auto ! important;"> </code><code class="csharp plain" style="background: transparent none repeat scroll 0% 0% ! important; border-radius: 0px ! important; border: 0px none ! important; bottom: auto ! important; box-sizing: content-box ! important; color: black ! important; float: none ! important; font-style: normal ! important; font-weight: normal ! important; height: auto ! important; left: auto ! important; line-height: 1.1em ! important; margin: 0px ! important; min-height: auto ! important; outline: 0px none ! important; overflow: visible ! important; padding: 0px ! important; position: static ! important; right: auto ! important; text-align: left ! important; top: auto ! important; vertical-align: baseline ! important; width: auto ! important;">OnApplyRedirect = ctx =></code></span></span></div>
<div class="line number25 index24 alt2" style="background: white none repeat scroll 0% 0% ! important; border-radius: 0px ! important; border: 0px none ! important; bottom: auto ! important; box-sizing: content-box ! important; color: #333333; float: none ! important; font-style: normal; font-variant: normal; font-weight: normal; height: auto ! important; left: auto ! important; letter-spacing: normal; line-height: 15.4px; margin: 0px ! important; min-height: auto ! important; outline: 0px none ! important; overflow: visible ! important; padding: 0px 1em ! important; position: static ! important; right: auto ! important; text-align: left; text-indent: 0px; text-transform: none; top: auto ! important; vertical-align: baseline ! important; white-space: pre ! important; width: auto ! important; word-spacing: 0px;">
<span style="font-size: small;"><span style="font-family: "times" , "times new roman" , serif;"><code class="csharp spaces" style="background: transparent none repeat scroll 0% 0% ! important; border-radius: 0px ! important; border: 0px none ! important; bottom: auto ! important; box-sizing: content-box ! important; float: none ! important; font-style: normal ! important; font-weight: normal ! important; height: auto ! important; left: auto ! important; line-height: 1.1em ! important; margin: 0px ! important; min-height: auto ! important; outline: 0px none ! important; overflow: visible ! important; padding: 0px ! important; position: static ! important; right: auto ! important; text-align: left ! important; top: auto ! important; vertical-align: baseline ! important; width: auto ! important;"> </code><code class="csharp plain" style="background: transparent none repeat scroll 0% 0% ! important; border-radius: 0px ! important; border: 0px none ! important; bottom: auto ! important; box-sizing: content-box ! important; color: black ! important; float: none ! important; font-style: normal ! important; font-weight: normal ! important; height: auto ! important; left: auto ! important; line-height: 1.1em ! important; margin: 0px ! important; min-height: auto ! important; outline: 0px none ! important; overflow: visible ! important; padding: 0px ! important; position: static ! important; right: auto ! important; text-align: left ! important; top: auto ! important; vertical-align: baseline ! important; width: auto ! important;">{</code></span></span></div>
<div class="line number26 index25 alt1" style="background: white none repeat scroll 0% 0% ! important; border-radius: 0px ! important; border: 0px none ! important; bottom: auto ! important; box-sizing: content-box ! important; color: #333333; float: none ! important; font-style: normal; font-variant: normal; font-weight: normal; height: auto ! important; left: auto ! important; letter-spacing: normal; line-height: 15.4px; margin: 0px ! important; min-height: auto ! important; outline: 0px none ! important; overflow: visible ! important; padding: 0px 1em ! important; position: static ! important; right: auto ! important; text-align: left; text-indent: 0px; text-transform: none; top: auto ! important; vertical-align: baseline ! important; white-space: pre ! important; width: auto ! important; word-spacing: 0px;">
<span style="font-size: small;"><span style="font-family: "times" , "times new roman" , serif;"><code class="csharp spaces" style="background: transparent none repeat scroll 0% 0% ! important; border-radius: 0px ! important; border: 0px none ! important; bottom: auto ! important; box-sizing: content-box ! important; float: none ! important; font-style: normal ! important; font-weight: normal ! important; height: auto ! important; left: auto ! important; line-height: 1.1em ! important; margin: 0px ! important; min-height: auto ! important; outline: 0px none ! important; overflow: visible ! important; padding: 0px ! important; position: static ! important; right: auto ! important; text-align: left ! important; top: auto ! important; vertical-align: baseline ! important; width: auto ! important;"> </code><code class="csharp keyword" style="background: transparent none repeat scroll 0% 0% ! important; border-radius: 0px ! important; border: 0px none ! important; bottom: auto ! important; box-sizing: content-box ! important; color: rgb(0, 102, 153) ! important; float: none ! important; font-style: normal ! important; font-weight: bold ! important; height: auto ! important; left: auto ! important; line-height: 1.1em ! important; margin: 0px ! important; min-height: auto ! important; outline: 0px none ! important; overflow: visible ! important; padding: 0px ! important; position: static ! important; right: auto ! important; text-align: left ! important; top: auto ! important; vertical-align: baseline ! important; width: auto ! important;">if</code> <code class="csharp plain" style="background: transparent none repeat scroll 0% 0% ! important; border-radius: 0px ! important; border: 0px none ! important; bottom: auto ! important; box-sizing: content-box ! important; color: black ! important; float: none ! important; font-style: normal ! important; font-weight: normal ! important; height: auto ! important; left: auto ! important; line-height: 1.1em ! important; margin: 0px ! important; min-height: auto ! important; outline: 0px none ! important; overflow: visible ! important; padding: 0px ! important; position: static ! important; right: auto ! important; text-align: left ! important; top: auto ! important; vertical-align: baseline ! important; width: auto ! important;">(!IsAjaxRequest(ctx.Request))</code></span></span></div>
<div class="line number27 index26 alt2" style="background: white none repeat scroll 0% 0% ! important; border-radius: 0px ! important; border: 0px none ! important; bottom: auto ! important; box-sizing: content-box ! important; color: #333333; float: none ! important; font-style: normal; font-variant: normal; font-weight: normal; height: auto ! important; left: auto ! important; letter-spacing: normal; line-height: 15.4px; margin: 0px ! important; min-height: auto ! important; outline: 0px none ! important; overflow: visible ! important; padding: 0px 1em ! important; position: static ! important; right: auto ! important; text-align: left; text-indent: 0px; text-transform: none; top: auto ! important; vertical-align: baseline ! important; white-space: pre ! important; width: auto ! important; word-spacing: 0px;">
<span style="font-size: small;"><span style="font-family: "times" , "times new roman" , serif;"><code class="csharp spaces" style="background: transparent none repeat scroll 0% 0% ! important; border-radius: 0px ! important; border: 0px none ! important; bottom: auto ! important; box-sizing: content-box ! important; float: none ! important; font-style: normal ! important; font-weight: normal ! important; height: auto ! important; left: auto ! important; line-height: 1.1em ! important; margin: 0px ! important; min-height: auto ! important; outline: 0px none ! important; overflow: visible ! important; padding: 0px ! important; position: static ! important; right: auto ! important; text-align: left ! important; top: auto ! important; vertical-align: baseline ! important; width: auto ! important;"> </code><code class="csharp plain" style="background: transparent none repeat scroll 0% 0% ! important; border-radius: 0px ! important; border: 0px none ! important; bottom: auto ! important; box-sizing: content-box ! important; color: black ! important; float: none ! important; font-style: normal ! important; font-weight: normal ! important; height: auto ! important; left: auto ! important; line-height: 1.1em ! important; margin: 0px ! important; min-height: auto ! important; outline: 0px none ! important; overflow: visible ! important; padding: 0px ! important; position: static ! important; right: auto ! important; text-align: left ! important; top: auto ! important; vertical-align: baseline ! important; width: auto ! important;">{</code></span></span></div>
<div class="line number28 index27 alt1" style="background: white none repeat scroll 0% 0% ! important; border-radius: 0px ! important; border: 0px none ! important; bottom: auto ! important; box-sizing: content-box ! important; color: #333333; float: none ! important; font-style: normal; font-variant: normal; font-weight: normal; height: auto ! important; left: auto ! important; letter-spacing: normal; line-height: 15.4px; margin: 0px ! important; min-height: auto ! important; outline: 0px none ! important; overflow: visible ! important; padding: 0px 1em ! important; position: static ! important; right: auto ! important; text-align: left; text-indent: 0px; text-transform: none; top: auto ! important; vertical-align: baseline ! important; white-space: pre ! important; width: auto ! important; word-spacing: 0px;">
<span style="font-size: small;"><span style="font-family: "times" , "times new roman" , serif;"><code class="csharp spaces" style="background: transparent none repeat scroll 0% 0% ! important; border-radius: 0px ! important; border: 0px none ! important; bottom: auto ! important; box-sizing: content-box ! important; float: none ! important; font-style: normal ! important; font-weight: normal ! important; height: auto ! important; left: auto ! important; line-height: 1.1em ! important; margin: 0px ! important; min-height: auto ! important; outline: 0px none ! important; overflow: visible ! important; padding: 0px ! important; position: static ! important; right: auto ! important; text-align: left ! important; top: auto ! important; vertical-align: baseline ! important; width: auto ! important;"> </code><code class="csharp plain" style="background: transparent none repeat scroll 0% 0% ! important; border-radius: 0px ! important; border: 0px none ! important; bottom: auto ! important; box-sizing: content-box ! important; color: black ! important; float: none ! important; font-style: normal ! important; font-weight: normal ! important; height: auto ! important; left: auto ! important; line-height: 1.1em ! important; margin: 0px ! important; min-height: auto ! important; outline: 0px none ! important; overflow: visible ! important; padding: 0px ! important; position: static ! important; right: auto ! important; text-align: left ! important; top: auto ! important; vertical-align: baseline ! important; width: auto ! important;">ctx.Response.Redirect(ctx.RedirectUri);</code></span></span></div>
<div class="line number29 index28 alt2" style="background: white none repeat scroll 0% 0% ! important; border-radius: 0px ! important; border: 0px none ! important; bottom: auto ! important; box-sizing: content-box ! important; color: #333333; float: none ! important; font-style: normal; font-variant: normal; font-weight: normal; height: auto ! important; left: auto ! important; letter-spacing: normal; line-height: 15.4px; margin: 0px ! important; min-height: auto ! important; outline: 0px none ! important; overflow: visible ! important; padding: 0px 1em ! important; position: static ! important; right: auto ! important; text-align: left; text-indent: 0px; text-transform: none; top: auto ! important; vertical-align: baseline ! important; white-space: pre ! important; width: auto ! important; word-spacing: 0px;">
<span style="font-size: small;"><span style="font-family: "times" , "times new roman" , serif;"><code class="csharp spaces" style="background: transparent none repeat scroll 0% 0% ! important; border-radius: 0px ! important; border: 0px none ! important; bottom: auto ! important; box-sizing: content-box ! important; float: none ! important; font-style: normal ! important; font-weight: normal ! important; height: auto ! important; left: auto ! important; line-height: 1.1em ! important; margin: 0px ! important; min-height: auto ! important; outline: 0px none ! important; overflow: visible ! important; padding: 0px ! important; position: static ! important; right: auto ! important; text-align: left ! important; top: auto ! important; vertical-align: baseline ! important; width: auto ! important;"> </code><code class="csharp plain" style="background: transparent none repeat scroll 0% 0% ! important; border-radius: 0px ! important; border: 0px none ! important; bottom: auto ! important; box-sizing: content-box ! important; color: black ! important; float: none ! important; font-style: normal ! important; font-weight: normal ! important; height: auto ! important; left: auto ! important; line-height: 1.1em ! important; margin: 0px ! important; min-height: auto ! important; outline: 0px none ! important; overflow: visible ! important; padding: 0px ! important; position: static ! important; right: auto ! important; text-align: left ! important; top: auto ! important; vertical-align: baseline ! important; width: auto ! important;">}</code></span></span></div>
<div class="line number30 index29 alt1" style="background: white none repeat scroll 0% 0% ! important; border-radius: 0px ! important; border: 0px none ! important; bottom: auto ! important; box-sizing: content-box ! important; color: #333333; float: none ! important; font-style: normal; font-variant: normal; font-weight: normal; height: auto ! important; left: auto ! important; letter-spacing: normal; line-height: 15.4px; margin: 0px ! important; min-height: auto ! important; outline: 0px none ! important; overflow: visible ! important; padding: 0px 1em ! important; position: static ! important; right: auto ! important; text-align: left; text-indent: 0px; text-transform: none; top: auto ! important; vertical-align: baseline ! important; white-space: pre ! important; width: auto ! important; word-spacing: 0px;">
<span style="font-size: small;"><span style="font-family: "times" , "times new roman" , serif;"><code class="csharp spaces" style="background: transparent none repeat scroll 0% 0% ! important; border-radius: 0px ! important; border: 0px none ! important; bottom: auto ! important; box-sizing: content-box ! important; float: none ! important; font-style: normal ! important; font-weight: normal ! important; height: auto ! important; left: auto ! important; line-height: 1.1em ! important; margin: 0px ! important; min-height: auto ! important; outline: 0px none ! important; overflow: visible ! important; padding: 0px ! important; position: static ! important; right: auto ! important; text-align: left ! important; top: auto ! important; vertical-align: baseline ! important; width: auto ! important;"> </code><code class="csharp plain" style="background: transparent none repeat scroll 0% 0% ! important; border-radius: 0px ! important; border: 0px none ! important; bottom: auto ! important; box-sizing: content-box ! important; color: black ! important; float: none ! important; font-style: normal ! important; font-weight: normal ! important; height: auto ! important; left: auto ! important; line-height: 1.1em ! important; margin: 0px ! important; min-height: auto ! important; outline: 0px none ! important; overflow: visible ! important; padding: 0px ! important; position: static ! important; right: auto ! important; text-align: left ! important; top: auto ! important; vertical-align: baseline ! important; width: auto ! important;">}</code></span></span></div>
<div class="line number31 index30 alt2" style="background: white none repeat scroll 0% 0% ! important; border-radius: 0px ! important; border: 0px none ! important; bottom: auto ! important; box-sizing: content-box ! important; color: #333333; float: none ! important; font-style: normal; font-variant: normal; font-weight: normal; height: auto ! important; left: auto ! important; letter-spacing: normal; line-height: 15.4px; margin: 0px ! important; min-height: auto ! important; outline: 0px none ! important; overflow: visible ! important; padding: 0px 1em ! important; position: static ! important; right: auto ! important; text-align: left; text-indent: 0px; text-transform: none; top: auto ! important; vertical-align: baseline ! important; white-space: pre ! important; width: auto ! important; word-spacing: 0px;">
<span style="font-size: small;"><span style="font-family: "times" , "times new roman" , serif;"><code class="csharp plain" style="background: transparent none repeat scroll 0% 0% ! important; border-radius: 0px ! important; border: 0px none ! important; bottom: auto ! important; box-sizing: content-box ! important; color: black ! important; float: none ! important; font-style: normal ! important; font-weight: normal ! important; height: auto ! important; left: auto ! important; line-height: 1.1em ! important; margin: 0px ! important; min-height: auto ! important; outline: 0px none ! important; overflow: visible ! important; padding: 0px ! important; position: static ! important; right: auto ! important; text-align: left ! important; top: auto ! important; vertical-align: baseline ! important; width: auto ! important;">}</code></span></span></div>
<span style="font-size: small;"><code class="csharp plain" style="background: transparent none repeat scroll 0% 0% ! important; border-radius: 0px ! important; border: 0px none ! important; bottom: auto ! important; box-sizing: content-box ! important; color: black ! important; float: none ! important; font-family: Consolas,"Bitstream Vera Sans Mono","Courier New",Courier,monospace ! important; font-style: normal; font-variant: normal; font-weight: normal; height: auto ! important; left: auto ! important; letter-spacing: normal; line-height: 15.4px; margin: 0px ! important; min-height: auto ! important; outline: 0px none ! important; overflow: visible ! important; padding: 0px ! important; position: static ! important; right: auto ! important; text-align: left; text-indent: 0px; text-transform: none; top: auto ! important; vertical-align: baseline ! important; white-space: pre; width: auto ! important; word-spacing: 0px;"><span style="font-family: "verdana" , sans-serif;"><br /></span></code></span>
<span style="font-size: small;"><code class="csharp plain" style="background: transparent none repeat scroll 0% 0% ! important; border-radius: 0px ! important; border: 0px none ! important; bottom: auto ! important; box-sizing: content-box ! important; color: black ! important; float: none ! important; font-family: Consolas,"Bitstream Vera Sans Mono","Courier New",Courier,monospace ! important; font-style: normal; font-variant: normal; font-weight: normal; height: auto ! important; left: auto ! important; letter-spacing: normal; line-height: 15.4px; margin: 0px ! important; min-height: auto ! important; outline: 0px none ! important; overflow: visible ! important; padding: 0px ! important; position: static ! important; right: auto ! important; text-align: left; text-indent: 0px; text-transform: none; top: auto ! important; vertical-align: baseline ! important; white-space: pre; width: auto ! important; word-spacing: 0px;"><span style="font-family: "verdana" , sans-serif;">Also, in your filter I suggest you do something like this:</span></code></span><br />
<br />
<span style="font-size: small;"><code class="csharp plain" style="background: transparent none repeat scroll 0% 0% ! important; border-radius: 0px ! important; border: 0px none ! important; bottom: auto ! important; box-sizing: content-box ! important; color: black ! important; float: none ! important; font-family: Consolas,"Bitstream Vera Sans Mono","Courier New",Courier,monospace ! important; font-style: normal; font-variant: normal; font-weight: normal; height: auto ! important; left: auto ! important; letter-spacing: normal; line-height: 15.4px; margin: 0px ! important; min-height: auto ! important; outline: 0px none ! important; overflow: visible ! important; padding: 0px ! important; position: static ! important; right: auto ! important; text-align: left; text-indent: 0px; text-transform: none; top: auto ! important; vertical-align: baseline ! important; white-space: pre; width: auto ! important; word-spacing: 0px;"><span style="font-family: "verdana" , sans-serif;"><span style="font-family: "times" , "times new roman" , serif;"><br /> if (filterContext.HttpContext.Request.IsAjaxRequest())<br /> {<br /> filterContext.HttpContext.Items["RequestWasNotAuthorized"] = true;<br /> filterContext.HttpContext.Response.StatusCode = 401;<br /> filterContext.HttpContext.Response.End();<br /> filterContext.Result = new HttpUnauthorizedResult();<br /> }</span></span></code></span><br />
<span style="font-size: small;"><code class="csharp plain" style="background: transparent none repeat scroll 0% 0% ! important; border-radius: 0px ! important; border: 0px none ! important; bottom: auto ! important; box-sizing: content-box ! important; color: black ! important; float: none ! important; font-family: Consolas,"Bitstream Vera Sans Mono","Courier New",Courier,monospace ! important; font-style: normal; font-variant: normal; font-weight: normal; height: auto ! important; left: auto ! important; letter-spacing: normal; line-height: 15.4px; margin: 0px ! important; min-height: auto ! important; outline: 0px none ! important; overflow: visible ! important; padding: 0px ! important; position: static ! important; right: auto ! important; text-align: left; text-indent: 0px; text-transform: none; top: auto ! important; vertical-align: baseline ! important; white-space: pre; width: auto ! important; word-spacing: 0px;"><span style="font-family: "verdana" , sans-serif;"><br /></span></code></span>
<span style="font-size: small;"><code class="csharp plain" style="background: transparent none repeat scroll 0% 0% ! important; border-radius: 0px ! important; border: 0px none ! important; bottom: auto ! important; box-sizing: content-box ! important; color: black ! important; float: none ! important; font-family: Consolas,"Bitstream Vera Sans Mono","Courier New",Courier,monospace ! important; font-style: normal; font-variant: normal; font-weight: normal; height: auto ! important; left: auto ! important; letter-spacing: normal; line-height: 15.4px; margin: 0px ! important; min-height: auto ! important; outline: 0px none ! important; overflow: visible ! important; padding: 0px ! important; position: static ! important; right: auto ! important; text-align: left; text-indent: 0px; text-transform: none; top: auto ! important; vertical-align: baseline ! important; white-space: pre; width: auto ! important; word-spacing: 0px;"><span style="font-family: "verdana" , sans-serif;">And then handle it in JavaScript like this:</span></code></span><br />
<span style="font-size: small;"><code class="csharp plain" style="background: transparent none repeat scroll 0% 0% ! important; border-radius: 0px ! important; border: 0px none ! important; bottom: auto ! important; box-sizing: content-box ! important; color: black ! important; float: none ! important; font-family: Consolas,"Bitstream Vera Sans Mono","Courier New",Courier,monospace ! important; font-style: normal; font-variant: normal; font-weight: normal; height: auto ! important; left: auto ! important; letter-spacing: normal; line-height: 15.4px; margin: 0px ! important; min-height: auto ! important; outline: 0px none ! important; overflow: visible ! important; padding: 0px ! important; position: static ! important; right: auto ! important; text-align: left; text-indent: 0px; text-transform: none; top: auto ! important; vertical-align: baseline ! important; white-space: pre; width: auto ! important; word-spacing: 0px;"><span style="font-family: "verdana" , sans-serif;"><br /></span></code></span>
<span style="font-size: small;"><code class="csharp plain" style="background: transparent none repeat scroll 0% 0% ! important; border-radius: 0px ! important; border: 0px none ! important; bottom: auto ! important; box-sizing: content-box ! important; color: black ! important; float: none ! important; font-family: Consolas,"Bitstream Vera Sans Mono","Courier New",Courier,monospace ! important; font-style: normal; font-variant: normal; font-weight: normal; height: auto ! important; left: auto ! important; letter-spacing: normal; line-height: 15.4px; margin: 0px ! important; min-height: auto ! important; outline: 0px none ! important; overflow: visible ! important; padding: 0px ! important; position: static ! important; right: auto ! important; text-align: left; text-indent: 0px; text-transform: none; top: auto ! important; vertical-align: baseline ! important; white-space: pre; width: auto ! important; word-spacing: 0px;"><span style="font-family: "verdana" , sans-serif;"><span style="font-family: "times" , "times new roman" , serif;">$(document).ajaxError(function (xhr, props) {<br /> if (props.status === 401) {<br /> location.reload();<br /> }<br />});</span></span></code></span><br />
<span style="font-size: small;"><code class="csharp plain" style="background: transparent none repeat scroll 0% 0% ! important; border-radius: 0px ! important; border: 0px none ! important; bottom: auto ! important; box-sizing: content-box ! important; color: black ! important; float: none ! important; font-family: Consolas,"Bitstream Vera Sans Mono","Courier New",Courier,monospace ! important; font-style: normal; font-variant: normal; font-weight: normal; height: auto ! important; left: auto ! important; letter-spacing: normal; line-height: 15.4px; margin: 0px ! important; min-height: auto ! important; outline: 0px none ! important; overflow: visible ! important; padding: 0px ! important; position: static ! important; right: auto ! important; text-align: left; text-indent: 0px; text-transform: none; top: auto ! important; vertical-align: baseline ! important; white-space: pre; width: auto ! important; word-spacing: 0px;"><span style="font-family: "verdana" , sans-serif;"><br /></span></code></span>
<span style="font-size: small;"><code class="csharp plain" style="background: transparent none repeat scroll 0% 0% ! important; border-radius: 0px ! important; border: 0px none ! important; bottom: auto ! important; box-sizing: content-box ! important; color: black ! important; float: none ! important; font-family: Consolas,"Bitstream Vera Sans Mono","Courier New",Courier,monospace ! important; font-style: normal; font-variant: normal; font-weight: normal; height: auto ! important; left: auto ! important; letter-spacing: normal; line-height: 15.4px; margin: 0px ! important; min-height: auto ! important; outline: 0px none ! important; overflow: visible ! important; padding: 0px ! important; position: static ! important; right: auto ! important; text-align: left; text-indent: 0px; text-transform: none; top: auto ! important; vertical-align: baseline ! important; white-space: pre; width: auto ! important; word-spacing: 0px;"><span style="font-family: "verdana" , sans-serif;">More information on the error can be found<span style="font-family: "verdana" , sans-serif;"> here:</span></span></code></span><br />
<a href="http://kevin-junghans.blogspot.mx/2013/12/returning-401-http-status-code-on.html"><span style="font-size: small;"><code class="csharp plain" style="background: transparent none repeat scroll 0% 0% ! important; border-radius: 0px ! important; border: 0px none ! important; bottom: auto ! important; box-sizing: content-box ! important; color: black ! important; float: none ! important; font-family: Consolas,"Bitstream Vera Sans Mono","Courier New",Courier,monospace ! important; font-style: normal; font-variant: normal; font-weight: normal; height: auto ! important; left: auto ! important; letter-spacing: normal; line-height: 15.4px; margin: 0px ! important; min-height: auto ! important; outline: 0px none ! important; overflow: visible ! important; padding: 0px ! important; position: static ! important; right: auto ! important; text-align: left; text-indent: 0px; text-transform: none; top: auto ! important; vertical-align: baseline ! important; white-space: pre; width: auto ! important; word-spacing: 0px;"><span style="font-family: "verdana" , sans-serif;"><span style="font-family: "verdana" , sans-serif;">http://kevin-junghans.blogspot.mx/2013/12/returning-401-http-status-code-on.html</span></span></code></span></a><br />
<a href="https://brockallen.com/2013/10/27/using-cookie-authentication-middleware-with-web-api-and-401-response-codes/"><span style="font-size: small;"><code class="csharp plain" style="background: transparent none repeat scroll 0% 0% ! important; border-radius: 0px ! important; border: 0px none ! important; bottom: auto ! important; box-sizing: content-box ! important; color: black ! important; float: none ! important; font-family: Consolas,"Bitstream Vera Sans Mono","Courier New",Courier,monospace ! important; font-style: normal; font-variant: normal; font-weight: normal; height: auto ! important; left: auto ! important; letter-spacing: normal; line-height: 15.4px; margin: 0px ! important; min-height: auto ! important; outline: 0px none ! important; overflow: visible ! important; padding: 0px ! important; position: static ! important; right: auto ! important; text-align: left; text-indent: 0px; text-transform: none; top: auto ! important; vertical-align: baseline ! important; white-space: pre; width: auto ! important; word-spacing: 0px;"><span style="font-family: "verdana" , sans-serif;"><span style="font-family: "verdana" , sans-serif;">https://brockallen.com/2013/10/27/using-cookie-authentication-middleware-with-web-api-and-401-response-codes/</span></span></code></span></a><br />
<br />Rodolfohttp://www.blogger.com/profile/16896641814844792472noreply@blogger.com0tag:blogger.com,1999:blog-704474923011343546.post-72039292041237419142016-06-15T10:04:00.001-07:002016-06-15T10:04:50.708-07:00A connection was successfully established with the server, but then an error occurred during the login process. (provider: Shared Memory Provider, error: 0 - The handle is invalid.)<span style="font-family: Verdana,sans-serif;">The solution is simple, just reset IIS. If that doesn't work, this SO question will help</span><br />
<span style="font-family: Verdana,sans-serif;"><br /></span>
<span style="font-family: Verdana,sans-serif;">http://stackoverflow.com/questions/3270199/a-connection-was-successfully-established-with-the-server-but-then-an-error-occ</span><br />
<span style="font-family: Verdana,sans-serif;"><br /></span>
<span style="font-family: Verdana,sans-serif;"><br /></span>Rodolfohttp://www.blogger.com/profile/16896641814844792472noreply@blogger.com0tag:blogger.com,1999:blog-704474923011343546.post-58232102329279627112016-05-15T19:20:00.000-07:002016-05-15T19:20:05.169-07:00Run Visual Studio as an administrator all the time<span style="font-family: Verdana, sans-serif;">Why is it that right-clicking the Visual Studio icon and then clicking Visual studio opens the application as an administrator (after you configure it this way in the properties window) but right-clicking the Visual Studio icon and then clicking a project doesn't? In Windows 8 and 10 you have to follow a few more steps as defined here (</span><span style="background-color: white; color: #222222; font-family: Verdana, sans-serif; font-size: inherit; font-weight: inherit;">http://stackoverflow</span><wbr style="background-color: white; color: #222222; font-family: Verdana, sans-serif; font-size: inherit; font-weight: inherit;"></wbr><span style="background-color: white; color: #222222; font-family: Verdana, sans-serif; font-size: inherit; font-weight: inherit;">.com/questions/96548</span><wbr style="background-color: white; color: #222222; font-family: Verdana, sans-serif; font-size: inherit; font-weight: inherit;"></wbr><span style="background-color: white; color: #222222; font-family: Verdana, sans-serif; font-size: inherit; font-weight: inherit;">33/how-to-run-visual</span><wbr style="background-color: white; color: #222222; font-family: Verdana, sans-serif; font-size: inherit; font-weight: inherit;"></wbr><span style="background-color: white; color: #222222; font-family: Verdana, sans-serif; font-size: inherit; font-weight: inherit;">-studio-as-administr</span><wbr style="background-color: white; color: #222222; font-family: Verdana, sans-serif; font-size: inherit; font-weight: inherit;"></wbr><span style="background-color: white; color: #222222; font-family: Verdana, sans-serif; font-size: inherit; font-weight: inherit;">ator-by-default)</span><br />
<br />
<div style="background-color: white; border: 0px; clear: both; color: #242729; font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; font-size: 15px; line-height: 19.5px; margin-bottom: 1em; padding: 0px;">
Right-click devenv.exe and select "Troubleshoot compatibility".</div>
<ol style="background-color: white; border: 0px; color: #242729; font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; font-size: 15px; line-height: 19.5px; margin: 0px 0px 1em 30px; padding: 0px;">
<li style="border: 0px; margin: 0px 0px 0.5em; padding: 0px; word-wrap: break-word;"><div style="border: 0px; clear: both; padding: 0px;">
select "Troubleshoot program"</div>
</li>
<li style="border: 0px; margin: 0px 0px 0.5em; padding: 0px; word-wrap: break-word;"><div style="border: 0px; clear: both; padding: 0px;">
check "The program requires additional permissions" click "Next", click "Test the program..."</div>
</li>
<li style="border: 0px; margin: 0px 0px 0.5em; padding: 0px; word-wrap: break-word;"><div style="border: 0px; clear: both; padding: 0px;">
wait for the program to launch</div>
</li>
<li style="border: 0px; margin: 0px 0px 0.5em; padding: 0px; word-wrap: break-word;"><div style="border: 0px; clear: both; padding: 0px;">
click "Next"</div>
</li>
<li style="border: 0px; margin: 0px 0px 0.5em; padding: 0px; word-wrap: break-word;"><div style="border: 0px; clear: both; padding: 0px;">
select "Yes, save these settings for this program"</div>
</li>
<li style="border: 0px; margin: 0px; padding: 0px; word-wrap: break-word;"><div style="border: 0px; clear: both; padding: 0px;">
click "Close"</div>
</li>
</ol>
<div>
<span style="font-family: Verdana, sans-serif;"><span class="J-J5-Ji" id=":re" style="background-color: white; color: #222222; display: inline-block; font-size: 17.6px; position: relative;"></span></span><br />
<div aria-label="Important mainly because of the people in the conversation." class="pG" data-tooltip-align="b,l" data-tooltip-contained="true" data-tooltip-delay="1500" id=":n7" role="img" style="cursor: pointer; display: inline-block; font-size: 0px; height: 19px; margin-bottom: -4px; margin-right: 13px; padding: 0px 7px 0px 10px; width: 19px;">
<span style="font-family: Verdana, sans-serif;"><br /></span></div>
<br /></div>
Rodolfohttp://www.blogger.com/profile/16896641814844792472noreply@blogger.com0tag:blogger.com,1999:blog-704474923011343546.post-41855432308426928862016-04-13T13:24:00.000-07:002016-04-13T13:24:14.521-07:00Entity Framework - Store update, insert, or delete statement affected an unexpected number of rows (0)<span style="font-family: Verdana,sans-serif;">This error can have several causes, in my case it was that I had forgotten to create the PK and identity columns in a table. More complex causes can be found here http://stackoverflow.com/questions/1836173/entity-framework-store-update-insert-or-delete-statement-affected-an-unexpec</span><br />
<span style="font-family: Verdana,sans-serif;"><br /></span>Rodolfohttp://www.blogger.com/profile/16896641814844792472noreply@blogger.com0tag:blogger.com,1999:blog-704474923011343546.post-21586739051899395002016-04-09T10:15:00.000-07:002016-04-09T10:15:17.500-07:00PowerShell - "AuthorizationManager check failed" from Octopus Deploy<span style="font-family: Verdana,sans-serif;">I came across this error when trying to run Import-Module in an Octopus Deploy PowerShell script. This script was in the source code. What I end up doing was taking out Import-Module into its own Octopus Deploy step "Run a Script".</span><br />
<span style="font-family: Verdana,sans-serif;"><br /></span>
<span style="font-family: Verdana,sans-serif;">This article also thoroughly explain the reason for the error http://tgnp.me/2011/09/powershell-authorizationmanager-check-failed-resolution/</span><br />
<span style="font-family: Verdana,sans-serif;"><br /></span>
<span style="font-family: Verdana,sans-serif;">In the process, I also learned that Octopus Deploy changes the execution policy of the Powershell process to unrestricted.</span>Rodolfohttp://www.blogger.com/profile/16896641814844792472noreply@blogger.com0