Postsharp and Fody Compatibility - postsharp

I am using the free edition of PostSharp extensively in a project. I would like to use the PropertyChanged.Fody addin to handle all the PropertyChanged Notifications automatically.
(I know that PostSharp offers a library for this, but it is not free, thus I would like to use Fody)
It appears that when I use both PostSharp and Fody in a project, the debug symbol files goes out of sync with the source code. When I debug a project I can no longer properly step through code. It looks similar to when you attach a debugger in VS to a process where the source code is different than that of the executing binary.
If I disable either PostSharp or Fody, then debugging works immediately again.
Is it possible to use both PostSharp and Fody in the same project? Does this require special / extra configuration?

Related

Nuget won't install Entity Framework into C++/CLI project

I thought this problem was fixed. I'm using Visual Studio 2013 and it is Entity Framework 6.1. I get the error message: PublicKeyToken=xxxxxx is not marked as serializable.
I thought this was fixed. Is it broken again and if so, is there a workaround?
Thanks.
Here is the complete error message when trying to install into a win32 C++ console application. (Built with default settings, no other adds to new build.)
Error: Type
'Microsoft.VisualStudio.Project.VisualC.VCProjectEngine.VCProjectShim' in Assembly
'Microsoft.VisualStudio.Project.VisualC.VCProjectEngine, Version=12.0.0.0,Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a' is not marked as serializable.
Here is the complete error message when trying to install into a C++ CLR:
(Actually, it's the exact same error message.)
Here is the complete error message when trying to install into a General Empty C++ Project:
(Again, same error message.)
Okay, I can finally figure out what you are doing. You are trying to run Nuget to download and install the Entity Framework into a C++ project. Yes, that's going to be a fail-whale. Nuget acquired the ability to install C++ libraries at version 2.5, but that only works for native libraries. Pure C++, not managed code like EF. Being a relatively new feature, it doesn't do anything to stop you from getting it wrong, it doesn't filter the available packages to the kind that can work in a C++ project.
The step that fails is the final one, download and copying files work okay but then Nuget runs a Powerscript script to modify the project properties. Which, for EF, was written to work in a C# or VB.NET project. The VS extension model for C++ projects (implemented by the VCProjectEngine class as reported in the error message) is too different to permit that script to complete successfully.
Do keep in mind that the odds of using EF in a native C++ projects are zero. You'll only have a smallish shot at it in a C++/CLI project. Starting with a project template in the CLR node is a required first step.
The next one is to fool the Nuget installer, add a dummy C# project to your solution and run Nuget to get EF installed into that project. You'll see it adding an app.config file to the project, you need to do the same in your C++/CLI project. And it adds two EF assemblies that you also need to add to your C++/CLI project:
Right-click the project in the Solution Explorer window, Properties
Select Common Properties + References
Click the Add New Reference button
Click the Browse button
Navigate to the dummy C# project's packages\EntityFramework.6.1.0\lib\net45 directory
Select EntityFramework.dll you see there
Repeat to add EntityFramework.SqlServer.dll there.
Be sure to write C++/CLI code to use it. Beware that you'll have a Eskimo's chance to find any. The much saner approach is to create a C# library that uses EF and use that library in a C++/CLI project.

Using Play Framework 2.1.0 with NetBeans

I have started using Play 2.1.0 and I would like to be able to use NetBeans to develop Play Java applications. I'm not really interested in using the IDE to run or test the applications since I can do that from the command line (not that I would mind if I could also have IDE support for that) but I would like to be able to open and edit my project in NetBeans without getting annoying errors where they don't really exist. I am currently using NetBeans 7.3 so I first tried to use the nbplay plugin, however it wouldn't recognise all my imports or managed classes produced by Play. I then tried to import the project as Eclipse project, as described in this and this question, which worked better, but while working my way through one of Play's Java tutorials I am still getting the following errors which make it really annoying to work with NetBeans:
I get an "Expected an operand but found error" error in main.scala.html where #content is used, although I have instructed the IDE to disable HTML error checking for this file.
In my model classes I get errors because the classes do not declare a no-argument constructor and have public variables for persistent attributes.
Any other errors I have not come across yet?
Has anyone managed to make Play 2.1.0 work with NetBeans without getting any of the above errors? I could probably live with the first one (although it would really annoy me) but the rest are showstoppers.
Be aware that the Java hints can be enable or disable in Tools -> Options -> Editor -> Hints -> Select java language.
NetBeans now has Native Support for Play Framework 2.3.x and above: http://nbpleasureplugin.com/documentation/installation.html No Command line needed at all.
The most important features are:
Create, run, debug and test your app directly in the IDE
Routes files support (Syntax coloring, Syntax Error highlighting, Autocompletion, Code navigation, Show implementation code (without navigate to source), Hint to Create method when it doesn’t exist, formatting, Mark occurrences)
Scala Template support (Syntax coloring, Syntax Error highlighting, Autocompletion, Code navigation, Show implementation code (without navigate to source), formatting, Mark occurrences)
application.conf support (Syntax coloring, autocompletion with documentation, formatting, mark occurrences)
Dependency Management (Search on Maven and add them to build.sbt)
2 Code Coverage too.s supported (jacoco and scoverage)
Test Single File
SBT file minimal support
Configurations (Formatting indentation, syntax coloring, port to use, activator parameters, etc.)
*Support play version from 2.3.x and above
Note: I created this plugin.
Also I see this could help you: How do I use Play Framework 2.0 in netbeans

Disable Postsharp in debug builds for entire solution

I have a solution with many projects and I would like to disable Postsharp for debug builds to reduce local developer build times. Is there any way to do this without editing each project file?
I know this may sound like a bad idea, but we are only using Postsharp for exception logging and our builds go through several environments for automated/manual testing (which would use a release build), so we would pick up on any potential issues at this point.
If it helps, Postsharp was added to the projects via nuget.
You can define the compilation symbol (constant) "SkipPostSharp" for Debug mode only.
I don't know how to do it for the entire solution, but it can be done easily
per project.
Project > Setting > PostSharp
Choose Yes for Disable PostSharp for this configuration

Can I enforce code style policy in eclipse IDE for c++ code?

I want that whatever code style i defined in eclipse editor ..should be followed by coders, so can i enforce it as program will not even build without satisfying all the rules???
It think that's not possible out of the box with Eclipse.
There are two problems to solve:
Check the source code for satifying the rules.
There is no support for this in CDT, but there seem to be other tools (see discussion A free tool to check C/C++ source code against a set of coding standards?).
Integrate the check into the build process.
To catch all possible build chains (Internal CDT Build, Makefiles,...), you need to hook into the build process with your own builder which is executed before the CDT build. This requires a plugin to be written.
If your build is using makefiles, it should be rather easy to integrate such a tool into the build process.

GWT Post build command in Eclipse

I am starting getting used to Eclipse, but I have much more experience with Visual Studio. In Visual Studio it is possible to run auto commands after the build has finished.
Now I am creating a GWT project and several other projects at once in one solution (or workspace) in Eclipse. Some files which are compiled with the GWT project needs to be copied to another location when they have been compiled. I am currently doing this manually and would like to do it automatically. I am not doing it often, since the project works fine in debug mode (...?gwt.codesvr=localhost:9997).
But where is the location for executing a post build command for a GWT project in eclipse? Is it possible?
Just open project properties, choose 'Builders' item and click on 'New...' button.
Good question! I'm using Eclipse since about 2003, and I remember that I also wanted a functionality like that back then. However, I got so used to using ant for any serious build, that I completely forgot about it.
There is some useful ant integration in Eclipse (e.g. the ant view), and if you create your GWT project with webAppCreator you already get a few good ant targets you can build upon.
It would still be nice sometimes to have something more GUI-like to do simple multi-step builds with Eclipse. I haven't found anything like that yet, but it's absolutely possible that it exists, especially as a plugin.