w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Get all images from a folder in my project/solution
If it is in a compiled section of code you should be able to just hit the root and then come back up to the directory e.g. /Resources/Images/HelpIcons/ If you are accessing the images from a front end file e.g .aspx try ~/Resources/Images/HelpIcons

Categories : C#

Always execute target in project on solution rebuild even when project is not modified
I guess you tried do it this way: <Target Name="MyCustomBeforeBuild" BeforeTargets="BeforeBuild" Inputs="@(Compile)" Outputs="@(Compile->'%(RecursiveDir)%(Filename)%(Extension).generated')"> <Message Text="MyCustomBeforeBuild Begin" Importance="High" /> <Copy SourceFiles="@(Compile)" DestinationFiles="@(Compile->'%(RecursiveDir)%(Filename)%(Extension).generated')" /> <Message Text="MyCustomBeforeBuild End" Importance="High" /> </Target> In this case MSBuild will use incremental build and evaluates that no file were modified based on timestamp comparison of input and output files. In this case you can see in detailed or in diagnostic log message like this Skipping target "MyCustomBeforeBuild" because all output files are up-to-date with r

Categories : Visual Studio 2012

Get location of a solution/project in VS project template Wizard
on RunStarted method, use replacementsDictionary["$destinationdirectory$"] contains the destination directory. public void RunStarted(object automationObject, Dictionary<string,string> replacementsDictionary, WizardRunKind runKind, object[] customParams) { string Path=replacementsDictionary["$destinationdirectory$"]; } You can use "$destinationdirectory$" in your generated code files. I found this answer here

Categories : C#

using msbuild to build a C++ project from another C++ project in the same solution
Just call CreateProcess, for example (using msbuild 4): #include <windows.h> #include <string> #include <iostream> bool RunMsBuild( const char* args ) { STARTUPINFO startupInfo; PROCESS_INFORMATION procInfo; memset( &startupInfo, 0, sizeof( startupInfo ) ); memset( &procInfo, 0, sizeof( procInfo ) ); std::string cmdLine( "C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe " ); cmdLine += args; if( !CreateProcessA( 0, const_cast< char* >( cmdLine.c_str() ), 0, 0, FALSE, 0, 0, 0, &startupInfo, &procInfo ) ) return false; WaitForSingleObject( procInfo.hProcess, INFINITE ); DWORD dwExitCode; GetExitCodeProcess( procInfo.hProcess, &dwExitCode ); CloseHandle( procInfo.hProcess ); CloseHandle( procInfo.hThr

Categories : Visual C++

Trying to create a project in a sub folder gives " overlaps the location of another project" error
1-Take for workspace "MyBook" 2-In eclipse, create a "Java project" ch-01. 3-right click on ch-01 , new, project "MyExampleApple" for each folder like ch-01 do number 2 and 3. :) This will create a subFolder in your Workspace and a project inside this subFolder. workspace subfolder project MyBook Ch-01 MyExampleApple :D

Categories : Java

A project can't reference another project of the same solution
You need to add a reference to the ClassLibrary2 project (asssembly). You will then be able to use namespaces and types in that project. Right-click the other project, then click Add Reference.

Categories : C#

Can I have a folder in my ASP.NET MVC4 project that is a webforms project?
That will just work. You can mix and match any kind of ASP.Net stuff in one project. The ASPX files will be accessible using their actual paths, just like pure WebForms project. You can also call MapPageRoute() to apply routing to those files.

Categories : C#

hiding method from certain layers in project
There is a separation of concerns by keepeing the User object as object that only holds data with no logic in it. you better keep it separated for the following reasons: As you stated, it is a bad practice since the Save' functionality will be exposed to other places/classes where it is irrelevant for them (This is an important for programming generally). Modifying the service layer - I guess you are using WCF web service as you can transfer a .NET object (c#/VB) to the service via SOAP. If you put the saving logic in the 'User' object, you can't replace it another webservice that receives a simple textual data structures like JSON or XML or simply doesn't support .NET objects. Modifying the data storage layer - If you want, for example, to store the data inside a different place like ot

