Quantcast
Channel: ASP.NET MVC / Web API / Web Pages
Viewing all 7925 articles
Browse latest View live

Commented Unassigned: Azure Web Role continuous recycles with MVC 5.2.3 [2265]

$
0
0
I have a web role cloud project using MVC and Web API 5.2.3. It works great when I run locally on my development machine and in the Azure emulator using Azure SDK 2.2 tooling. When I deploy to a Cloud Service instance the role continuously recycles.

I have an older project on MVC 5.0 running in a cloud role just fine, and both use a majority of the same components, except the MVC version. In the MVC 5.2.3 project I have already checked all binding redirects and ensured everything not part of the framework is set to CopyLocal=true. All dependencies match up.

I am able to get a page load of my site in between role recycles, so my app startup works. If I had a dependencies mismatch that wouldn't happen. I have tried RDP into the VM of the cloud role to inspect logs, but I am not able to find any application errors in the logs, rather a bunch of notices about a restart with no indication as to why it is restarting.

Here are my NuGet dependencies (in the recycling project)

<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Antlr" version="3.5.0.2" targetFramework="net451" />
<package id="Candor.Core" version="1.4.1.0" targetFramework="net451" />
<package id="Candor.jQuery.AutoAsync" version="4.0.0.50129" targetFramework="net451" />
<package id="Candor.Security" version="2.4.0.0" targetFramework="net451" />
<package id="Candor.Security.AzureStorageProvider" version="2.3.2.0" targetFramework="net451" />
<package id="Candor.Web.Mvc" version="1.0.3.0" targetFramework="net451" />
<package id="Candor.Web.Mvc.ErrorHandler" version="1.0.0.0" targetFramework="net451" />
<package id="Candor.Web.Mvc.Security" version="2.1.0.0" targetFramework="net451" />
<package id="Candor.WindowsAzure" version="1.3.0.0" targetFramework="net451" />
<package id="Candor.WindowsAzure.Logging.Common" version="1.1.1.0" targetFramework="net451" />
<package id="Common.Logging" version="2.2.0" targetFramework="net451" />
<package id="Common.Logging.Core" version="2.2.0" targetFramework="net451" />
<package id="form2js" version="1.0.0.30224" targetFramework="net451" />
<package id="jQuery" version="2.1.4" targetFramework="net451" />
<package id="jQuery.UI.Combined" version="1.8.20.1" targetFramework="net451" />
<package id="jQuery.Validation" version="1.13.1" targetFramework="net451" />
<package id="MarkdownSharp" version="1.13.0.0" targetFramework="net451" />
<package id="Microsoft.AspNet.Mvc" version="5.2.3" targetFramework="net451" />
<package id="Microsoft.AspNet.Razor" version="3.2.3" targetFramework="net451" />
<package id="Microsoft.AspNet.Web.Optimization" version="1.1.3" targetFramework="net451" />
<package id="Microsoft.AspNet.WebApi" version="5.2.3" targetFramework="net451" />
<package id="Microsoft.AspNet.WebApi.Client" version="5.2.3" targetFramework="net451" />
<package id="Microsoft.AspNet.WebApi.Core" version="5.2.3" targetFramework="net451" />
<package id="Microsoft.AspNet.WebApi.HelpPage" version="5.2.3" targetFramework="net451" />
<package id="Microsoft.AspNet.WebApi.WebHost" version="5.2.3" targetFramework="net451" />
<package id="Microsoft.AspNet.WebPages" version="3.2.3" targetFramework="net451" />
<package id="Microsoft.Data.Edm" version="5.6.0" targetFramework="net451" />
<package id="Microsoft.Data.OData" version="5.6.0" targetFramework="net451" />
<package id="Microsoft.jQuery.Unobtrusive.Validation" version="3.2.3" targetFramework="net451" />
<package id="Microsoft.Web.Infrastructure" version="1.0.0.0" targetFramework="net451" />
<package id="Microsoft.WindowsAzure.ConfigurationManager" version="2.0.1.0" targetFramework="net451" />
<package id="Modernizr" version="2.8.3" targetFramework="net451" />
<package id="Newtonsoft.Json" version="6.0.8" targetFramework="net451" />
<package id="Respond" version="1.4.2" targetFramework="net451" />
<package id="RestSharp" version="105.0.1" targetFramework="net451" />
<package id="System.Spatial" version="5.6.0" targetFramework="net451" />
<package id="T4MVC" version="3.7.4" targetFramework="net451" />
<package id="T4MVCExtensions" version="3.7.4" targetFramework="net451" />
<package id="Twilio" version="4.0.3" targetFramework="net451" />
<package id="Twilio.Mvc" version="3.1.15" targetFramework="net451" />
<package id="Twilio.TwiML" version="3.3.6" targetFramework="net451" />
<package id="WebActivatorEx" version="2.0.6" targetFramework="net451" />
<package id="WebGrease" version="1.6.0" targetFramework="net451" />
<package id="WindowsAzure.Storage" version="2.1.0.3" targetFramework="net451" />
</packages>

