I have a solution in VS 2015 which makes use of multiple similar projects.
I added two new ones from a provided template and now building the entire solution shows two linker errors on those two projects.
I have compared configuration with other similar projects within the solution and everything was exactly the same. Building the projects one by one is successful.
At the Linker properties-> Input-> Additional dependencies I have the following libraries, created from other projects within the solution:
CommonLib.lib;UsermodeLibrary.lib
And the linker error I get is either:
Error LNK1181 cannot open input file 'CommonLib.lib' ProjectName
Or:
Error LNK1181 cannot open input file 'UsermodeLibrary.lib' ProjectName
I put the projects in the same folder as the others, and the solution makes use of filters.
My lab teacher figured this out for me.
For the sake of the answer let's call the new project I added from template "MyProject".
"You have to go the properties of the solution (right click on the solution -> Properties), there you go in the left tab to Common Properties\Project Dependencies.
After that you choose at the middle top of your projects (ex.: MyProject) and in the bottom window, you have to search for UsermodeLibrary and check/select it as a dependency for the project.
The thing is that every project is configured OK in the Project Properties (linker related and the rest), the only problem is that when you are building the solution it has to know per solution that some projects depend on other projects.
Here the dependency hierarchy is the following:
MyProject -> UsermodeLibrary -> CommonLib (-> means "depends on").
That's why you are seeing that CommonLib can't be linked to the project because it is not built before those applications.
Somehow, your templates miss this setup in regard to the Solution in which they are created."
Related
How to reuse steps between two projects in specflow? Though added reference and assembly, the step stays purple. I have two projects(for two different modules) in one solution
ProjectA
Feature
Steps
Pages
And another project as
ProjectB
Feature
Steps
pages
Few steps are common for both the project, situated in ProjectB. So those common steps I am trying to access in ProjectA. I have added reference of ProjectB to ProjectA also added assembly(for ProjectA). But still I can not access the steps from ProjectB to ProjectA.The steps stay purple in the ProjectA feature files.I am wondering if anyone can guide me on this?
Thanks
You have to configure the stepAssemblies in the app.config of your test project.
Have a look at the documentation here: http://www.specflow.org/documentation/Configuration/ (near the end)
basically you need to add a reference to let specflow know that ProjectA is using the steps from ProjectB as a set of external steps. The config is:
<specFlow>
<stepAssemblies>
<stepAssembly assembly="{name-of-assembly-containing-bindings}" />
</stepAssemblies>
</specFlow>
I don't even know how to describe this. I have a WPF project that I've added some libraries to. Libraries I've used in many other projects before. I have the strange issue of, when typing out code, intellisense can fill in things from a library fine, but as soon as I do a build, VS acts like all of these things are undeclared. Import statements suddenly say that I'm trying to reference things that don't exist, etc. But then if I clean the build, all of the references come back fine.
I'm completely stumped, any thoughts?
I have seen this if you are targeting the client profile, but some of the DLLs require the full .net framework.
This can happen if you are using file based references to libraries ($ref) that have corresponding projects in the same solution as the one you are adding references to ($proj).
Visual Studio is unable to (reliably) understand the build order and builds the items out of sequence (the $proj is built before the $ref, but after the $ref's output has been cleaned).
If you have this situation, just change the references to project based references.
Similarly, make sure there are no build events that would alter or move files.
Also, VS will sometimes search for a reference and pick a file at a location that you do not expect. Highlight the reference and check its property page, and make sure its actually where you think it is.
I have a Silverlight solution that has multiple silverlight projects (Views) that all compile to their own .Xap file.
There is one "master" project that handles the dynamic downloading of the Xap files, which works pretty well.
But now I need to make sure that all the references are set to CopyLocal=false in all the View Projects. Only the "master" project can have CopyLocal=true.
This means that the Xap files generated by the Views stay rather small.
What I would like to do is check post or during the build process to see if any of the View projects have a reference with CopyLocal=true.
What would be a smart way of doing this? Using an external tool in the Post Build event? Or perhaps an addin for Visual Studio ? Or creating a macro in Visual Studio for this?
I have looked at using .extmap with assembly caching, but since you have to specify the assemblies in that, this does not solve my problem. I just need to know if there is a reference with the wrong setting and report that. Fixing it is not the question, that will still be done manually. It's just the notification I need.
Solution has 35 projects now, so dont want to check them all by hand every time.
I found a question similar to this one, but it lists msbuild as a possible solution. I would like to know if there is a way to do this using "code" (be it prebuilt in a tool/addin or otherwise)
I have chosen to go the Addin path. I created an addin that listens to : BuildEvents.OnBuildBegin
Whenever that event fires I create a list of all projects in the current solution. Doing a bit of recursive searching since there are also Solution folders that make life in DTE world a bit harder.
Then I loop through all the projects and cast them to a VSProject so I can loop through all the references.
Anytime I come accross a reference that is wrong, I create an ErrorTask where I set the Document property to the full solution path of the reference. To do this I Build the path for the project this reference is in, all the way up to the root of the solution.
The ErrorTask is then sent to an ErrorListHelper class I created, that handles the ErrorTasks and also performs navigation.
If I'm done with all the projects and I found any errors, I cancel the current build and show the Error List window, where my ErrorListHelper holds all the Reference Errors I created.
Whenever I want to navigate to the Reference in question, I activate the Solution Explorer window and get the root of it using an UIHierarchy.
Then I walk the path from the root on down, step by step, using the UIHierarchy to get to the UIHierarchyItems and expand them. Until I get to the deepest level (the reference) and I Select that.
Since I only need it for a certain solution and within that solution for certain projects (.Views.* and .ViewModels.*) I also have some checking for those in place during buildup of the Error List.
It works like a charm, already found 12 "wrong" References in 35 projects where I tought all were well.
I am using a different path now to do this. I have a base class that I can use to write unit tests that have access to the DTE2 object. This way I dont need an addin. This also works for Silverlight projects since the test class does not actually need access to the Silverlight projects, just being in the solution is enough to be able to iterate through the projects and check the references.
It is possible to export settings from one project and import them in another.
However, it seems that only "include Paths" and "Symbols" can be moved to a new project this way.
Is there any reliable way to copy all settings? Particularly I would like to copy the linker settings for my embedded ARM project.
I do not want copy the settings manually, as this is something that will have to be done often by at bunch of people.
The easiest way I've discovered to duplicate the settings for a project is to use another workspace. It takes a few steps to set up but you should only need to do it once.
1. Start a 2nd copy of eclipse and select or create a new workspace.
2. Import your baseline code.
3. Rename the project to something generic like NewProject
4. If your project has files you don't want to be imported into new projects delete them. I find it helpful to keep a few (like main.cpp)
Now back to your original workspace.
1. File->Import->Existing Projects into Workspace Next button
2. Use Browse... to go to your newly created workspace and select NewProject.
3. Check the Copy projects into workspace checkbox.
4. If you have warnings about the project already existing try clicking the Refresh button and make sure you don't have a folder in the current workspace with the same name. [ You can delete a project but not remove it from the hard disk so you have to make sure the intended folder name is not in use. ]
5. Rename the project to your desired name.
6. Start coding...
All the toolchain settings, include paths and library paths should be intact. It seems like a lot of work, but once you do it once its not too bad (as long as you can keep duplicating that one project).
This can be done in simple steps. Useful if you do not want to create new workspaces.
Open the project in the workspace.
Click on project and copy.
On the project tab area, paste the project.
Eclipse asks for a name, rename it to a new project.
Click Ok.
I have a a strange problem with nuke modules i've been developing for a nuke 4.8.4 site.
I have one module that just refuses to allow another module to be placed BELOW it in the same pane. Everything loads fine as long as it is the last module in the pane, but if you move it above the other modules, the others won't load.
I originally thought that it was something odd in the markup of the module causing it to layer over the others - but when I view source on the page, the other modules don't even exist in the source.
Has anyone seen this issue before, and if so, how did you fix the problem?
EDIT:
We've built a dozen modules - and ONE module does this on my machine, but a DIFFERENT module does this on another developer's machine. On each machine, the module that is broken for one dev works fine for the other.
Another interesting thing that we've noticed is that in the case where ONE of these modules is on a page, the GetTabModules will return 2 rows for the one module, both with the same ModuleID.
This sometimes happens to us, especially on older sites, AND especially if there is a long history, possibly with the recycling bin filled with old/deleted modules. It will seem that we keep trying to move a module UP or TOP and it won't move compared to the others.
The problem is easy to see if you look at the database and can see that the Module_Tab record involved has the same sort order number as other modules on the page, OR that it has a null value and adding a +1 or -1 to NULL still returns NULL !
So for us the answer is always to perform the following steps to clear out your issues (and this can be done without accessing the database):
Empty the recycling bin, and then come back to the page
Move all of the modules out of the pane that they're in... so if they are all in the Content Pane, move them to a left or footer pane.
Then, IN ORDER that you want to see them on the page, add each one back to the Content Pane, one at a time.
This process makes their sort order clear/irrelevant and then adding each module back in starts a new ordering number from 1 to 2, etc and after that, all modules will work properly with the normal Up / Down move actions.
It sounds like your module code is blowing up DNN. I'd run the site with a debugger attached and step through the code that is instantiating the modules.
We uninstalled & reinstalled the offending modules, and they work fine now. Must have been some sort of bug in the install process. I'm going to upgrade to 4.9.2 and see if we run into similar issues there.