w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
  Home » DOTNET » Page 1
Underlying IOException in Azure Service Bus Topics
Fortunately, we found an issue related to that in our project. The problem was in explicit SSLv3 that we applied in our code. After Azure deactivated SSLv3 on Service Bus service our code broken. Good lesson here: never use explicit protocols project wide.

Categories : Dotnet

Calling a .Net function in Python which has a reference parameter
There are two ways you can invoke methods with out or ref parameters from IronPython. In the first case the call is handled by automatic marshalling. The return value and changed refs are wrapped in a tuple and (while having 15.1 as an example double to be passed) can be used like: (returned, referenced) = GetValue(15.1) The more explicit way is providing a prepared clr-reference: refParam =

Categories : Dotnet

ng-repeat from a list of lists
If i get your answer right im doubing you can do that from the view, but perhaps a Watcher in the controller can do the trick, of course this assuming constant changes in your structure of topics ans faqs, something like: assuming a json structure { topics: { id: 1, name: 'asd', FAQs: [{Likes: 324, ...},{...},...] }, {...}, ... } $scope.topics = [...]; // A collection like above $scope.top_faqs

Categories : Dotnet

When consuming RESTful APIs, when do you recommend using RestSharp and when HttpClient?
It largely comes down to personal preference as you surmised. A couple points: RestSharp came out years before HttpClient and was far superior in functionality and ease of use than anything Microsoft put out at the time. HttpClient has a strictly asynchronous (as in async/await) API; RestSharp supports both synchronous and asynchronous calls. But unless you're stuck on an older platform and/or s

Categories : Dotnet

Default members/properties in IronPython
I found a partial solution for boolean statements and expressions: To make variables behave the way I expect them, you only have to implement a special function named __nonzero__(): public bool __nonzero__() { return EqualityComparer<T>.Default.Equals(_value, default(T)) == false; } If the object is now used in boolean statements and expressions, it's value is evaluated instead of ch

Categories : Dotnet

How to design a 3-tier .NET enterprise application using only F#?
I think the question is too broad but you can find a good start at fsharp.org You can start from section 'Guides'-'Enterprise Programming' where you could find recommendation on F# enterprise app architecture. See also fsharp community projects where you can find type providers and other useful libraries. You definitely can use F# at any of 3 tiers but it also plays nicely with other .NET langua

Categories : Dotnet

Set SQL Server time to Entity Framework CreatedOn column
How important actual datetime value is ? If You dont need precisely value You can use : var dQuery =dbContext.CreateQuery<DateTime>("CurrentDateTime() "); DateTime dbDate = oquery.AsEnumerable().First(); Original link: How to ask database server for current datetime using entity framework?

Categories : Dotnet

Regex match character not preceded by
(Revised answer taking into account comments) One thing regular expressions are very poor at is not matching multi-character literals. That is, it's very good at matching "not x" or "not a space", but it's very difficult (and sometimes impossible) to not match a string like "end". That's why my original attempt at this solution didn't even attempt this. Given that you could have strings that s

Categories : Dotnet

How to give user credentials to create a contact in Contact Api V3(.Net)
There are two scenarios here: 1.If you want to add contacts to yourself, then enter the clientid and client secret in the code(which you get when application is registered in the Google developers console) itself. Here is the link for the documentation. 2.When you want to add contacts to the users of your application: Requests to the Google Contacts API for non-public user data must be authoriz

Categories : Dotnet

Change VS platform from 4.0 down to 2.0
I eventually figured out my .NET 2.0 System.Configuration had become broken (anything that used an app.config file). The telltale sign was when I did a fresh install of our released product that works on thousands of computers and it failed the same way as my development code that I was trying to re-target. I restored my computer back to last Thursday and all went fine again. Re-targeting of

Categories : Dotnet

Get value of nested property passed through a lambda expression
I pieced together a solution based on How to evaluate a lambda expression. You can Compile the expression to produce the runnable function inside of it. Dim func = lambda.Compile() Dim output = func(Me) Since I'm still working my way through lambdas, here's a little more by way of explanation: Inside the Expression, we declared the function signature to look like this Func(Of T, Object) Whe

Categories : Dotnet

Decryption with invalid key not always throws CryptographicException
The problem is that the decrypted plaintext has the correct padding about once in eight times. This happens when the decrypted plaintext ends with 01 to 20. The block size of 256 / 32 bytes makes for a valid padding for that particular range. Padding should never be used to verify correctness of ciphertext/plaintext. It is even dangerous to do so as it may lead to padding oracle attacks. Instead

Categories : Dotnet

How to load SOS in Windbg for a 32bit app running on a 64bit server
How did you create the dump file? If you're debugging a 32bit process on 64bit windows you must use the 32bit version of task manager located at C:WindowsSysWOW64 askmgr.exe Then proceed to right click on the process and 'Create Dump File' Once you've taken the correct dump open it in WinDbg (X64) on the machine on which the dump was taken - that is Install windbg on the remote PC if poss

Categories : Dotnet

