w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
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#

Visual Studio Solution Project Reference or Dll Reference
The approach I use is upload compiled dll into a server in post-build event of dll project and download them in pre-build event of the project I use dlls in. This is the best approach from my experience. When I used project references there were some errors ocasionally (as far as I can remember sth with dll code not updated correctly). In this approach dll project coder decides when he wants to 'publish' the code.

Categories : Dotnet

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++

How to reference custom WiX extension project in WiX installer project?
Under Project Properties » Tool Settings, you could add something like this: -ext ..ExtProjectin$(Configuration)ExtProject.dll It's still a little hackish about constructing the relative path, though. You should still reference the project so that the build order is correct. (The VS team recommends this over Project Dependencies since it works in all build scenarios.)

Categories : Visual Studio

How to reference a web project from another web project with ivy and Resolve in workspace
I've found something, not a solution but at least an explanation, and a work-around. The explanation As the ant documentation says: Note that WTP doesn't support IvyDE's workspace resolver. See the details in the page dedicated to WTP integration. The work-around I've created a normal java project and a symbolic link (can be done also on window) to the web-project source folder in the normal project. This way ivyDe can resolve in workspace the normal project and all modifications still "propagate" in the web-project. Not the best way, but at least...hope it may help someone.

Categories : Eclipse

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#

Can I reference a .NET 4.5 project from a .NET 4.0 project?
The issue is that we can't migrate the project to 4.5 because we have some products that must work on Windows XP. If these products use the "core project", you'll need to leave it targeting .NET 4.0 or earlier. There is no way to use a .NET 4.5 assembly from any project on Windows XP. If you need .NET 4.5 features, you'll need to either upgrade those projects, or maintain two versions.

Categories : Dotnet

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

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

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

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#

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#

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#

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#

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#

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

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

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#

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

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

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

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

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

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#

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#

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#

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

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

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++

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

Common config file in a multiple-project solution?
You can keep the config file in one of the projects physically, and in the rest, add the config file as a link.

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

updating a component using NuGet, when one project in the solution is already updated to the latest one
Right-click the outdated project in the solution and select Manage NuGet Packages from the context menu. Your Manage NuGet Packages window will now only affect the scope of that one project you selected and you should be able to perform an update to the project directly. Repeat for all your other packages.

Categories : Visual Studio 2012

Detach CMake references from the generated solution/project files?
No, that can't be done. Moreover, those rules are not only for re-generating project files if they're not up-to-date anymore. For instance, there's also the CMake command mode that provides portability for copying files, directories, md5 sums and many other nice things. The bakefile project tried to do that (generating independent project files), but it seems it's pretty much dead now.

Categories : Visual Studio 2010

Multi Project / Users / System Global Git Ignore Solution
I don't think there is a standard way to achieve that for a central repo. You might want to write a script that would fetch from a central location and commit any changes to all the repos that you have on the central server.

Categories : GIT

Linker error in VS2010 (2 project in solution and static method)
Try to implement the static method in the .h file like: // example.h class Example { public: void method1() { static_method(); }; private: static void static_method() { // implementation } }; // example.cpp /* nothing here yet... */ // main.cpp void main() { Example e; e.method1(); // it works! }

Categories : C++

create setup for the project solution in visual studio 2008
A simple way to add setup to your project. (1) File -> New Project -> Other Project Types -> Setup and Deployment -> Visual Studio Installer (2) Add a name to your setup project. (3) Right click Application Folder -> Add -> project output (4) *Select your respective project's solution "primary output from yours.."* (5) *Add the respective 3rd party dlls.* // Never forget this one. (6) Right click setup project in solution explorer and BUILD it. (7) Find the respective setup in debug folder(by default) You will get the .exe and .msi in the folder. You can change the configuration between Debug and Release, Right click the setup project in solution explorer -> Properties. You will find a configuration and select the respective one. Check this What is the difference bet

Categories : Visual Studio



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