Categories : Asp Net

Decision in regard to adding a new project independent of the application's layers
You should add a DataContracts project. So the references will be like this: DataAcces Layer Entity Framework - note: this should not be exposed for public, the DAL should wrap it DataContracts Automapper DataContracts GUI Layer DataContracts Service Layer DataContracts Unity DataAcces Layer Automapper DataContracts GUI Layer Service Layer Your layers should have interfaces that are defined in the DataContracts project. For example, in your Service Layer you won't depend on a DataAccesController, you'll depend on an IDataAccesController. You can use the unity layer to wire everything together, since that's what unity is for. Having an interchangeable IoC framework is not really recommended. If the client decides they rather have nhibernate instead of entity framework,

Categories : C#

Get the Project hierarchy using the workspace reference
For performance reasons there is not a way to retrieve full hierarchies of objects all at once through Rally's WSAPI. You can do one of two things: either fetch Parent and then stitch the data together yourself or manually recursively walk the tree fetching Children.

Categories : Java

VC++ Calling a function of /clr project from a function of non /clr project within a solution
Well, you are not linking C# code, that's just not possible so that's not the source of the problem. The warning is the first hint at the core problem, you are trying to link code that was compiled with /MT and thus has a dependency on libcmtd.lib, the static version of the CRT. Your C++/CLI code will always be compiled with /MD and thus has a dependency on msvcrtd.lib, the version of the CRT that's stored in a DLL and can be shared between multiple modules. You cannot mix both versions of the CRT in one executable, that's why the linker objects with LNK4098. The link fails when it sees two copies of the type_info class implementation, one from libcmtd.lib and another from msvcrtd.lib and cannot decide which one you really want. Furthermore, a C++/CLI project has a rock hard require

Categories : C#

How to understand type hierarchy feature in Eclipse for java project
The Eclipse icons are documented here: http://help.eclipse.org/juno/index.jsp?topic=%2Forg.eclipse.jdt.doc.user%2Freference%2Fref-icons.htm To answer your specific question, the C icon is a class, the supercsript A is abtract, S static, F final. The red square means it's private, the blue triangle is package scoped. Amongst other things, the type hierarchy helps to understand what behaviour a class inherits from it's parent types.

Categories : Java

How to get src folder under project-root folder in github when staging from eclipse using egit
it cannot be done using eGit - it assumes the Eclipse project structure. But it can be accomplished by using git itself. Just create a repository under SimpleGit folder executing 'git init'. From that point on you'd have to manage your git repository by either git itself (command line) or some other UI. SourceTree works really well for me.

Categories : Eclipse

Eclipse, Java project - How do I add a source folder where the folder name is part of the package name?
My recommendation, especially if your source files are all in one - or just a few - director(ies): 1) Check out your CVS project into a temp folder 2) Create a new Eclipse project from scratch. It will create a "src" folder by default. 3) Create your package with Eclipse. It will automatically create subfolders representing your package name (e.g. com.foo.mypackage). 4) Drag/drop your source into the Eclipse package 5) Make sure everything builds 6) Save the new Eclipse folder tree to CVS (ideally, use the CVS plugin for Eclipse to do this). IMHO...

Categories : Java

ASP.NET MVC 4 Project placed within another ASP.NET MVC 4 project's folder
You should be able to achieve this by modifying the default route located in App_Start/WebApiConfig.cs e.g. public static void Register(HttpConfiguration config) { config.Routes.MapHttpRoute( name: "DefaultApi", routeTemplate: "api/{controller}/{action}/{id}", defaults: new { Action = "Get", id = RouteParameter.Optional } ); } change "api/{controller}/{action}/{id} to "/WebService/{controller}/{action}/{id}"

Categories : Web Services

