Rectangle 27 77

For C++ projects, you should be fine ignoring the following files:

  • *.sdf and *.opensdf (temporary file opened only while .vcxproj/.sln is loaded to Visual Studio IDE)
  • ipch folder, if your project uses Pre-compiled Headers (PCH); it is a storage for Intellisense compiler which can now utilise PCH for better performance

For C# projects, it's also a good idea to ignore bin and obj directories, and *.suo too.

c++ - What should be contained in a global source code control ignore ...

c++ visual-studio-2010 visual-studio version-control ignore
Rectangle 27 33

To add directly from Visual Studio 2012/2013 IDE:

.net - Where is the "Create Unit Tests" selection? - Stack Overflow

.net unit-testing visual-studio-2012 visual-studio-2013 mstest
Rectangle 27 14

If you use SVN for source control, definitely get VisualSVN. It enables TortoiseSVN interactions from within the Visual Studio IDE.

I also echo the Resharper comment. Retail price is a little steep, but if you're a student or otherwise educationally affiliated, it's actually pretty cheap.

Personally I find the AnkhSVN free open-source plugin for Visual Studio to be perfectly adequate; I combine it with the VisualSVN Server. It might be worth comparing the two to see if VisualSVN adds enough value to justify the price.

Recommended add-ons/plugins for Microsoft Visual Studio - Stack Overfl...

visual-studio plugins
Rectangle 27 5

The build controller [controllerName] does not contain an enabled build agent with name * and no tags

There is matching done on the tags defined in the Build Agent definition at the time that a build is run. On the Build Definition, this can be reviewed/configured as follows:

  • In the Visual Studio IDE, under Builds (in Team Explorer), right-click the build definition, and choose "Edit Build Definition..."
  • Under Process, expand "Advanced", then "Agent Settings". Note the "Tags Filter". Here, the tags can be selected, and the build agent will be selected based on the tags.

In this case, the error indicates that the build definition is looking for "no tags", and an exact match (MatchExactly). So, does the Build Agent have tags defined? If so, either remove them from the Build Agent, or configure the Build Definition to use the tags such that a Build Agent will be matched.

Tags are defined on the Build Agent. They may be modified on the TFS build server (based on the build controller, and build agent configured in the Build Definition).

To define/modify tags on the Build Agent, on the TFS Build Server...

  • Locate a Build Agent that is assigned to the Build Controller being used by the Build Definition, and select Properties
  • Tags may be created, added and deleted on the "Build Agent Properties" dialog:

Given the pictures above for both Build Definition and Build Agent configuration (with only one Build Agent), this error would result, as the Build Definition expects an exact match on no tags, and the only Build Agent configured for the Build Controller associated with the Build Definition has a tag defined ('prototype'). Thus there is no exact match on no tags and 'prototype'.

How can my first Build definition work if is getting broken after "Que...

visual-studio-2010 build tfs2010 tfsbuild microsoft-test-manager
Rectangle 27 12

The ASPX files in both ASP.NET and ASP.NET MVC are not compiled from the Visual Studio IDE. This is often the cause for "false positives" as you have pointed out.

I often add the aspnet_compiler as a post build action to find those errors. You will add some time to your build process, but in exchange for the wait you should be able to spot these errors more easily.

c# - Build does not catch errors in the View in asp.net mvc - Stack Ov...

c# asp.net asp.net-mvc debugging
Rectangle 27 8

The reason why the menus are not coming is visual studio IDE do not consider this as a real ASP.NET MVC project because the project file does not say so. So we should update the project file to include the project type guid for ASP.NET MVC and then the IDE willl start supporting the menus specific for ASP.NET MVC type project.

Go to your solution explorer and unload the existing ASP.NET project by right clicking and selecting Unload Project

Right Click the Project in solution explorer and select Edit your project file name

Add the below entry to it inside the ProjectTypeGuids section

{E53F8FEA-EAE0-44A6-8774-FFD645390401};

I clearly explained it here in a blog post.

You are a genius of the first order. I bow respectfully to your greatness. Adding it to the ProjectTypeGuids tag did indeed switch it to being an MVC application.

