Roslyn Analyzer to analyse and modify csproj file - csproj

Currently I have a script that modifies nuget reference paths in old style csproj files. (for anyone that is interested this is due to building using different solutions which breaks the NuGet reference paths. I have reported it to Microsoft and it is currently in triage).
The script works correctly and does what I need it to, however I thought that this would be a good candidate for a Roslyn Analyzer with a Code fix.
I have played around with analysers and have been able to write several that can modify code within a project, but I am having great difficulty writing one that can work on the csproj file itself.
I have looked at workspaces (VisualStudioWorkspace and MSBuildWorkspace) however it seems to me that these will give you access to the various projects in a solution but will not give you access to the project file itself?
If anyone can give me a pointer to where/what I should be looking for, or if it is actually possible, i'd very much appreciate it.
Thank you

Related

How to pinpoint the source of angular console errors

Note: This question will be changed to eliminate old question with lower rating.
I see AngularJS console errors as follows:
Lexer Error: Unexpected next character at columns 0-0 [#] in expression [#].
The problem now is how to locate the source of this error among thousands of lines of code?
Old Question:
NOTE: This is the old question, please ignore.
I was working with a sample application from ng-flow file upload. I then moved the developed parts to my colleague's environment who is using bootstrap for CSS. I noticed that the look and feel changed on from his environment.
I realized that my colleague is using this css file:
http://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css
and I am using the css file the came with the download:
http://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/css/bootstrap-combined.min.css
and both work fine, but they have clear differences on how the look and feel and how layout is presented.
I included both, and it seems the application is still working fine, and the look and feel is now merged.
I am just wondering if there is documentation that explains the differences and how to decide which one to use.
Appreciate your feedback.
The reason they look different is that they're referring to different versions of Bootstrap - version 3.3.7 vs version 2.3.2. (The other difference is where the files are hosted.) 3.3.7 is more recent than 2.3.2.
Generally, you want to use the most recent version available for whatever libraries you're including, unless you need to stay compatible with an older one. You shouldn't include both, though; that's going to have your users downloading a lot of redundant css.

WPF Could not load file or assembly or one of it's dependencies

I get this error only at design-time.
At runtime everything works just fine. There is absolutely nothing wrong with I-Synergy.Resources class library.
I've searched for this error intensively but no solution.
(already tried:
reset settings VS
clear and rebuild solution
delete obj and bin folders
checked all references and dependencies
converted pcl to regular class library
)
As you probably know, there a lot of questions regarding the notorious "Could not load file or assembly" error many times creeping up our XAML designer.
After reading all the provided solutions, and sadly non of them working for me, I started to investigate this annoying issue.
I spend 4 days trying to figure this out. Luckily today I found the answer to my problem.
In my solution design I created several projects under the WPF application called I-Synergy. Among others I added assemblies named I-Synergy.Controls and I-Synergy.Resources (where I put all my Resource strings, static classes and images).
This last assembly seems to caused this error. Even I don't have any Resouces file (or any other local reference inside the WPF application) it somehow got confused with my I-Synergy.Resources project.
Solution:
I changed the I-Synergy.Resources project to I-Synergy.Library (assembly name and namespaces) and the error has gone. Probably the "Resources" name is a no-go and can be considered as a reserved word.

How to create a setup of an Windows application using PowerBuilder

I am a newbie for PowerBuilder and for Windows application. I have few projects which consists corresponding code in it and after merging all that I get the final product. The problem I am facing right now is that I don't know how to make a setup of my Windows app using PowerBuilder. If I can get step by step procedure with tiny explanation, I will be able to achieve it already. Have tried Google but ended up with complex confusion. I have created the .exe, but that .exe does not work on any other computer. So please guys help me out.
Thanks
There are two parts to creating a setup program for your application: defining the files and other resources that need to deployed, and building those resources into a setup executable package.
For defining files and resources, you've made it impossible for anyone to even take a shot by referring to two very different (but similar origins) versions of the product in your tags: PowerBuilder (aka PowerBuilder Classic) and PowerBuilder.NET. The deployment requirements for apps built from each of these is very different. However, even if we knew, the best advice is to go through the manuals and review what is required of the features of your specific application. (e.g. if you don't use rich text, deploying the files required to support it would be a waste). A generic list is, IMHO, just bad advice.
As far as building a setup package goes, the first decision is which package building software to pick (none comes with PowerBuilder). Any Windows setup package builder should do. I've used InstallShield and Inno, vastly preferring the latter (after many years of using the former). I know you want steps to walk you through, but a walk through is impossible before picking the software, and frankly, walk throughs of these setup building software has been done elsewhere much better than I'd do.
The bottom line is that the answer isn't as simple as you seem to have been hoping, but it is attainable.
Good luck,
Terry.

