Vinyl Warmth

1

votes
0

answer
80

views

Certificate error on Azure web app with redirect from www to non-www https

I want to redirect any www subdomain requests to domain.co.uk, for example http://www.domain.co.uk https://www.domain.co.uk should redirect to https://domain.co.uk I have an SSL cert in Azure bound to domain.co.uk In the Azure portal, in Custom Domains I have set to HTTPS only In web.config I have...
Vinyl Warmth
1

votes
2

answer
108

views

EF Core - Cannot insert explicit value for identity column SqlException

In my app I am using EF Core to define 2 entities (Code First), Meeting and PostcodeDetail defined as follows: public class Meeting { public int Id { get; set;} public PostcodeDetail PostcodeDetail { get; set; } // other properties removed for brevity } public class PostcodeDetail { public int Id {...
Vinyl Warmth
1

votes
1

answer
786

views

Why am I getting “Unable to load the specified metadata resource” error?

I have an MVC5 web application which I usually develop using my laptop. I am trying to get the app running on my main machine at home for home-working days but have a problem connecting to the local dev database on SQL Server - when I start the app I get the following error: More info 30/11/16: Not...
Vinyl Warmth
1

votes
3

answer
37

views

Why isn't string parameter being routed to an action?

In my MVC5 application I am trying to pass a string to an action. In PodcastsController I have an action called Tagged: public ActionResult Tagged(string tag) { return View(); } For example, if I wanted pass the string Testto the Tagged action, it would look like this in the url: /Podcasts/Tagged/Te...
Vinyl Warmth
1

votes
1

answer
65

views

How do I copy a file to the root dir in my MVC app as part of a VSTS build pipeline?

I want to copy a file test.txt into the root directory of my MVC application as part of our build process. We are using VSTS and in my build definition I have added a task Copy Files In the task I am setting: Source folder to a file in the source eg My Website/test.txt Contents to ** Target folder...
Vinyl Warmth
0

votes
0

answer
0

views

How can I find the total hits for an Elastic NEST query?

In my application I have a query which brings limits the number of hits returned to 50 as follows var response = await client.SearchAsync(s => s .Source(sf => sf .Includes(i => i .Fields( f => f.Title, f => f.PublishDate, f => f.PodcastTitle ) ) .Excludes(e => e .Fields(f => f.Description) ) ) .From...
Vinyl Warmth
1

votes
1

answer
22

views

How can I call an asynchronous method using the Geolocation API?

In my React app I want to be able to call an API endpoint with the current location of the user using the Geolocation API. I have the following method which fires when a user clicks a button findMeetings = async () => { const location = window.navigator && window.navigator.geolocation if (location)...
Vinyl Warmth
5

votes
4

answer
178

views

Why can't I browse to other pages after making an ajax call?

In a legacy MVC 5 web app I want the user to be able to continue browsing after clicking a button which makes an ajax call to a long running action. (Note: The action returns void - I am not interested in the response) When I click the button I am unable to make any other requests until the action c...
Vinyl Warmth
2

votes
1

answer
938

views

Why isn't my Azure WebJob scheduled?

I have an ASP.NET MVC5 application running as an App Service in Azure and want to schedule a WebJob to execute a console app every hour. In the console application I have webjob-publish-settings.json file defined as: { '$schema': 'http://schemastore.org/schemas/json/webjob-publish-settings.json', 'w...
Vinyl Warmth
2

votes
1

answer
1.7k

views

Can't provide NuGet package source credentials to Azure Function

I have an Azure function which has a dependency on a private package feed. I am copying a nuget.config file to the app service which looks like this: Note: I use the first part of my Hotmail account email address as this is the username I use to authenticate to the private feed elsewhere - Visual S...
Vinyl Warmth
1

votes
1

answer
93

views

Serialising XML file to C# objects

I have the following file I need to serialise to objects: 2 Aberconwy LAB 8994 33.00 CON 7924 29.10 Note: the full file can be found here How do I represent this XML as C# objects? So far I've tried Paste Special As XML Classes SimpleXMLToCode But neither give me the correct POCO entities I need.....
Vinyl Warmth
1

votes
4

answer
91

views

Why isn't my jQuery function being executed when a value is greater than?

I have a table with a row defined like this: @Model.Results.Seats Edit: The table values are being updated by ajax calls to an action which is returning data to the table in a partial I want to log to the console when the value is greater than 2, here is the jQuery code I have: $('#to-watch') .chang...
Vinyl Warmth
3

votes
1

answer
635

views

NuGet package copies unmanaged dll to root directory instead of bin

I have an application which uses an unmanaged library libtidy.dll. In our code are using a wrapper TidyManaged to use it. We want to pull in libtidy from our Team Services private package feed for it to be placed in the bin directory To do this I am creating a NuGet package as follows: Create a dir...
Vinyl Warmth
1

votes
2

answer
262

views

How do I have a default selected enum using EnumDropDownListFor?

In my MVC5 app I have a page which shows logs. I have a drop down to filter logging levels, which are: All Debug Error Info I have these defined an an enum called ErrorLevel: public enum ErrorLevel { [Description('All')] All = 0, [Description('Debug')] Debug = 1, [Description('Error')] Error = 2, [...
Vinyl Warmth
5

votes
2

answer
2.9k

views

Using Polly to retry after HttpStatusCode.Unauthorized

I'm making calls to an external API and want to deal with the event that a call returns an Unauthorized HttpResponseMessage. When this happens I want to refresh the access token and make the call again. I'm trying to use Polly with the following code: public async Task MakeGetRequestAsync() { var re...
Vinyl Warmth
2

votes
1

answer
389

views

Should scaling down an Azure app service cause the server to restart?

I just scaled down an Umbraco site running in an Azure app service from S2 to S1 which caused the server to restart. This was a production instance so we need to know if this is what is supposed to happen. I've been unable to find out whether this is the correct behaviour for an app service, or whe...
Vinyl Warmth
3

votes
3

answer
67

views

How can I get this series to a pandas dataframe?

I have some data and after using a groupby function I now have a series that looks like this: year 1997 15 1998 22 1999 24 2000 24 2001 28 2002 11 2003 15 2004 19 2005 10 2006 10 2007 21 2008 26 2009 23 2010 16 2011 33 2012 19 2013 26 2014 25 How...
Vinyl Warmth
3

votes
1

answer
404

views

How do I provide private NuGet feed credentials to an Azure Function?

I am trying to create an Azure function which has dependencies on NuGet packages hosted in a private NuGet feed. This question describes using a nuget.config file which is uploaded to the app service which hosts the function - my nuget.config My function is using this config file as expected, but it...
Vinyl Warmth
3

votes
2

answer
901

views

How can I manage robots.txt in Azure app service with a staging slot

I have an ASP.NET MVC app running in an Azure app service with one staging slot, and a build and release pipeline in VSTS. I want the production instance to have Allow / in robots.txt and Disallow / in the staging slot at all times. Currently we are changing robots.txt manually every time we do a s...
Vinyl Warmth
2

votes
1

answer
362

views

Unable to reference new C# class library project

Background I am working on a reasonably large legacy ASP.NET MVC solution. Currently all of the code resides in just two projects (one containing model first C# generated code, the other containing the rest of the application). Problem I've added 2 projects to the solution - one for unit tests & on...
Vinyl Warmth
2

votes
1

answer
2.6k

views

“The primary reference could not be resolved…” error - which package should I use?

I have an MVC5 application which targets .NET Framework 4.5 & am trying to use SendGrid NuGet package 8.0.4.0 I'm getting this build error: Severity Code Description Project File Line Suppression State Warning The primary reference 'SendGrid, Version=8.0.4.0, Culture=neutral, PublicKey...
Vinyl Warmth
1

votes
1

answer
198

views

Events not firing when value changes in Aurelia app

I have an Aurelia app using Store to manage state between components. In my dropdown component I have validation (not framework validation, just code which should get invoked in the ViewModel on change) which should fire when the value changes: ... In the ViewModel the validation works like this: @...
Vinyl Warmth
8

votes
1

answer
22.8k

views

How do I select and store columns greater than a number in pandas?

I have a pandas DataFrame with a column of integers. I want the rows containing numbers greater than 10. I am able to evaluate True or False but not the actual value, by doing: df['ints'] = df['ints'] > 10 I don't use Python very often so I'm going round in circles with this. I've spent 20 minutes...
Vinyl Warmth
2

votes
1

answer
573

views

How can I read logs written to Azure table storage with Serilog?

I am able to write logs to Azure table storage in my MVC app using AzureTableStorage like this: var storage = CloudStorageAccount .Parse(ConfigurationManager.AppSettings['AzureStorageConnectionString']); string tableName = Constants.AzureLogTableName; _log = new LoggerConfiguration() .WriteTo.AzureT...
Vinyl Warmth
1

votes
0

answer
493

views

Connecting to database with Entity Framework: “A network-related or instance-specific error occurred…”

I have a console application where I am trying to connect to a database using Entity Framework. I have connected to the (LocalDb)\MSSQLLocalDB server in Visual Studio and created a database BabyNamesTest In VisualStudio I have a class library project as the data layer with a context NameContext def...
Vinyl Warmth