w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Could not locate Razor Host Factory type: umbraco.MacroEngines.RazorUmbracoFactory, umbraco.MacroEngines
If you are trying to host the blogengine site within a virtual directory of the Umbraco site, then you will have to amend the blogengine web.config to "remove" all the Umbraco-specific handlers and modules, as these will be inherited by the blogengine application, causing this exception because the application can't find the relevant DLLs in its bin folder. I recently had a similar problem and I have posted the web.config I used in the virtual directory below. Mine was a very simple web application, so obviously this will not work by itself in your blogengine app. You will need to add the relevant parts into your web.config file. Also, this was for a v6 Umbraco install in IIS7.5, so you may have to experiment a little. <?xml version="1.0"?> <configuration> <configSecti

Categories : Iis

Select "umbraco item" using razor
You cannot use server tags inside your razor template. tags like: <umbraco:Item field="field_1" runat="server" /> But you can call @Model.field_1 Final version should look like that: @if (condition) { @Model.field_1 } else { @Model.field_2 } Check this post about razor macros in umbraco: http://www.diplo.co.uk/blog/2011/6/17/using-razor-in-umbraco-47.aspx

Categories : Asp Net Mvc

Getting parameter from macro in umbraco 6 via razor
You have to set the parameter in the macro within the backoffice too, with an alias of "myOwnParameter". See here for the documentation: http://our.umbraco.org/documentation/reference/Templating/Macros/Razor/using-macro-parameters Also, I recommend using camel case wherever you reference the alias, as I seem to remember that when accessing the parameter through the dynamic @Parameter collection, this is how the alias is defined.

Categories : HTML

OrderBy multiple properties in Razor and Umbraco 4.11.8
If memory serves you should be able to chain the OrderBys foreach(var item in Model.AncestorOrSelf("Master").Items.First().PublicationFolder.First().Children.Where("Visible").OrderBy("publicationType").OrderByDescending("date"))

Categories : Linq

Visual Studio 2012 trying to indent a block of code changes the code
This was driving me crazy as I noticed it was adding a 'for loop' then I realised it was when I was selecting code with a comment after the last brace, e.g // code for(...) { // code block } // for <- culprit would become... for (int i = 0; i < length; i++) { // code block // original code for(...) { // for loop code block } // for <- culprit } // if I had } // switch it would delete the code block and enter the below switch (switch_on) { default: break; } Still haven't found the option to turn this off, but at least I understand what the editor is trying to do

Categories : C++

Visual Studio Code Folding for Embedded Code
There is collapse tag option MSDN: Visual Studio 2012 collapse tag The controls are CTRL + M

Categories : Visual Studio

allow to run javascript code right in visual studio
Its really simple to do so. IE provides debugger tools. There are many ways to do this. Here is a list of things I would possibly do Use Chrome by simply pressing F12 and clicking on console for REPL (The debugged and REPL have fantastic features) Use IE by simple pressing F12 too. It support breakpoints and the feel is very similar to Visual studio. Use visual studio immediate window. Hope this helps. Regards.

Categories : Javascript

Add GUI to Existing Code in Visual Studio
First, add a project reference to the System.Windows.Forms namespace. Then open up program.cs, reference the same namespace with a using statement, and change the code to read: static void Main() { Application.Run(new Form1()); } After you add your UI controls to Form1 and wire everything up to get the values you want from the user, you can tie it into the logic that was in the Main() method. How you do that is special to your case though. Try it first and reply if you get stuck. And see the comment by @sa_ddam213 too. Just right-click the project in VS and select "Properties".

Categories : C#

