visual-studio-2010

Installing Entity Framework 4.2 in VS2010

两盒软妹~` 提交于 2020-01-07 02:03:15
问题 Entity Framework templates and menu items generate errors in Visual Studio 2010 Ultimate on 64-bit XP. The "Reverse Engineer Code First" menu item in Visual Studio tells me that version 4.0.0.0 of System.Data.Entity.dll cannot be found in the GAC, as do the item templates. I have run the 4.1 msi, and the 4.2 nuget. As a result I have versions of the dll in the following 7 locations: Windows\Microsoft.NET\Framework\v4.0.30319\ Windows\Microsoft.NET\Framework64\v4.0.30319\ Windows\Microsoft.NET

IsWindow(activeX.GetSafeHwnd()) always false after upgrade to VS2010

試著忘記壹切 提交于 2020-01-07 00:54:44
问题 I have an MFC application that uses an ancient (circa 1999) third-party ActiveX control. Since upgrading the project from VS2008 to VS2010, I'm having problems... In the OnSize handler of the parent dialog IsWindow always returns false for the handle returned by control.GetSafeHwnd(), even when GetSafeHwnd() returns a non-NULL value. The rest of the control's parent dialog is displayed fine, but it doesn't seem to respond to any input. I've seen this article, but GetSafeHwnd() isn't returning

PictureBox Zoom Mode Effect With Graphics Object

生来就可爱ヽ(ⅴ<●) 提交于 2020-01-06 23:48:02
问题 When you load an image into a PictureBox there is a zoom for the image placement, how do I achieve that same effect with a graphics object? 回答1: I think you mean you want to draw some Image yourself in a Rectangle and using some Graphics object like as the PictureBox renders its Image in Zoom mode. Try the following code. I suppose you want to draw the Image on a Form, the drawing code should be added in a Paint event handler of your form: //The Rectangle (corresponds to the PictureBox

Is there a way to make Visual Studio 2010 database projects use DROP and CREATE instead of ALTER for DML

心已入冬 提交于 2020-01-06 19:35:16
问题 When building a deploy script for a Visual Studio 2010 SQL database project, is there any way to instruct the process to use DROP and CREATE for stored procedures and other DML instead of always ALTERing them? As an example, if I change a stored procedure, the deploy script will generate something like this... ALTER PROCEDURE MyProc AS SELECT yadda... I want the deploy script to create something like this instead IF EXISTS MyProc DROP MyProc CREATE PROCEDURE MyProc AS SELECT yadda.... It

How to add a define to an ASP.net solution?

心不动则不痛 提交于 2020-01-06 19:28:33
问题 i can add a define to a WinForms project through the Project Properties : How do i add a define to an ASP.net solution? Update : Here's what Visual Studio 2010 looks like when working in an ASP.net solution: 回答1: Solution Explorer > WebApplicationProject (Name of your Web Application) > Properties > Build: 回答2: Have you tried using the compilerOptions attribute of the compiler v element in web.config ? Like so: <system.codedom> <compilers> <compiler language="c#;cs;csharp" extension=".cs"

Copying entire project structure into another directory using afterbuild task

我是研究僧i 提交于 2020-01-06 18:37:12
问题 I want to use the AfterBuild target for copying the entire project structure into a separate folder. This is the project structure TANKProject | |__TANK.CLI |__TANK.Core |__TANK.Web I want to copy the entire project structure including bin folder and the .sln folder into a location B:\animesh\repos . To do that, I put the following snippet in the AfterBuild target in each .csproj file: <ItemGroup> <_CustomFiles Include="..\TANK.ProjectName\*.*" /> </ItemGroup> <Copy SourceFiles="@(

acessing username in web api controller when database table stores user as integer

跟風遠走 提交于 2020-01-06 18:02:34
问题 Inside some web api controllers, I would like to access the User as indicated in this answer: https://stackoverflow.com/a/12705062/538962 sample code from answer... [Authorize] public List<Product> GetProductsFromId() { string username = User.Identity.Name; return _productService.GetProductsFromUsername(username); } The asp_net membership tables in my scenario are on a different database server than then the database server the application runs on. The database for the application has its own

Windows Forms Designer Custom Control from Label has wrong property value -> designer exception

Deadly 提交于 2020-01-06 17:57:52
问题 I'm actually a bit confused here, I've built a dll with a custom control based on Label with AutoSize fixed as true. I happily used it but the designer created the control with AutoSize still set to true. I changed the dll in an attempt to get the designer to show my control with AutoSize set false and ended up with a thrown exception in the designer. I undid the last change but still got the exception! I couldn't progress until I created a new project from scratch removing all reference to

Why don't I get code coverage results for C++/CLI project in Visual Studio 2010?

我与影子孤独终老i 提交于 2020-01-06 16:22:20
问题 I've recently upgrade my solution to Visual Studio 2010. I have 4 projects I want to cover using unit tests - 3 C# and 1 C++/CLI. I get coverage for the C# projects but not for the C++/CLI project. I did get for all of them in Visual Studio 2008. I've configured the assemblies using testrunconfig -> Data and Diagnostics -> Code Coverage -> Configure. Why don't I get code coverage result for the C++/CLI project? 回答1: I've found out what was wrong. It appears that the upgrade from Visual Studio

Why don't I get code coverage results for C++/CLI project in Visual Studio 2010?

非 Y 不嫁゛ 提交于 2020-01-06 16:22:06
问题 I've recently upgrade my solution to Visual Studio 2010. I have 4 projects I want to cover using unit tests - 3 C# and 1 C++/CLI. I get coverage for the C# projects but not for the C++/CLI project. I did get for all of them in Visual Studio 2008. I've configured the assemblies using testrunconfig -> Data and Diagnostics -> Code Coverage -> Configure. Why don't I get code coverage result for the C++/CLI project? 回答1: I've found out what was wrong. It appears that the upgrade from Visual Studio