Upgrade to a specific Package version with NuGet
So I think you need to run the Update-Package command by setting the Version flag. For example: Update-Package Newtonsoft.Json -Version 6.0.4 Here's the full command from the documentation for more reference: Update-Package [-Id] [-IgnoreDependencies] [-ProjectName ] [-Version ] [-Source ] [-Safe] [-IncludePrerelease] [-Reinstall] [-FileConflictAction] [-WhatIf] http://docs.nuget.org/do

Categories : Dotnet

How to change Oracle Exceptions language in .Net/C#?
You should execute ALTER SESSION command. Maybe your API has facade methods for it, but it's an ultimate way for everywhere and always. See example: SQL*Plus: Release 12.1.0.2.0 Production on Thu Dec 11 16:01:02 2014 SQL> conn test/test@soft12c1 Connected. SQL> alter session set nls_language=french; Session altered. SQL> select 1/0 from dual; ERROR at line 1: ORA-01476: le diviseur

Categories : Dotnet

'PostBuildEvent' failed with error code '1' 'Unspecified error' error
If you want to persist this file to the output directory, you may want to check the "Copy to Output Directory" property of the .js file object in the visual studio IDE is set to CopyAlways. That will copy it when the project is built. Other than that, it could be a permissions issue. Have you tried running visual studio by right-clicking then running as admin? And then on the folder location wher

Categories : Dotnet

understanding application memory usage
Question 1 According to Microsoft documentation: Gen 0 displays the maximum bytes that can be allocated in generation 0; it does not indicate the current number of bytes allocated in generation 0. So the #Bytes in all Heaps is equal to Gen 1 heap size, Gen 2 heap size and Large Object heap size. You can do the math. Question 2 Again quoting Microsoft documentation : Virtual memo

Categories : Dotnet

json.net - what data structure would produce JSON in this format?
That specific JSON cannot be directly accomplished with SerializeObject since you have both an array and an object type in the same array in the JSON. Within an array, you cannot mix different types of objects (either object structures or in your case object and arrays).

Categories : Dotnet

HTTP Error 403.14 - Forbidden on MVC deploy to FileZilla
Sorry for late answer..Written to hope help someone who see this question.. Try with web matrix ;) { Once, with a host company which not fully work with Asp.net and MVC (their most hosts are linux-host) i faced same problem and when i tried to deploy with web-matrix-ftp, it worked }

Categories : Dotnet

WebRequest Login
It is still far from a real answer, but it is the much I can do with the informations you have given. Login programmaticaly into a website is always a specific operation. All I can do is tell you how you can guess what you should do. First study how you go to login page. It may be a redirection, or a simple display. It can give indication on what happens, but it does not really matter. But as so

Categories : Dotnet

Threefish block cipher, ECB, .NET implementation: encrypted and decrypted (initial plaintext) strings' lengths are different
If the plaintext is dividable by the block size, then then a full block of padding is added for ECB mode encryption, if PKCS#7 padding is used. The block size of Threefish is 32, 64 or 128 bytes and PKCS#7 padding is the default in .NET. However base 64 expands the result with about 1/3rd plus some possible rounding up, so 12 base 64 characters sounds about right. A block cipher usually does not

Categories : Dotnet

NuGet packages local paths dont update after project folders reorder
You should be able to fix the hint paths by running the following in the Package Manager Console which reinstalls each package in each project: update-package -reinstall The NuGet packages will need to have been restored to the old locations before running this command. I would make sure everything is under version control before running the above command.

Categories : Dotnet

Xamarin: System.Net.Http does not work in unit tests, but works on device
It is trying to find that assembly but cannot load it. Things to check: In your Unit testing project, make sure the reference is exactly the same as the project that works. For the System.Net.Http reference, right click it and check that specific version = false Also have a look in the GAC C:WindowsAssembly and find that dll, right click and check which version it is and that it matches the ve

Categories : Dotnet

ADO .Net - How to specify source IP address in SqlConnection on system with multiple IP addresses
I'm not aware of any settings on the SQLConnection object to specify local IP. However, you can set up a custom Windows Firewall rule to block the remote IP (SQL) for the source IPs (alternate network adapters).

Categories : Dotnet

After updating Entity Framework my CLR StoredProcedure stopped working until I compiled it again
I had a related error some time ago. The thrown error was: Could not load type 'System.ServiceModel.Activation.HttpModule' from assembly 'System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' This error can occurrs when IIS is installed/updated after .NET Framework 4 has been installed, or whether the module Http Activation v3.0 is installed after .NET Frame

Categories : Dotnet

What does the .NET CLR do with the memory overhead in empty types?
Yes, even an empty class requires 4/8 bytes for the section of the object that normally stores the fields of the object. So a completely empty class still takes 4 + 4 + 4 = 12 bytes in 32-bit mode, 8 + 8 + 8 = 24 bytes in 64-bit mode. Those 4/8 extra bytes are simply not used when the object exists. This storage is required when the object is released. It can then become part of the free block

