visual-studio

How to turn System::String^ into std::string?

So i work in clr, creating .net dll in visual c++. I tru such code: static bool InitFile(System::String^ fileName, System::String^ container) { return enc.InitFile(std::string(fileName), std::string(container)); } having encoder that normaly resives std::string. but here the compiler (visual studio) gives me C2664 error if I str...

Finding all the places a variable has been set?

Hi, Often when developing with VS2010 Ultimate, I want to check where in a codebase a value is being set (so where this is an assignment). Is there a way, using VS2010 Ultimate, or a 3rd party debugging tool, to be able to get all the places in a codebase where a variable has been set or got? Thanks ...

Strange "go to sources" behaviour in VS

This is what I get when I select "go to definition" in the ConfigTests.cs. But I expected to go to already opened Config.cs with actual declaration. What did I do wrong? ...

VS2008 post-build event batch file

I'm trying to execute a batch file to move a bunch of files around after a build so I've created a post-build event that looks like this: $(ProjectDir)CopyPlugins.bat $(ConfigurationName) The problem is that when Visual Studio tries to run the event I get the error that the process exited with code 9009 The problem appears to be that...

Visual-C++ 2008 vs Visual-C++ 2010 - what has changed?

Possible Duplicate: How to find whats new in VC++ v10? Visual-C++ 2008 vs Visual-C++ 2010 - what has changed? What are + and - of new VC++? ...

How to use Func with Entity Data Context?

i writed below codes MyCustomer.cs must return List which is type of Customer entity. İ used Func method. I want to do this: return erpEntityCtx.Customer.Select(select).ToList<TResult>(); BUT error return to me: Has some invalid argument. i can use this: return erpEntityCtx.Customer.Select(c=>c.Name).ToList<TResult>(); However ...

How can i develop lRepository<TModel> in Manager class in Enttiy?

i try to write manager class. But i can not use that : return erpObj.Get(predicate); How can i do that? namespace Erp.BLL.Manager { public interface ILoad { List<TResult> Load<TKey,TResult>(List<TKey> list, Func<TKey, TResult> select); } public interface IRepository<TModel> { List<TModel> Get(Fun...

Draggable Canvas in WPF Using a 'Thumb'

Hi folks, On my quest to implement a very simple 'drag' mechanism to my application (which consists of multiple canvasses nested inside a 'parent' canvas) I've come up with the following bits of code: (Showing only the relevant bits to save space) MainWindow.xaml <Canvas Name="parentCanvas" Background="#FFE8CACA"> <Canvas...

Show full command line activity while building\compiling in Visual Studio?

I'm looking for some tool\feature of Visual Studio that would allow me to see all the underlying commands it is executing when it builds and compiles a project. csc.exe calls with all parameters\switches\options displayed Tlbimp.ex calls with all parameters\switches\options displayed etc. ...

Querying with LINQ basic question

I actually have two questions today, but they are both small :-) 1) Where is a good resource for learning linq/sql selections in C#? 2) Say I have a table called Model, with properties Name, Color, Shape. How do I do a query to select only the rows which DONT have null values in any column. I've tried: var d = database.Portfolio.Sele...

Debugging code in a view (asp.net mvc2)

Hello, How do I debug code in the View in asp.net mvc2 application? Edit after progress last night: Ok so now I have the following: in Shared\EditorTemplates\Equipment.ascx : <%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<DAT.Models.Item>" %> <% using (Html.BeginForm()) {%> <%: Html.ValidationSummary...

Is there such a thing as a "content/data only project" in visual studio

I have a bunch of ancillary XML and XSLT files that I want to edit and manage in visual studio. The files do not logically belong under any code project in my solution and so in order to group them neatly, I have created a "dummy" C# dll project in visual studio and disabled it from building in Debug / release builds). I wondered i...

Teamcity - which external diff viewer

Do You know any tools that can be used as external diff viewer for Teamcity's Visual Studio plugin? I'm using Visual Studio 2010 Pro and Teamcity 5.1.2. ...

How can i see execute command in Entity FrameWork ?

i try to use erpCtx.Executecommand but i doesn't have method of executecommand. i think that i must add dll in Reference to show executeCommand? i need : int rowsAffected = engCtx.ExecuteCommand("insert into ENG_MAINWP Values({0},{1},{2},{3})", engArray[0], engArray1, engArray[2], engArray[3]); ...

Creating a class implementing an interface dynamically

Hi, I'm trying to write a code that allows a user to load an assembly (DLL file), choose an interface in said assembly, than generates a class inheriting that interface, with stubs for all required methods. The class would be generated either into a file or into an active VS session (the code is intended for use inside an IWizard initi...

Linker error 348: Compilation failed. Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.

Greetings everyone. I am hitting a road block on a very strange linker error and I thought I would throw it out here in the community to see if anyone has any thoughts (or better yet has seen it before). The error is this: error 348: Compilation failed. Unable to load one or more of the requested types. Retrieve the LoaderExceptions pr...

Visual Studio 2010 "Add Reference" is copying dll to bin directory??

I am using w7, 64bit and vs.net 2010. I am adding a reference to a component that is within my 'add references' dialog box. The component is a 3rd party dll. Historically, on w7 32bit it would add a line in my web.config (within the assemblies tag) referencing this dll and it wouldn't copy the dll to the bin directory. However, on 64...

Why are my local dlls taking forever to load after setting _NT_SYMBOL_PATH?

I've setup _NT_SYMBOL_PATH and have pointed it to srv*c:\symbols*http://msdl.microsoft.com/download/symbols When starting the debugger, I notice that the Windows related dlls load quickly. However, our company's dlls are taking a god awful long time to load. When I get rid of _NT_SYMBOL_PATH, restart visual studio, then everything lo...

How can I set the default event to be edited for my custom control in Visual Studio?

I made a custom button by inheriting the Button class. When I double click the custom button in Designer, it makes the event handling function for MyButton.Click: Private Sub MyButton1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyButton1.Click End Sub How can I make it so that when you double click,...

How to run a 2008 custom in Visual Studio 2010?

We have converted a project to Visual Studio 2010. While our main application work perfectly, a administration tool that use a DataSet and a TableAdapterManager to access the data is broken due to a incorrect save order created by the generated code. https://connect.microsoft.com/VisualStudio/feedback/details/583180/the-auto-generated-c...