I have attached Diagnostics from my RDP session into the VM. Let me know if I missed anything you need. But I don't plan to wait long before I downgrade to MVC 5.2.2.
Comments: See this so thread http://stackoverflow.com/questions/15226494/assembly-binding-redirect-not-working Binding redirects in web.config does not work on a webrole

Created Unassigned: TryGetValue extension re-implemented in WebAPI as internal [2266]

$
0
0
Take the following code in a project that uses __Microsoft.AspNet.WebApi.Core__ where request is HttpRequestMessage

IOwinContext context;
if (!request.Properties.TryGetValue<IOwinContext>(OwinContextKey, out context))
{
...

The call to TryGetValue causes:

Error 2 'System.Collections.Generic.DictionaryExtensions.TryGetValue<T>(System.Collections.Generic.IDictionary<string,object>, string, out T)' is inaccessible due to its protection level

Using Reflector, when I reflect that TryGetValue call I am taken to an extension method in an internal class DictionaryExtensions in:

\trunk\packages\Microsoft.AspNet.WebApi.Core.5.2.3\lib\net45\System.Web.Http.dll

public static bool TryGetValue<T>(this IDictionary<string, object> collection, string key, out T value)
{
object obj2;
if (collection.TryGetValue(key, out obj2) && (obj2 is T))
{
value = (T) obj2;
return true;
}
value = default(T);
return false;
}

But a 'compatible' signature exists on the IDictionary<TKey, TValue> interface in:

C:\Windows\Microsoft.Net\assembly\GAC_64\mscorlib\v4.0_4.0.0.0__b77a5c561934e089\mscorlib.dll

So I can't see the reason for the extension method in WebAPI.

Commented Unassigned: TryGetValue extension re-implemented in WebAPI as internal [2266]

$
0
0
Take the following code in a project that uses __Microsoft.AspNet.WebApi.Core__ where request is HttpRequestMessage

IOwinContext context;
if (!request.Properties.TryGetValue<IOwinContext>(OwinContextKey, out context))
{
...

The call to TryGetValue causes:

Error 2 'System.Collections.Generic.DictionaryExtensions.TryGetValue<T>(System.Collections.Generic.IDictionary<string,object>, string, out T)' is inaccessible due to its protection level

Using Reflector, when I reflect that TryGetValue call I am taken to an extension method in an internal class DictionaryExtensions in:

\trunk\packages\Microsoft.AspNet.WebApi.Core.5.2.3\lib\net45\System.Web.Http.dll

public static bool TryGetValue<T>(this IDictionary<string, object> collection, string key, out T value)
{
object obj2;
if (collection.TryGetValue(key, out obj2) && (obj2 is T))
{
value = (T) obj2;
return true;
}
value = default(T);
return false;
}

But a 'compatible' signature exists on the IDictionary<TKey, TValue> interface in:

C:\Windows\Microsoft.Net\assembly\GAC_64\mscorlib\v4.0_4.0.0.0__b77a5c561934e089\mscorlib.dll

So I can't see the reason for the extension method in WebAPI.
Comments: Maybe I can see a reason for it, it might work differently, but if so it would warrant a new name.

Commented Issue: Should not multi-select items in a drop-down list [1349]

$
0
0
`DropDownList()` and `DropDownListFor()` generate `<select/>` elements without the `multiple` attribute. Nonetheless the returned HTML may contain multiple `<option/>` elements with `selected="selected"` attributes. This is an HTML violation.

See for example the [HTML5 spec](http://dev.w3.org/html5/markup/select.html#select-constraints): "The select element cannot have more than one selected option element descendant unless the multiple attribute is specified."

The problem occurs if the provided select list includes multiple items with the same `Value` property and the expression matches that `Value`. Though my example uses an `enum` to generate the select list, this problem is not specific to `enum` support.

At least IE and Chrome are willing to display such a `<select/>` element and both select the last selected item as the one true selection.

Fix would be in `SelectExtensions.GetSelectListWithDefaultValue()`. If `allowMultiple` is `false`, that method should set `item.Selected` to `true` at most once. It should go through the `selectList` in reverse order to avoid compatibility issues -- matching the current browser behavior.

For example, my example app uses a select list with "One" and "OneAndABit" items that both have the `Value` "1". When the drop down is generated for the value "1", we generate the following:
```
<select id="MyString" name="MyString"><option value="0">Zero</option>
<option selected="selected" value="1">One</option>
<option selected="selected" value="1">OneAndABit</option>
<option value="2">Two</option>
<option value="3">Three</option>
</select>
```

Comments: I have also found that multiple items are selected in the dropdownlistfor if the only difference between the values is their case. Believe the issue is with the GetSelectListWithDefaultValues method in SelectExtensions.cs where it checks if the defaultValue array contains the selectlistitem value. ``` HashSet<string> selectedValues = new HashSet<string>(values, StringComparer.OrdinalIgnoreCase); List<SelectListItem> newSelectList = new List<SelectListItem>(); foreach (SelectListItem item in selectList) { item.Selected = (item.Value != null) ? selectedValues.Contains(item.Value) : selectedValues.Contains(item.Text); newSelectList.Add(item); } ``` This will select both "E" and "e" in the selectList even if allowMultiple is set to false.

Reviewed: v5.2 RTM (6月 10, 2015)

$
0
0
Rated 1 Stars (out of 5) - good,but where is the download link?

Created Unassigned: include *.nuspec files to build nuget packages [2267]

$
0
0
I have made some changes in source code of http://aspnetwebstack.codeplex.com.
Please add *.nuspec files in source code so it is possible to build nuget packages out of it.

Created Unassigned: Cookie parsing doesn't handle '=' in cookie values [2268]

$
0
0
Problem: when a cookie contains a value with an equal sign in it, the GetCookies() extension method will only return the part of the value up to the equal sign.

Example:
Cookie: myKey=A value with = in it; mySecondKey=blahblah

The GetCookies("myKey") will return 'A value with ' instead of 'A value with = in it'

The problem is in the ParseCookieSegment-method where this line will cause the cut-off:

```
string[] nameValue = segment.Split(nameValueSeparator, 2);
```
Normally you won't put an equal sign in a cookie value, except when the value is Base64 encoded where the string will be padded with equal sign to make the length of the string dividable by 4.

Edited Unassigned: Cookie parsing doesn't handle '=' in cookie values [2268]

$
0
0
Problem: when a cookie contains a value with an equal sign in it, the GetCookies() extension method will only return the part of the value up to the equal sign.

Example:
Cookie: myKey=A value with = in it; mySecondKey=blahblah

The GetCookies("myKey") will return 'A value with ' instead of 'A value with = in it'

The problem is in the ParseCookieSegment-method in System.Net.Http.Headers.CookieHeaderValue where this line will cause the cut-off:

```
string[] nameValue = segment.Split(nameValueSeparator, 2);
```
Normally you won't put an equal sign in a cookie value, except when the value is Base64 encoded where the string will be padded with equal sign to make the length of the string dividable by 4.

Edited Unassigned: Cookie parsing doesn't handle '=' in cookie values [2268]

$
0
0
Problem: when a cookie contains a value with an equal sign in it, the GetCookies() extension method will only return the part of the value up to the equal sign.

Example:
Cookie: myKey=ValueWith=InIt; mySecondKey=blahblah

The GetCookies("myKey") will return 'ValueWith' instead of 'ValueWith=InIt'

The problem is in the ParseCookieSegment-method in System.Net.Http.Headers.CookieHeaderValue where this line will cause the cut-off:

```
string[] nameValue = segment.Split(nameValueSeparator, 2);
```
And also in the System.Net.Http.Formatting.FormDataCollection, which seems to be doing some funky stuff...

Normally you won't put an equal sign in a cookie value, except when the value is Base64 encoded where the string will be padded with equal sign to make the length of the string dividable by 4. But as far as I have been able to figure out, the use of equal signs in the cookie value is not prohobited and the cookie handling in Asp.Net should respect this.

New Post: Fail to print test run summary when running build.cmd

$
0
0
Hi,

When running the 'build.cmd' everything runs fine and I can successfully build and run all tests. However I'm getting this error at the end of the build;

Runtime.msbuild(121,5): error : Input string was not in a correct format.

When looking at the msbuild file it seems like it is this line which fails;
<PrintTestRunSummary TestResultsDirectory="$(TestResultsDirectory)" />
Anyone else experiencing this?

sincerely,

Kjetil Klaussen

Commented Issue: Support external creation of IEdmModel [802]

$
0
0
Currently for an IEdmModel to be used with the ODataMediaTypeFormatters, it MUST be built using an ODataModelBuilder. This is because the formatters require an annotation on IEdmEntitySet using a class called EntitySetLinkBuilderAnnotation, and this class is internal.

However there are clearly scenarios where people want to create there own IEdmModel. For example from:
- DbContext
- IDataServiceMetadataProvider

I see a layered solution.

First make EntitySetLinkBuilderAnnotation public, and give it a constructor that doesn't require an EntitySetConfiguration (you don't necessarily have one of those).
Second make the Formatter annotate the model if an EntitySetLinkBuilderAnnotation is not found, this way if a service follows conventions (most do) then you don't need to annotate the IEdmModel you build at all.

The first part has already been completed with this [commit](https://aspnetwebstack.codeplex.com/SourceControl/changeset/bd007387c45bf3f7f1b3b9ced7b476e601190b58)


Comments: 1. Does this work for OData v4? The namespaces have changed, and now there is a new `OData.Edm.IEdmModel` that I can't see any way to generate directly from a `DbContext`. Serializing the EDM model from Entity Framework, then reserializing using the `TryParse` method on `EdmxReader` doesn't seem to work (you get a serialization exception).

Commented Feature: OData V4 service should support DateTime [2072]

$
0
0
OData V4 should support DateTime or you should give the developer a way of converting datatime to datetimeoffset when the service is called.
I have several serializable objects that are in 3rd party libraries (even Microsoft core classes) that have datatime properties that will not be exposable through OData V4 services.

here is OASIS meeting showing that Edm.DateTime was discussed as adding back but then was "defer this to a future version"?
https://issues.oasis-open.org/browse/ODATA-220



Comments: I love what oData is meant to do, but it's been an uphill battle for us to adopt v4 in the practical sense. Removing DateTime instead of depreciating it doesn't give anyone time to make the adjustment and just outright breaks existing functionalities. Even with the release of 5.6, we're still required to use a date time offset format on the client-side, otherwise the server-side objects just don't get deserialized (resulting in a null object). Please reinstate DateTime even if you leave it depreciated. We've been migrating from standard REST to oData, and DateTime was a bit part of the previous infrastructure done in Web API (and it just works). Moving to oData should be as simple as adding a new controller and changing the URI calls. We should be able to use our existing entities (which use DateTimes) and not worry about refactoring all the client-side code to use date time offset formats (but with no offset).

Created Unassigned: Support .NET Native for client libraries [2269]

$
0
0
Please make it possible to compile Windows 10 UWP projects in Release ('Compile with .NET Native toolchain' flag) that depends on Microsoft.AspNet.WebApi.Client nuget package. Currently, I'm getting errors like this:

```
NUTC303B:Internal Compiler Error: Please contact Microsoft. Method 'instance $34_System.Threading.Tasks.Task $78_System.Net.Http.HttpContent.SerializeToStreamAsync($16_System.IO.Stream, $46_System.Net.TransportContext)' is missing implementation on type '$105_System.Net.Http.Handlers.ProgressContent' from assembly 'System.Private.CoreLib' while loading type '$105_System.Net.Http.Handlers.ProgressContent' while computing compilation roots.
```


The error occurs in Visual Studio 2015 RC.

Reviewed: v5.0 RTM (六月 24, 2015)

$
0
0
Rated 5 Stars (out of 5) - good!!!!!!!!!!!!!!!!!!!!!!!!!!!

Reviewed: v4.0 RTM (7月 04, 2015)

$
0
0
Rated 5 Stars (out of 5) - dsfdsfdsfdsfs

Reviewed: v5.3 RTM (七月 04, 2015)

$
0
0
Rated 5 Stars (out of 5) - the first time

New Post: ASP.NET AuthorizeAttribute should allow both users and roles

$
0
0
We would like to allow access to a page of our webapp to either a role or a group of users. For example, members of the group Admins should be allowed, in addition to User1 and User2 who are not members of the Admins group. Currently, the AuthorizeAttribute only looks at either roles or users, but not both.

I've added an issue here. I would be more than willing to take this one and submit a patch.

Reviewed: v5.2.2 (7月 11, 2015)

$
0
0
Rated 5 Stars (out of 5) - good!!!!!!!!

Reviewed: v5.3 RTM (ก.ค. 16, 2558)

$
0
0
Rated 4 Stars (out of 5) - thanks, and can i download??

Reviewed: v5.3 RTM (七月 17, 2015)

$
0
0
Rated 5 Stars (out of 5) - very good...
Viewing all 7925 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>