Is there a tool for helping the extraction of localizable text from Xaml?

I am tasked with the localization of a Windows Phone 7 application. The first step is to replace the actual visible text with an ID and put the ID and the text in a resource file.
This is a very tedious work and I was wondering if there are tools for this to automate?
I am thinking along the lines of the gettext package and .po files used in the linux world.
Here is a codeplex project that may help you some. http://xlocalization.codeplex.com/. To use this method, each control that is to be localized must have the name property assigned.
I tried it with my existing project, and got results that were mixed, but in the long run, I decided to do it by hand. I don't remember specifically what the problems were that I had, but if you want to try it on a copy of your project, it won't take much time. If it works for you (and if your controls to be localized all have names), it could save you time.
Also, I don't know how familiar you are with localizing, but I wrote a blog on the subject that takes you from start to finish. It's at http://www.hopnet.mobi, click Blogs.
Hope this helps.
I know this will get a lot of traditional answers, but I would also like to put forward something completely original we tried (and succeeded) doing ourselves for more efficient localisation of Silverlight using Attached Properties instead of binding:
Localisation of Silverlight projects after completion
To pre-populate the database we wrote a XML parser to find our markers in all our project's XAML files (XAML is just a subset of XML after all). We could not find any existing tools to do what you suggested, but our requirements were simplified by our new method of localisation (no resource files and no horrid bindings).
(yes, this is almost the same answer as a previous one of mine today, but it seems to fit again).
Also for future reference keep an eye out for this tool: http://www.neovelop.com/ This tool will go in private beta soon and looks very promising. Judging from their preview movie this will do exactly what you asked for.

Dependencies of dependencies not being copied to the output directory

I posted this question on the MSDN forum but haven't been able to receive much of an answer, so decided to try it out here.
I'm having a problem with dependency libraries of a project not being copied to the output directory of a second project that references it, when the first library is mostly xaml. Here is a typical scenario when this happens
SolutionX
- SomeControls.Dll { contains wpf user controls }
external reference: WPFTheme.dll*
- MainApp.Exe
project reference: SomeControls.dll
Commonly what happens here is that when building the solution, WPFTheme.dll is not copied to the output directory of the MainApp.Exe project. (* this also works if referencing a third project instead of an external)
I usually use a post build event to handle this situations... but i found the problem was intermittent.
If I don't reference ANY of the classes in WPFTheme.dll in my c# code but I do so in xaml, then as said before the WPFTheme.dll library doesn't get copied.
BUT if i reference Any class (even just assigning them null) from some c# in the project (even backend xaml.cs class) - then everything works as one would expect.
So has anyone else encountered this problem? Is there a way to force the library to get copied if referenced by xaml?
Just to add more info... all this happens with libraries that show up as external in the project file with a relative path in the HintPath.
Thanks everyone,
K
I have this exact same issue with dependency injection through reflection, i get around it with post build events and when deploying nant scripts, sorry i couldnt be more help, look forward to seeing a solution, you can always just add the refs to the startup project directly, can get into some fun issues with that long term but it will work

Resources