Rails server command generates another folder in project's folder with default folders and files
This is because you are using rails 2 gem version, you can check by rails -v. As well you can see, there is no app/assets folder. there are only public/javascripts etc rails2 style directories Try to install rails 3 by gem install rails --version '>3.0.0'

Categories : Ruby On Rails

What is the best solution for a Phonegap project?
Try the Telerik AppBuilder IDE(Cloud IDE) where you dont need to worry about adding SDKs etc which helps to build very good hybrid applications...some sample applications are also available. http://www.telerik.com/appbuilder

Categories : Asp Net Mvc

Events in a VB.Net multi-project solution
You can have a dedicated Project that has a Class whose sole purpose is to house a "Global Event". Make that Class implement the Singleton Pattern so that all the projects will access the same instance. All the other projects can Reference this Project and could look like this: ' This is in Project3 Public Class Class1 Private Sub New() End Sub Private Shared _Instance As Class1 Public Event GlobalEvent() Public Shared ReadOnly Property Instance As Class1 Get If IsNothing(_Instance) Then _Instance = New Class1 End If Return _Instance End Get End Property Public Sub RingTheBell() RaiseEvent GlobalEvent() End Sub End Class Here is FormA in Project1, displaying FormB in Proje

Categories : Vb.Net

How to get enum type from another project in solution?
You can use typeof to get a System.Type for any type. It doesn't matter if it's in the same project or not (as long as the other project is referenced): Type theType = typeof(SomeOtherProject.MyClass.MyTypes);

Categories : Wpf

Visual Studio SVN project without a Solution?
When you create a solution and add a Website project to it, you should be able to let Visual Studio work on a folder structure. Just don't check in the project file, nor the solution and you should have basic editing functionality.

Categories : Svn

how to bind menuitem to another project in same solution
Use This : string Path = Request.Url.GetLeftPart(UriPartial.Authority) + VirtualPathUtility.ToAbsolute("~/"); Path will contain your current localhost/CurrentOpenedProject, replace it by Project required by using : Path = Path.Replace("CurrentOpenedProject", "RequiredProject"); You can add this to menuItem like this: for(int i = 0; i < Menu1.Items.Count;i++){ Menu1.Items[i].NavigateUrl = Path; }

Categories : C#

Publish one web project from solution with msbuild
I blogged about this at http://sedodream.com/2013/03/06/HowToPublishOneWebProjectFromASolution.aspx a few months back. I've copied the details here as well, see below. Today on twitter @nunofcosta asked me roughly the question “How do I publish one web project from a solution that contains many?” The issue that he is running into is that he is building from the command line and passing the following properties to msbuild.exe. /p:DeployOnBuild=true /p:PublishProfile='siteone - Web Deploy' /p:Password=%password% You can read more about how to automate publishing at http://sedodream.com/2013/01/06/CommandLineWebProjectPublishing.aspx. When you pass these properties to msbuild.exe they are known as global properties. These properties are difficult to override and are passed to ever

Categories : C#

Use Image without adding it in WPF Project/Solution Resources
Maybe use the file absolute path, simply change the last line of the LoadBitmapFromResource function to: return new BitmapImage(new Uri(assembly.GetName().CodeBase + pathInApplication, UriKind.Absolute)); this should do the fix. Also you can try using the UriKind.Relative. Good day

Categories : C#

Invalid Project in console after moving solution
Feel free to close as too specific, however I think this could be useful to others down the road. The problem is that when the solution was in a nested folder, then doing the following was fine: devenv ..sln /project ..projfolderproj However, when I moved the solution I only changed the solution path devenv sln /project ..projfolderproj But, the project path is relative to the solution, not my current executing path. So, I changed the command to the following and it worked: devenv sln /project projfolderproj

Categories : Dotnet

