Multiproject Template - Adding solution folder and assemblies in a solution - project-template

I am able to create a multiple project using vstemplate and using IWizard to implement project name name conversion but I cannot able to add a solution folder and assemblies into it in RunCompleted method of IWizard. I am using Visual Studio 2010 for developement
Currenly I am trying to use the following code
$SolutionFolder folder = ((EnvDTE80.Solution2)dte.Solution).AddSolutionFolder("Test2").Object;
folder.AddFromFile("C:\\Liquid.dll");
dte is assigned during RunStarted method
$dte = automationObject as EnvDTE.DTE;
I can find the Test2 folder in the solution, but cannot find the dll file inside the solution folder, also I cannot find the physical folder(Test2) present inside the solution
Can anyone help me on this?

Related

sonarlint ruleset files when working with version control

We are using TFS and the added .ruleset files now participates in the check-in process. However, does not make sense to check-in those files. Just ignore the file on the source control does not solve the problem because those files are added in the csproj structure as well. Is there a plan to keep those files in a folder outside the project structure? Why, when connected to the SonarQube server, the plugin just download those files at the analysis time?
Thanks
There is no way to keep .ruleset files outside the project structure, as the rule set is to meet specific project needs associated with code analysis. It sits in a project properties.

Compile Application with local files

So I have a word template that I am trying to populate within my wpf application. It works fine during development. However, when I try to edit the file after publishing/installing the application it no longer has the folder/files that were used in the development process.
What steps do I need to take to have files present after installation to manipulate, create, or delete files?
Right-click the file in VS Solution Explorer, then in file properties set Copy To Output Directory to Copy Always
Add that template as content in your solutions. You will find this from properties.

Dart: Accessing a resource out side the project|web/ directory

I have a web-app(browser based) which needs to access a folder full of icons that resides outside the web folder.
This folder MUST be outside the web folder, and would ideally exist outside the project folder all together
however, when specifying the path to the folder neither "../" or making use of a symlink will work
when the page attempts to load the image I always get
"[web] GET /Project|web/icons/img.png => Could not find asset Project|web/icons/img.png."
however I set the image source to "../icons/img.png"
how can i get dart to access this file properly
PS: I attempted a symlink to another part of the filesystem (where the images would be kept ideally) however this did not work either.
The web server integrated into DartEditor or pub serve only serves directories that are added as folders to the files view. When you add the folder to DartEditor you should be able to access the files. This is just for development.
You have also to find a solution for when you deploy your server app. It would be a hazardous security issue when you could access files outside the project directory. Where should the server draw the line? If this would be possible your entire server would be accessible to the world.
Like #Robert asked, I also have a hard time imaging why the files must not be in the project folder.
If you want to reuse the icons/images between different projects you could create a resource package that contains only those images and add them as a dependency to your project.
If you want a better answer you need to provide more information about your requirements.
If you wrote your own server (by using the HttpServer class) it may be possible to use the VirtualDirectory to server your external files.
Looking at look the dartiverse_search example may give you some ideas.
You could put them in the lib directory and refer to them via /packages/Project/...
Or in another package, in which case they would be in a different place in the file system. But as other people have said, your requirement seems odd.

Wix - How to create a temporary file to use during an installation

In InstallShield there was an easy way to use support files that were only needed for the installation. These were all saved in the ISSetupFiles table, which is a custom table by InstallShield. I'm trying to do a simliar thing in Wix. I'm new to Wix and I haven't yet figured out how create files in the TempFolder for use during my installation and then how to delete them once the installation is complete.
I use C# DTF custom actions and that has a very good story for extracting resources to the current directory of the custom action for the life of the custom action. It's not that difficult to define a custom table similar to ISSetupFiles (but hopefully support directories and not just all the files in one directory ) and then extract them with a custom action, set a property (SUPPORTDIR) to their location and then clean up at the end of the installation.

Check CopyLocal property of all references post/during build in multi project solution (Multi Xap)

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.

Resources