Categories : Dotnet

UI caching with ItemsControl
I've found a solution but at the cost of start-up time. Put the right hand list in an ItemsControl with a Grid as its panel, this will load every item at the start up but with a little change you can make it look just like before: <Grid> <Grid.RowDefinitions> <RowDefinition Height="*"/> </Grid.RowDefinitions> <Grid.ColumnDefinitions> <

Categories : Dotnet

Can be LINQ rewritten to avoid MissingMemberException with 'Option Infer Off'?
Credit goes to – see his comment. I was adding the code into legacy bulky library which needs to have Option Explicit Off, Option Strict Off until rewritten. I forgot they are off and therefore missed some explicit type declarations during coding. After Option Explicit On and Option Strict On and all requested corrections, the entire problem with MissingMemberException went away.

Categories : Dotnet

Asynchronous query from database using c# 4.0
You can grit your teeth and use the Asynchronous Programming Model (APM) that all those async learning materials speak of as a thing of the past. ADO.NET (at least the SQL Server provider) had support for it since .NET 2.0. Specifically, you want the BeginExecute/EndExecute and Cancel methods on the SqlCommand.

Categories : Dotnet

How to sync ProgressBar in a loop
A progressbar always needs some "refresh" time. You can set the value of a Progressbar to a thousand, it needs about 2 seconds to fill up al the way to that value. Try this: For i = 0 to max ProgressBar1.PerformStep() If (i mod 100) = 0 Then Application.Doevents() End If Next Note: i don't condone your way if coding (Control.CheckForIllegalCrossThreadCalls = False) but tha

Categories : Dotnet

ColumnHeaderContainerStyle FontFamily
If there is a better answer I will give it a check According to King King the code in the question works Most likely something in my environment is messing it up And it might be because I am setting the content via code behind binding This is how I got it to work <GridView> <GridView.ColumnHeaderTemplate> <DataTemplate> <TextBlock Style="{StaticResou

Categories : Dotnet

Injecting SignInManager dependency: does not work with Unity, works when using OWIN
Instead of registering IOwinContext in the container, do register IAuthenticationManager: container.RegisterType<IAuthenticationManager>( new InjectionFactory(c => HttpContext.Current.GetOwinContext().Authentication)); And have only one constructor for SignInManager: public ApplicationSignInManager(ApplicationUserManager userManager, IAuthenticationManager authenticati

Categories : Dotnet

Change Label.Text from Main Form
Drill into the InitializeComponent procedure and you will see it is initializing all the controls on the main form. This only needs to be done once from the constructor. Your method of updating the progress form is bogged down in implementation details. As it is, every procedure in any form, module or class which needs to update the progress is obliged to root around in the controls of that for

Categories : Dotnet

PDBs and .NET Framework Debugging Control ini files when DLLs are in the GAC (in Production)
After consulting people at Microsoft it looks like we were doing the right thing, i.e. Putting the pdb and ini files in the gac folders is correct. Also FYI the pdb is loaded (I.e. Performance penalty) whenever the exception.stacktrace is used. Hope it helps! Source: http://blogs.msdn.com/b/visualstudioalm/archive/2015/08/14/debugging-optimized-code.aspx (See comments at the bottom of the art

Categories : Dotnet

Deserialize JSON with dictionary as attribute results in null .NET Dictionary
Providing this for future reference: According to the paragraph below (from Stand-Alone JSON Serialization), it appears WCF cannot directly deserialize a Dictionary<>: Dictionaries are not a way to work directly with JSON. Dictionary may not be supported in the same way in WCF as expected from working with other JSON technologies. For example, if "abc" is mapped to "xyz" and "def" is

Categories : Dotnet

How to use .net to add checkboxes to an Excel spreadsheet?
I'm not familiar with ClosedXML, but I think I understand your client's intent. Instead of offering checkboxes, you could create a blank column that the client can type an 'X' in. You could even use data validation to allow the user to pick the 'X' from a drop-down menu.

Categories : Dotnet

WPF controls look like WinForms - what settings I'm missing?
I'm pretty sure this has to do with Server 2008 R2's use of the classic theme. I would check this blog post here: http://www.kennethham.com/wp/2010/11/force-wpf-to-use-windows-7aero-theming-in-classic-mode/ You need to force the application to use Win7/Aero theming.

Categories : Dotnet

For simple XML, ignore XmlDocument and string parse?
It's always good to use a tool that was created for a particular purpose. In this case, System.Xml. There are several reasons: first of all, it takes a lot of workload away from you (the parsing in this case). Second, it's optimized on a level which you won't be able to do yourself, and will work faster than any custom implementation you would create (Of course, for a simple xml this may not be co

Categories : Dotnet

OpenCover report
The pre-release of OpenCover allows you to accumulate the results of one coverage run into the next. Use -mergeoutput -results:coverage.xml to load a previous coverage.xml and save as an updated version.

Categories : Dotnet




© Copyright 2018 w3hello.com Publishing Limited. All rights reserved.