Changing location of referenced project in VS solution
I can't tell you if this is the best way, but I'm pretty sure it will work if you don't come up with anything better. Create a symbolic link between the two directories, and map the project using that. Add a pre-event MSBuild script to delete and recreate the symbolic link for each build based on the current branch. For example: rmdir MyProject mklink /d MyProject c:devMainMyProject You'll probably want to put this in a batch file and call that.

Categories : Visual Studio

Common keypresses in multiple project solution
You should create one 'controller' project, which has a keyboard hook, and , maybe a fancy tray icon with animation :) And from that 'central' project, pass the commands to the other forms...

Categories : Vb.Net

Optimise the solution to Project Euler 12 (Python)
one of the hints i can give is def genfact(n): t = [] for i in xrange(1, n+1): if n%i == 0: t.append(i) return t change that to def genfact(n): t=[] for i in xrange(1,numpy.sqrt(n)+1): if(n%i==0): t.append(i) t.apend(n/i) since if a is a divisor than so is b=n/a, since a*b=a*n/b=n, That should help a part already (not sure if in your case a square is possible, but if so, add another case to exclude adding the same number twice) You could devise a recursive thing too, (like if it is something like for 28, you get 1,28,2,14 and at the moment you are at knowing 14, you put in something to actually remember the divisors of 14 (memoize), than check if they are alraedy in the list, and if not, add them to the list, to

Categories : Python

Navigating a webpage from hyperlink in different project but same asp.net solution
If you have 2 web projects in solution, that means you have 2 different web applications altogether. The only way you can navigate from a menu in one application to another, is simply by creating a link. Example: Assuming: Page1.aspx (in project1) is located in http://localhost/App1/page1.aspx Page2.aspx (in project 2) is located in http://localhost/App2/page2.aspx You can create a link in the menu in page1.aspx to page2.aspx by having link in the menu that points to: http://localhost/App2/page2.aspx In other words, your menu has to have an element that reads this: <a href="htp://localhost/App2/page2.aspx">Take me to page2 </a> I hope this is clear.

Categories : Asp Net

Solution with web project and web service deployment to azure
To perform diagnostics during development, one useful technique is to activate Remote Desktop on the cloud instance and connect to the server to check the event logs for errors. If you have Visual Studio Ultimate, you can also use Intellitrace to collect debugging information on the published cloud service. See Debugging a Published Cloud Service with IntelliTrace and Visual Studio. You can also debug locally using the emulator. See Debugging a Cloud Service in Visual Studio. As for your project architecture, you have a few alternatives: Add a web role for each project; i.e., one web role for the web project and another web role for the service project. This will create two instance groups, and one of this roles will be assigned the TCP port 80; the other role will be assigned another

Categories : C#

How to call a web service from the othe er project or solution in ASP.Net C#
You have search How to Consume Webservice to other project. For Example if you are running your webservice in your system, it will give you URL like this http://localhost:54808/WebSite4/Service.asmx http://127.0.0.1/WebSite4/Service.asmx If you want to consume your webservice to other project you have to host your webservice or you need to have webserver to do this. to consume your webservice you have to use Your system Network IP address Example: http://192.2.0.1/WebSite4/Service.asmx by using this URL ,you can consume it in any other project according to you convenient. I hope it will you. Have a nice day

Categories : C#

Remove project from solution via Package Manager Console
Looks like it is "Delete" instead of "Remove". See this MSDN article Project prj = dte.Solution.Projects.Item(1); prj.Delete();

Categories : Visual Studio

Different class file templates per solution + project type
You could replace the .zip files that contain the templates and rerun devenv.exe /setup each time you want to load a different set. Or you can create your own project template and item templates and implement fancy logic in the IWizard interface to transform the template in any way you want. You'd have to implement this yourself, there is no out of the box solution that does this right now. You could store the item templates as part of your solution I suppose.

Categories : Visual Studio

Project Euler #13 in Python, trying to find smart solution
You could save the numbers in a file (with a number on each line), and read from it: nums = [] with open('numbers.txt', 'r') as f: for num in f: nums.append(int(num)) # nums is now populated with all of the numbers, so do your actual algorithm Also, it looks like you want to store the sum as an array of digits. The cool thing about Python is that it automatically handles large integers. Here is a quote from the docs: Plain integers (also just called integers) are implemented using long in C, which gives them at least 32 bits of precision (sys.maxint is always set to the maximum plain integer value for the current platform, the minimum value is -sys.maxint - 1). Long integers have unlimited precision. So using an array of digits isn't really necessary if you are wor

Categories : Python

T4 template adding assembly of existing project in solution
T4 works nearly completely independent from the rest of your code. You're on the right track though, with the assembly directive, but you'll need to specify a full path to the actual DLL of the assembly, unless the assembly is in the GAC (which it probably isn't). Luckily, however, you can use MSBuild macros in T4 directives. So, you'll probably get something like <#@ assembly name="$(SolutionDir)Project.Common.WebApiinDebugProject.Common.WebApi.dll" #> See MSDN for some more background on this syntax. You still also need the import namespace directive. Finally, be wary of project build order. The project that contains your T4 template now depends on Project.Common.WebApi, so you'll need to make sure that Project.Common.WebApi is built first. Otherwise, your T4 template might

Categories : C#

How to deploy an html website without a solution/project file
How would you deploy it manually? If it's a simple file copy you can customize your build workflow to do that. Alternatively, you could create a MSBuild file (.build) that did it, check the build script in, and point to that for your Items To Build.

Categories : Tfs

How to run debug on a project selected in Solution Explorer with a key combo?
Find this msdn doc http://msdn.microsoft.com/en-us/library/aa301747(v=vs.71).aspx, it already explains quite clearly. If you have any more doubt, we can discuss it further. Update: I've done this on my computer with Visual studio 2010. After seeing this dialog, choose an action from the drop down lists under the Show commands containing, in your case, choose Debug.Run. Then choose global in the Use new shortcut in list, and in the Press shortcut keys your customized shortcut key, for example Alt+r, press Assign. Press OK. After all the settings, I press Alt + r, my selected project compiles and runs, just the same as the menu Debug->Run. Hope I've made myself clear for your solution.

Categories : Visual Studio 2010

Self-hosting ASP.NET Web-Api as Windows Service with Controllers in different project within solution
MapHttpRoute is for controllers, derived from ApiController only. HomeController is derived from Controller, so it can't be mapped in this way.

Categories : C#

VS2010 x64 solution builds, but deploy project fails
The fact that I can't select anything other than "Any CPU" is a little frustrating. It was probably meant to get you to do the Right Thing. You should select AnyCPU as the Platform target setting for the projects, not x64. AnyCPU says what it does, it will run as 64-bit code on a 64-bit operating system. And still work in 32-bit mode as well, such as used in Visual Studio which is a 32-bit process. Do note that for managed projects, it is the Project + Properties, Build tab, Platform target setting that matters, not the name of the solution platform. Set it to AnyCPU. In VS2012 untick the "Prefer 32-bit" option. Explicitly targeting x64 is only necessary for unmanaged code, such as generated by the C++ compiler. It isn't clear from the question whether that applies.

Categories : Visual Studio 2010

Create Solution/Project programmatically without Visual Studio
I think generating the solution is a little extreme. The solution file structure hasn't changed much since 2005 http://msdn.microsoft.com/en-us/library/bb165951(v=VS.80).aspx, and there are a few projects trying to automate their generation, like Premake https://bitbucket.org/premake. However, the kind of scenario you describe, might be I believe (better?) adressed with t4 templates http://msdn.microsoft.com/en-us/library/vstudio/bb126445.aspx, or only project file generation.

Categories : C#

How to change the output directory of a project in the solution file
What you describe can be done with Property Sheets in Visual Studio. See here: http://msdn.microsoft.com/en-us/library/3z7t21ew%28v=vs.90%29.aspx

Categories : C++



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