Visual Studio not using Visual Studio Command Prompt for post-build events
The easiest way is probably just call out to the thing the normal VSXXXX command prompt uses: Ex: CALL ""%ProgramFiles(x86)%Microsoft Visual Studio 10.0VCvcvarsall.bat"" x86 (edit: updated as per Hans's comment)

Categories : C#

How to move windows forms from Visual Studio 2010 to Visual Studio 2012
You should be able to just copy the Form files (TheForm.cs and TheForm.designer.cs) to the new project, then add them to the project. Note that you will also need to move any files that form depends upon (if any) before it will work properly.

Categories : Forms

Visual studio selected code formatting
You're looking for Ctrl + K, Ctrl + F: Format Selection. You could have discovered that by selecting some text and typing Format into the Quick Launch bar (Ctrl + Q)

Categories : Visual Studio 2012

Visual Studio C++ does not update new code after building
The problem resided in the fact that I copied the code from the original project into a brand new project saved elsewhere. When I tried to build the project in the new location it would always build it in the old location (Strange since I copied code directly into brand new files). When I tried to run the files it would look for the built code in the new location. Therefore it would always get out of date code. Problem can be fixed by putting the new code back in the old location! Thanks everyone

Categories : C++

Visual Studio code snippets and properties
Have you tried Snippet Designer tool by any chance? If not give it a shot. Their team knows alot about snippets. and they are fairly prompt with the answers to the questions you might throw at them. Sorry if it's not a direct answer but they helped me solve one of the issues which I was bugged in for a while.

Categories : Visual Studio 2012

What is meaning of exception in Visual Studio for C++ code
0xC0000005 is the access violation error code. Such illegal operations with pointers result in an access violation so this code will be seen. On the other hand 0x0041145e isn't a magic number, it's the location of the offending instruction in the executable, and will be different for other programs doing the same thing.

Categories : C++

Visual Studio - How to translate mex code from matlab to C++
To use mex code outside of a Matlab context you would have to rewrite all the mex-specific routines in the source or replace them with non-Matlab versions. For example, everywhere that "mexPrintf" appeared in the mex code you would have to replace it with "printf" and so on.

Categories : C++

Sharing Visual Studio 2010 Code
I copy the form.designer.vb and the form.vb and paste them into notepad (plus) and save them as a text file, zip them and email them. The receiver can then copy and paste them into a new project and it will build as the same project. This is for simple for projects. Some people prefer to change the file extensions (the executable files usually won't pass email scans), I, personally don't like this. I also do this with all my code and email it to myself as an extra back up procedure.

Categories : Vb.Net

Visual Studio Source code checked out by someone else
If you are using TFS and the code is not checked in, then you can't access it. If the other person wants to share the changes with you without checking them in, the other person can "shelve" the changes which lets you access them.

Categories : Visual Studio 2010

Using static library from Visual Studio 2008 with Visual Studio 2010
If getting a VC2010 version of the library is out of the question, then you will need to build a DLL using VS2008 that offers the functionality in the VS2008 static library. You will probably not be able to use C++ linkage to this DLL and certainly will not be able to pass std::string directly between the DLL and your main application. This is because the memory layout/interface is different and you will end up with ODR violations and crashes etc (that's if you can even compile/link it that way without tons of errors). So, you'll need to craft a C style API that the DLL exposes for use by your main VS2010 application. Strings will need to be passed as c-style const char* or const wchar_t* strings, or some other struct/opaque pointer. If you can build the DLL in such a way that it is

Categories : C++

will visual studio 2012 projects open in visual studio 2010
Depends on what features you have in your 2012 projects. Some of the 2012 features will not open in 2010 and will therefore need upgrading. To quote Microsoft: "If you use both Visual Studio 2012 and Visual Studio 2010 SP1, you can create and modify projects and files in either version as long as you don't add features that require Visual Studio 2012." More details on the features that are not supported in 2010 can be found here.

Categories : Dotnet

Cuda parallel code generation in Visual Studio
As of CUDA 5.5, nvcc does not have an equivalent of MSVC's /MP, so any build parallelism for .cu files will need to come from the build tool which invokes NVCC. If you can build using GNU Make (e.g. Under Cygwin or on a Linux/Unix/OS X system), you could use its parallel building functionality, using the -j option, which causes it to process multiple recipes in parallel. Here is a nice blog post which enumerates multiple parallel build options on Windows, some of which may work with NVCC. For a true distributed/parallel build system supporting MSVC and NVCC, you could try Incredibuild.

Categories : C++

Can I use code snippets in a Visual Studio configuration file?
If your configuration file is XML format, you could create code snippets for XML language. You can make it similarly a creating basic code snippet only by specifying the XML language. For more, see here.

Categories : Dotnet

Opencv Sample code not working in Visual studio
As my guess, there may be a linkage problem. For release mode you need to link with release static libraries For example, if a debug library is opencv_imgproc243d.lib, its release version is opencv_imgproc243.lib

Categories : C++

How to 'merge' a XAML file and its code-behind with Visual Studio
If you really feel the need to combine pieces of code behind with XAML in WPF, you could using Attached Properties. You can store the XAML in App.Resources and load it and apply it from an Attached Property. I do realise that this will not give you one file for the XAML and code behind, but it does work nicely. You can register a PropertyChangedCallback handler in your Attached Property and in this handler, you can apply the template: ControlTemplate controlTemplate = (ControlTemplate)Application.Current. FindResource("TextBoxTemplate"); if (textBox.Template != controlTemplate) textBox.Template = controlTemplate;

Categories : Wpf

How to enable code contracts in Visual studio 2008?
Actually the download is for every non express version of Visual Studio (2008 included). The two links for 2010 and 2012 are just for the IDE extensions, to enable intellisense and code snippets.

Categories : C#

Visual Studio 2012 Express Code Analysis
Code Analysis does indeed exist in Visual Studio 2012 Express Edition. It has been present since the initial release and is still present after Update 3. To run code analysis on a project or solution: Open the project or solution From the Solution Explorer right click on the project or solution you want to run Code Analysis on From the right click menu choose Run Code Analysis. Having completed the steps above you should see the Code Analysis user interface which should look similar to: Settings to control Code Analysis are found in project properties on the Code Analysis tab. Specifically in Visual Studio Express for Desktop, I am able to control: Whether or not Code Analysis runs on build Suppression of Code Analysis results for managed code that has been generated. For refer

Categories : Visual Studio 2012

Adjust generated model first code for WPF in Visual Studio
You shouldn't change the generated code; any updates to your model will wipe them out. You need to change your model, then push those changes to your database. The custom getter / setters can be implemented in a partial class. Your new generated code should look like this: public partial class Browser { public string name; public Browser(){ } public Guid Id { get; set; } public string Name {get; set;} } Then you add a partial class like this: public partial class Browser : ValidatableModel, IFormattable { public string name; public override Browser(){ name = "" } public override Guid Id { get; private set; } public override string Name { get { return name; } set { SetPropertyAndValidate(ref name, value); } } }

Categories : Wpf

visual studio 2010 how to debug some code attached to a service
Try using the Debugger Launch method System.Diagnostics.Debugger.Launch(); Edit: Have you tried these? debugging windows service gives No symbols have been loaded message VS 2010 doesn't load PDB

Categories : C#

Disable auto save of code in Visual Studio 2012
That feature was dropped in Visual Studio 2010. As far as I know it hasn't resurfaced in Visual Studio 2012. Save All Files Before Build Gone in Visual Studio 2012?

Categories : Visual Studio 2012

can run C++ code from command line but not from debug mode in visual studio
Trust the debug mode exception. It is testing more thoroughly what your code is actually doing while the command line is simply waiting for problems to happen. In your case, they don't seem to happen, probably because you're not doing anything with the pointer variable.

Categories : C++

Create DUPLICATE code window in visual studio 2012
I haven't got a copy installed here to test but I believe the answer you're looking for lies hidden under the Window menu.. Activate the window you wish to duplicate and under Window on the toolbar choose New Window. This will create a duplicate of the active document. Under the Window menu again you should find the option to make the window Floating Update for Visual Studio 2013: Vertical split of cshtml window in VS2013

Categories : Visual Studio 2012

Is there any extension for visual studio to optimize C++ code unit testing?
There is the CppUnitTestFramework, look here: http://msdn.microsoft.com/en-us/library/hh694604.aspx It is integrated in the IDE and comes with a code coverage tool which is quite useful.

Categories : C++

auto build when code (.cs) is updated - visual studio 2012
Visual Studio out of the box does not have this kind of support. You can achieve this with an extension like .NET Demon.

Categories : C#

Code Analysis Warnings in Visual Studio 2010 - CA1007
Since Program is a private class (it does not have a modifier on it, so it defaults to private), the public static method is not visible from the outside. The CA1007 is meant to ensure that public API's use a nice signature, but internal, private and otherwise not visible methods are exempt from this rule.

Categories : C#

Visual Studio 2012 Code Review Difference Window
There should be a button on the toolbar like this one that will let you select the 4 different "diff modes". You can also use the following keyboard shortcuts: Ctrl+, Ctrl 1 - Inline Ctrl+, Ctrl 2 - Side-by-side Ctrl+, Ctrl 3 - Left Only Ctrl+, Ctrl 4 - Right Only to change the view.

Categories : C#

Visual Studio Extension highlight based on passed in code block
If you're following that prototype, then you can adjust these lines here: //Find the new spans FindData findData = new FindData(currentWord.GetText(), currentWord.Snapshot); findData.FindOptions = FindOptions.WholeWord | FindOptions.MatchCase; wordSpans.AddRange(TextSearchService.FindAll(findData)); TextSearchService.FindAll is returning the list of spans in the editor that matched the text passed in. Nothing is stopping you from simply changing the spans or computing new ones before calling AddRange. Customize that logic to whatever you want. Obviously, if what you want to highlight doesn't depend upon the position of the caret, there's a fair bit of code you can delete for the determination of currentWord.

Categories : Visual Studio 2012

execute javascript (node.js) code right from Visual Studio in REPL manner
I believe it is possible, at least to a degree. I haven't done exactly what you're saying, but I do have node running in iis with iisnode. I also know that there is a version of iisnode that runs under iis express. I would look into that. My guess is you would be able to launch a project using the iisnode module, and you could set the default document to the .js file you want to run, but you may only be able to get console output through the browser. iisnode does give you the ability to debug and see the console output through your browser. For example, if you run the iisnode module for a file test.js at localhost:1234/test.js, you can get a the browser developer tools by going to localhost:1234/test.js/debug. That would give you console output, but I'm not totally certain you would be

Categories : Javascript

Visual Studio - Find where unhandled exception occurs in user code
Look at the Call Stack window in Visual Studio. While Visual Studio usually shows the call stack of the thread that raised an exception (and it's usually sufficient to track down the error), it might be useful to look through other threads (double-clicking them in Threads pane) to know what they were doing at that point of time.

Categories : C++

How to use breakpoints in Javascript code in .ASPX page of Visual Studio 2008
If you put a debugger; statement and you're using IE, the browser will throw a "Script Debugging" error and prompt you for a debugging tool, you can select VS 2008 from the list. Make sure to have the "Disable Script Debugging" options in IE unchecked. Alternatively, you can use "Debug > Attach To Process" and attach the debugger to your browser processes, after that you can put a regular break point from visual studio on your javascript code and it will work.

Categories : C#

MS-SQL - Is it possible to manage the code of sql agent jobs using the Visual Studio SSDT plugin?
At the moment, there's no good way to handle this. Jobs are made up of data stored in the tables in msdb. The best way to handle it would be either to script out each job into its own file, then call those from one larger file or to make a single large file of all scripts for the jobs. I'd probably look into scripting out each job into its own file and calling them from a larger script. It would be more manageable in the long term and you could easily comment out a single job by commenting it out of the main script. There's no way to compare/update the jobs directly, though you could possibly use a Data Compare tool to check the various job tables in msdb against some master copy of the data. SQL Data Compare from Red-Gate is probably your best option for that as SSDT does not include da

Categories : C#

how to remove "const" for attribute "in" when CPP code is generated from IDL file in visual studio?
Since the parameter itself is [in] no changes of the parameter will be taken any further. This is why const makes sense in first place. You did not explain why at all you would want to strip the constness. If the specifier is an obstacle for you (e.g. an inner method takes non-const & as an argument), there are two simple and straightforward ways to work it around: const_cast to strip/override the const specifier a local stack copy of the context for further manipulation

Categories : C++



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