@Jonathan: Glad i could help. Now enjoy the wonderful MVC programming.

If you're hesitant to edit the project file, note that Microsoft even walks you through this when upgrading MVC2 to MVC3 projects: asp.net/whitepapers/mvc3-release-notes#upgrading

Convert Legacy ASP.NET Application to MVC3 and HTML5 - Stack Overflow

asp.net asp.net-mvc-3 visual-studio-2010
Rectangle 27 108

I know this is an old question, but I had a similar problem and wanted to post my solution in case it could benefit someone else. I encountered the problem while learning to use:

I was trying to create an AJAX-enabled page (look into a tutorial about using the ScriptManager object if you aren't familiar with this). I tried to access the HTML elements in the page via the C# code, and I was getting an error stating the the identifier for the HTML ID value "does not exist in the current context."

To access the HTML element as a variable in the C# code, the following value must be placed in the HTML element tag in the aspx file:

runat="server"

Some objects in the Toolbox in the Visual Studio IDE do not automatically include this value when added to the page.

2. Regenerate the auto-generated C# file:

  • In the Solution Explorer, under the aspx file there should be two files: *.aspx.cs and *.aspx.designer.cs. The designer file is auto-generated.
  • Delete the existing *.aspx.designer.cs file. Make sure you only delete the designer file. Do not delete the other one, because it contains your C# code for the page.
  • Right-click on the parent aspx file. In the pop-up menu, select Convert to Web Application.

Now the element should be accessible in the C# code file.

fyi the right click "Convert to Web Application" option is also available on folders and projects.

option number #2 was the perfect answer for me in solving this issue when I was running into it today!

Don't know why this works, but it worked for me.

FYI in Visual Studio 2013, the "Convert To Web Application" option has moved to the Project menu: stackoverflow.com/questions/19561982/

c# - The name 'controlname' does not exist in the current context - St...

c# asp.net visual-studio-2005 code-behind
Rectangle 27 108

I know this is an old question, but I had a similar problem and wanted to post my solution in case it could benefit someone else. I encountered the problem while learning to use:

I was trying to create an AJAX-enabled page (look into a tutorial about using the ScriptManager object if you aren't familiar with this). I tried to access the HTML elements in the page via the C# code, and I was getting an error stating the the identifier for the HTML ID value "does not exist in the current context."

To access the HTML element as a variable in the C# code, the following value must be placed in the HTML element tag in the aspx file:

runat="server"

Some objects in the Toolbox in the Visual Studio IDE do not automatically include this value when added to the page.

2. Regenerate the auto-generated C# file:

  • In the Solution Explorer, under the aspx file there should be two files: *.aspx.cs and *.aspx.designer.cs. The designer file is auto-generated.
  • Delete the existing *.aspx.designer.cs file. Make sure you only delete the designer file. Do not delete the other one, because it contains your C# code for the page.
  • Right-click on the parent aspx file. In the pop-up menu, select Convert to Web Application.

Now the element should be accessible in the C# code file.

fyi the right click "Convert to Web Application" option is also available on folders and projects.

option number #2 was the perfect answer for me in solving this issue when I was running into it today!

Don't know why this works, but it worked for me.

FYI in Visual Studio 2013, the "Convert To Web Application" option has moved to the Project menu: stackoverflow.com/questions/19561982/

c# - The name 'controlname' does not exist in the current context - St...

c# asp.net visual-studio-2005 code-behind
Rectangle 27 108

I know this is an old question, but I had a similar problem and wanted to post my solution in case it could benefit someone else. I encountered the problem while learning to use:

I was trying to create an AJAX-enabled page (look into a tutorial about using the ScriptManager object if you aren't familiar with this). I tried to access the HTML elements in the page via the C# code, and I was getting an error stating the the identifier for the HTML ID value "does not exist in the current context."

To access the HTML element as a variable in the C# code, the following value must be placed in the HTML element tag in the aspx file:

runat="server"

Some objects in the Toolbox in the Visual Studio IDE do not automatically include this value when added to the page.

2. Regenerate the auto-generated C# file:

  • In the Solution Explorer, under the aspx file there should be two files: *.aspx.cs and *.aspx.designer.cs. The designer file is auto-generated.
  • Delete the existing *.aspx.designer.cs file. Make sure you only delete the designer file. Do not delete the other one, because it contains your C# code for the page.
  • Right-click on the parent aspx file. In the pop-up menu, select Convert to Web Application.

Now the element should be accessible in the C# code file.

fyi the right click "Convert to Web Application" option is also available on folders and projects.

option number #2 was the perfect answer for me in solving this issue when I was running into it today!

Don't know why this works, but it worked for me.

FYI in Visual Studio 2013, the "Convert To Web Application" option has moved to the Project menu: stackoverflow.com/questions/19561982/

c# - The name 'controlname' does not exist in the current context - St...

c# asp.net visual-studio-2005 code-behind
Rectangle 27 108

I know this is an old question, but I had a similar problem and wanted to post my solution in case it could benefit someone else. I encountered the problem while learning to use:

I was trying to create an AJAX-enabled page (look into a tutorial about using the ScriptManager object if you aren't familiar with this). I tried to access the HTML elements in the page via the C# code, and I was getting an error stating the the identifier for the HTML ID value "does not exist in the current context."

To access the HTML element as a variable in the C# code, the following value must be placed in the HTML element tag in the aspx file:

runat="server"

Some objects in the Toolbox in the Visual Studio IDE do not automatically include this value when added to the page.

2. Regenerate the auto-generated C# file:

  • In the Solution Explorer, under the aspx file there should be two files: *.aspx.cs and *.aspx.designer.cs. The designer file is auto-generated.
  • Delete the existing *.aspx.designer.cs file. Make sure you only delete the designer file. Do not delete the other one, because it contains your C# code for the page.
  • Right-click on the parent aspx file. In the pop-up menu, select Convert to Web Application.

Now the element should be accessible in the C# code file.

fyi the right click "Convert to Web Application" option is also available on folders and projects.

option number #2 was the perfect answer for me in solving this issue when I was running into it today!

Don't know why this works, but it worked for me.

FYI in Visual Studio 2013, the "Convert To Web Application" option has moved to the Project menu: stackoverflow.com/questions/19561982/

c# - The name 'controlname' does not exist in the current context - St...

c# asp.net visual-studio-2005 code-behind
Rectangle 27 2

If you are using the command-line MSBuild command (not the Visual Studio IDE), for example if you are targetting AppVeyor or you just prefer the command line, you can add this option to your MSBuild command line:

/fileLoggerParameters:LogFile=MyLog.log;Append;Verbosity=diagnostic;Encoding=UTF-8

As documented here (warning: usual MSDN verbosity). When the build finishes, search for the string will be compiled in the log file created during the build, MyLog.log.

/verbosity:detailed will also give the same information but is not as verbose. You can then search for "will be compiled as".

Visual Studio 2010 always thinks project is out of date, but nothing h...

visual-studio visual-studio-2010
Rectangle 27 33

Variant 2: Targets & Map of projects.

  • 1 - Requires no any additional extensions. But it may work only via projects-level so we use it for emulating the our solution-level... It is hard and inconvenient for common solution, but is variant. See below.
  • 2 - The original engine of vsSolutionBuildEvent provides a few ways of unified support of the VS and msbuild.exe. A simple way the targets mode to call the after.<name>.sln.targets that available only for msbuild.exe (this does not requires additional steps, simply action). But only original engine (inc. vsCommandEvent) may allow additional scripting which support for example (7zip archiver, packing of nuget package without nuget.exe, remote servers etc.). However, it's not important for our question/problem and you can use any available option to support the solution-level if you see + above.

This variant is not for simple users of VS. However, it can be useful for your complete solution etc.

You should implement, for example:

public sealed class YourPackage: Package, IVsSolutionEvents, IVsUpdateSolutionEvents2
{
...
    public int UpdateSolution_Begin(ref int pfCancelUpdate)
    {
        //TODO:
    }
}

Then, register handler with 'Advise' methods as priority listener, i.e. for IVsUpdateSolutionEvents2 you should use the AdviseUpdateSolutionEvents

It is important, because the BuildEvents (see EnvDTE) - probably will not help and may work too late - Example

Sample with AdviseUpdateSolutionEvents:

// http://msdn.microsoft.com/en-us/library/microsoft.visualstudio.shell.interop.ivssolutionbuildmanager2.aspx
private IVsSolutionBuildManager2 sbm;

// http://msdn.microsoft.com/en-us/library/bb141335.aspx
private uint _sbmCookie;
...

sbm = (IVsSolutionBuildManager2)ServiceProvider.GlobalProvider.GetService(typeof(SVsSolutionBuildManager));
sbm.AdviseUpdateSolutionEvents(this, out _sbmCookie);

ok, you love something like this - MSBuild: Extending the solution build, but this variant may work with build processes from msbuild.exe and not from VS IDE...

But the VS is also uses targets (Build, Rebuild, Clean, ..) in project files (*.csproj, *.vcxproj, ..) when the build-operations is started. So we can also try this, but remember:

  • The VS is also ignores amazing .sln file. It forms the all end-targets from loaded environment with EnvDTE etc.
  • The .sln should processed by msbuild.exe only as: automatically generate the .metaproj (in memory by default), which contains 'what and when' will be built. Including a common targets for all projects if exists, for example:
...
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\SolutionFile\ImportAfter\*" Condition="'$(ImportByWildcardBeforeSolution)' != 'false' and exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\SolutionFile\ImportAfter')" />
<Import Project="D:\tmp\p\after.name.sln.targets" Condition="exists('D:\tmp\p\after.name.sln.targets')" />
<Target Name="Build" />
<Target Name="Rebuild" />
<Target Name="Clean" />
<Target Name="Publish" />
  • And yes, the .metaproj is also cannot be viewed by VS IDE.

Therefore, for work with common targets from VS IDE you can use only project files with some limitation (without modification/extending of VS, it means).

  • Add your common .targets file into all your projects (it can be automatically with any tool, inc. the NuGet events etc.) , for example: <Import Project="..\<SolutionFile>.targets" />

And for example, yes, it can be the 'Map of projects':

  • The 'Map of projects' illustrates the solution-wide PRE/POST 'events' for build-operations from Visual Studio IDE (i.e. primary from VS IDE)
...
<Target Name="_Build" BeforeTargets="Build" DependsOnTargets="ProjectsMap">
    <CallTarget Targets="_BuildPRE" Condition="$(ScopeDetectFirst)" />
    <CallTarget Targets="_BuildPOST" Condition="$(ScopeDetectLast)" />
</Target>
<Target Name="_BuildPRE">
    <!-- ... -->
</Target>
<Target Name="_BuildPOST">
    <!-- ... -->
</Target>
...

In general, we'll use the map of projects and now we know 'what and when' should happen. It's safe for all or most cases (changes of build order or removing the any projects from solution). However! you should manage <Import> section for new projects in first init. This is really inconvenient, but is also variant...

Today it is the most complete solution for work with a lot of events as the Events-Catcher with a variety of advanced actions for maintenance of your projects and libraries, building processes and processes at runtime from your Visual Studio and MSBuild Tool.

Different action types for all subprojects at once in solution as Solution-Events or individually for each.

If you want to use the Variant 1 above or need to see how to work with Shell.Interop, EnvDTE, IVsUpdateSolutionEvents2, MSBuild Engine etc., see here:

It is not the same, but yes, it's also possible with EnvDTE.CommandEvents like in Variant 1 above.

You should already know (see above) about this solution for priority work with current type of the build action... So why not to use this as primary solution for current problem ?

_cmdEvents.BeforeExecute += (string guid, int id, object customIn, object customOut, ref bool cancelDefault) => {

    if(UnifiedTypes.Build.VSCommand.existsById(id)) {
        // ... your action
    }

};
Description               | guid                                  | id  |In |Out|
--------------------------|---------------------------------------|-----|---|---|
Started: Build Solution   |{5EFC7975-14BC-11CF-9B2B-00AA00573819} | 882 |   |   |
Started: Rebuild Solution |{5EFC7975-14BC-11CF-9B2B-00AA00573819} | 883 |   |   |
Started: Clean Solution   |{5EFC7975-14BC-11CF-9B2B-00AA00573819} | 885 |   |   |

It also presents advanced handler of most events, but unlike the first it specialized for MS Visual Studio for advanced work with all commands and output data as manager of this. Not only for projects and solutions, but also for the whole Visual studio IDE.

In general, it is the common solution of Variant 4 and you can simply override all commands above to solve this problem.

There are open implementation for all these variants. See here and smile:

The plugin (vsSolutionBuildEvent) is the only thing I could find that worked from within VS. Huge +1 since I've been researching this for several days now, thanks!

@mpd I added new variants, you can also try the new vsCommandEvent if needed. /Glad that it helped you.

@knocte just use the other answers with already improved English skills. thank you for your downvote

visual studio - Solution-wide pre-build event? - Stack Overflow

visual-studio projects-and-solutions pre-build-event
Rectangle 27 1

On Visual Studio IDE press Esc + Cntl + Alt + E and check the Thrown checkbox for Common Language Runtime Exceptions

Ok, thanks, I have added the throw back position above. Unfortunately it did not help me.

c# - How to find out what caused a NullReferenceException - Stack Over...

c# debugging nullreferenceexception
Rectangle 27 103

This question has been answered for some time now, but I was quite surprised that most of the answers say what OCaml features are missing in F# - this is definitely good to know if you want to port existing OCaml programs to F# (which is probably the motivation of most of the referenced articles). However, there are many features that make F# a different language (not just a limited version of OCaml for .NET!) Here is a couple of things that are added in F#:

  • Units of measure that allow you to type-check code dealing with numerical calculations
  • Meta-programming using quotations (which makes it possible to use LINQ in F# and is also essential for promissing projects like the WebSharper platform)
  • Computation expressions which is a language feature behing asynchronous workflows (a library for asynchronous I/O/web service/GUI programming)
  • .NET compatible object-system that makes it possible to fully interoperate with the .NET platform (OCaml also has a support for objects but different - there are of course some benefits in both of the systems).
  • Overloaded operators - As far as I know, OCaml doesn't have overloaded operators - in F# you can use + for all numeric types as well as your types that support it.

And, honestly, I think that it is also worth mentioning the Visual Studio IDE. This is not a part of the language, but it really improves the user experience (IntelliSense support in Visual Studio is really good!)

If you look at the list, there are many things that largely contributed to the popularity of F#, so it's much more than just "OCaml without functors". F# is definitely based on OCaml (and takes ideas from other languages such as Haskell) and shares many aspects with them, however there is also a lot of other things. I guess that without things like asynchronous workflows, .NET style OO and meta-programming, the Microsoft Developer Division would never include F# in Visual Studio 2010.

Thank you! Most people focus on what's missing from F#, but I also wanted to see what was missing from OCaml.

Woah! OCaml was specifically bred for metaprogramming it is vastly superior to F# and .NET in that context. Camlp4 is a far more powerful quotation system than F#'s. OCaml's lexers and parsers are way better than anything available for .NET. Also, Camlp4 macros are available that implement active patterns and computation expressions. OCaml also has IDEs that provide the same benefits that Visual Studio does for F#.

@Tomas: How do you reconcile your claim that Camlp4 "is a system on top of" OCaml when Camlp4 is integrated with OCaml at the binary level and Camlp4 macros can be defined and used on-the-fly in a running OCaml REPL? How do you reconcile your claim that Camlp4 "has nothing to do with quotations" with the fact that Camlp4 provides a quotation mechanism? How do you reconcile your implication that Camlp4 cannot facilitate the likes of Websharper when SkyDeck's ocamljs tool has been compiling OCaml code quoted using Camlp4 to Javascript since 2007?

@Tomas: F# cannot even quote expressions with unbound variables like <@ a @>, let alone type definitions like <@ type t = int @> and it cannot handle arbitrary grammars much less extensible lexers and parsers as Camlp4 does. Lack of a decent macro system is one deficiency but, IMHO, the lack of any decent lexers and parsers for F# is a far more serious impediment. I actually advise developers to create their lexers and parsers using OCaml, restricting themselves to the subset that F# supports and porting it back to F# in order to benefit from OCaml's superior tool support!

@Erik: "Most people focus on what's missing from F#, but I also wanted to see what was missing from OCaml". Note that the active patterns, metaprogramming, computation expressions and asynchronous workflows were available in OCaml before they made it into F#.

F# changes to OCaml - Stack Overflow

f# ocaml functor
Rectangle 27 1

Another option, a bit less obvious, is to save the devenv.sln file to the Visual Studio IDE folder for that version of Visual Studio. This was an option described in the link noted above.

Probably not the best option, but it is an option none the less.

.net - Disable Visual Studio devenv solution save dialog - Stack Overf...

.net visual-studio visual-studio-2012
Rectangle 27 1

Another option, a bit less obvious, is to save the devenv.sln file to the Visual Studio IDE folder for that version of Visual Studio. This was an option described in the link noted above.

Probably not the best option, but it is an option none the less.

.net - Disable Visual Studio devenv solution save dialog - Stack Overf...

.net visual-studio visual-studio-2012
Rectangle 27 1

Another option, a bit less obvious, is to save the devenv.sln file to the Visual Studio IDE folder for that version of Visual Studio. This was an option described in the link noted above.

Probably not the best option, but it is an option none the less.

.net - Disable Visual Studio devenv solution save dialog - Stack Overf...

.net visual-studio visual-studio-2012
Rectangle 27 1

If you are using the command-line MSBuild command (not the Visual Studio IDE), for example if you are targetting AppVeyor or you just prefer the command line, you can add this option to your MSBuild command line:

/fileLoggerParameters:LogFile=MyLog.log;Append;Verbosity=diagnostic;Encoding=UTF-8

As documented here (warning: usual MSDN verbosity). When the build finishes, search for the string will be compiled in the log file created during the build, MyLog.log.

/verbosity:detailed will also give the same information but is not as verbose. You can then search for "will be compiled as".

Visual Studio 2010 always thinks project is out of date, but nothing h...

visual-studio visual-studio-2010
Rectangle 27 2

There are many options to deploy your app to azure websites/ web app, such as FTP, Local Git Repository, and Visual Studio IDE, etc. I am not a React expert, here for simplicity, I just use create-react-app tool and FileZilla to deploy my React app to Azure Web App. Here are the steps.

Basically, creating and building React app is as simple as

npm install -g create-react-app

create-react-app my-app
cd my-app/

npm run build

Now, the app is ready to be deployed! Lets go into Azure portal and create a new website that will host our React app.

Enter a unique app service name, a valid name for the resource group and a new service plan. Then click Save.

To enable FTP publishing, click Deployment credentials under the APP DEPLOYMENT menu. Save the credentials and make a note of the user name and password you create.

Finally, connect to Azure Web app via FileZilla, then upload the entire content of the my-app/build folder created earlier into the /site/wwwroot/ folder on your Azure Website.

Now we can visit the app in a browser via URL: http://aaronreacttest.azurewebsites.net/, and it should display the default page.

node.js - Deploying react project on Azure - Stack Overflow

node.js azure reactjs deployment web-deployment
Rectangle 27 1

I found Subversion very easy to install. AnkhSVN integrates into the Visual Studio IDE nicely and makes sure you don't forget to add new files created in the IDE to SVN. However, AnkhSVN also seems to have it's periodic hiccups.

TortoiseSVN seemed more stable when I used it, plus it has some advanced features (like a nice conflict editor) that Ankh is still lacking. That's why I use both Ankh and SVN for the best of both worlds.

Source control with Visual Studio integration for a small project - St...

visual-studio visual-studio-2008 version-control tfs