.net-4.5

The type or namespace name 'System' could not be found

雨燕双飞 提交于 2019-12-18 04:28:07
问题 I have the following errors (and more) in all my views (*.cshtml) when opening my project in Visual Studio 2015 Professional. Error CS0246 The type or namespace name 'System' could not be found (are you missing a using directive or an assembly reference?) Severity Code Description Project File Line Error CS0518 Predefined type 'System.Object' is not defined or imported Severity Code Description Project File Line Error CS0518 Predefined type 'System.String' is not defined or imported I got

Where can I download the .NET 4.5 Multitargeting Pack for my build server?

有些话、适合烂在心里 提交于 2019-12-17 23:30:56
问题 I want to build a .net 4.5/VS2012 solution in TeamCity. My builds work on the agent that has VS2012 installed, but on the agent that doesn't have VS2012, I get warnings like this: C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(983,5): warning MSB3644: The reference assemblies for framework ".NETFramework,Version=v4.5" were not found. To resolve this, install the SDK or Targeting Pack for this framework version or retarget your application to a version of the framework

HttpClient: How to upload multiple files at once

烂漫一生 提交于 2019-12-17 22:39:18
问题 I am trying to upload muliple files using System.Net.Http.HttpClient. using (var content = new MultipartFormDataContent()) { content.Add(new StreamContent(imageStream), "image", "image.jpg"); content.Add(new StreamContent(signatureStream), "signature", "image.jpg.sig"); var response = await httpClient.PostAsync(_profileImageUploadUri, content); response.EnsureSuccessStatusCode(); } this only sends mulipart/form-data, but i expected multipart/mixed somewhere in the post. UPDATE: Ok, i got

Visual Studio keeps overwriting NewtonSoft.Json.DLL with an older version

浪尽此生 提交于 2019-12-17 22:18:51
问题 Visual Studio is overwriting the correct version of NewtonSoft.Json.DLL that I have configured in both my project references and the NuGet package file with an older version when I build any other project besides the website that contains the reference. OK. Here is the scenario: I have a solution with a backend service and a website. The website is running on .NET 4.5 and is configured with NuGet to pull in version 6.0.1 of Newtonsoft.Json.DLL. <package id="Newtonsoft.Json" version="6.0.1"

WPF Controls - Should code behind be avoided at all costs?

懵懂的女人 提交于 2019-12-17 21:03:24
问题 I have a WPF project and need to create a control that is specific to the domain but will be reused in multiple views. The control must display a decimal value in 3 parts, the integral part and the decimal part split into 2 with different font sizes. I have a dependency property for the Amount and then split the amount in 3 parts in the code behind so I can show them in the specific labels. I also use the decimal amount to decide whether the amount is going up or down and subsequently change

IE scrambles script in IIS7 with static compression turned on

℡╲_俬逩灬. 提交于 2019-12-17 20:58:03
问题 I am having issues with javascript files not decompressing in IIS7 and stylesheets not loading properly. I can fix this issue by turning off Static compression in IIS but this can't be a permanent solution. The issue has suddenly started happening. We haven't changed the code. The web application is an asp.net web forms app in .net 4. static and dynamic compression was set in IIS. another web forms web application is still running fine with static compression set at the application level. the

There is no argument given that corresponds to the required formal parameter - .NET Error

送分小仙女□ 提交于 2019-12-17 20:35:47
问题 I have been re-factoring one of my old MSSQL Connection helper library and I got the following error: Severity Code Description Project File Line Error CS7036 There is no argument given that corresponds to the required formal parameter 'errorMsg' of 'ErrorEventArg.ErrorEventArg(string, string)' MSSQLTest C:\Users\Administrator\Desktop\MSSQLTest\MSSQLTest\MSSQLConnection.cs 61 This is my code so far: MSSQLConnection.cs using System; using System.Collections.Generic; using System.Data.SqlClient

.Net zlib inflate with .Net 4.5

人盡茶涼 提交于 2019-12-17 20:23:13
问题 According to MSDN in .Net 4.5 System.IO.Compression is based on zlib. I am trying now to change my current interop based reading from a zlib deflated stream from a non .NET server into a BCL based implementation. My implementation looks like this: var enc = new UTF8Encoding(); var readBytes = BufferSizeRaw; var outputBuffer = new byte[BufferSizeRaw]; var networkBuffer = _networkQueue.Take(); var ms = new MemoryStream(networkBuffer.InputBuffer, 0, networkBuffer.UsedLength); using (Stream

MVC4 .NET 4.5 async action method does not redirect

送分小仙女□ 提交于 2019-12-17 19:25:58
问题 I am trying to implement a task action method in my MVC 4 application. Everything works on the back in, but it is not redirecting. public class AccountController : AsyncController { [HttpPost] [AllowAnonymous] public async Task<ActionResult> Login(LoginModel model, string returnUrl) { var client = new ClientHelper("login"); account = await client.CallActionType<LoginModel, Account>(EnumHelpers.HttpType.Post, model); if (account != null) { validLogin = true; } return Redirect(returnUrl); //

Entry point was not found exception

北城余情 提交于 2019-12-17 19:06:25
问题 I have installed vs2012 (11.0.50727.1) , I opened a new MVC4 with .NET 4.5 solution, i create a simple HomeController and as I've wanted to start it locally, i have received this very strange error: How can resolve it? What is this error and why it's happens??? Thank you in advance, for any of your help. Server Error in '/' Application. Entry point was not found. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for