How do I set up Microsoft Contracts static checking in Visual Studio 2010? - design-by-contract

I recently downloaded Visual Studio 2010b2, and wanted to re-evaluate some of my questions about the Microsoft contracts static checker.
I managed to re-use most of the code by using the System.Diagnostics.Contracts namespace for the code, but I am unsure of how to enable the static checker. Do I need an additional plug-in?
I was under the impression that design-by-contract was supposed to "just work" in VS2010.
Thanks for your help.

I was hoping it would 'just work', too. It doesn't. You still need to install the bits to get the static checking.

Related

BIML - How to set .NET Framework version in a Script project using BIMLExpress

I'm creating script tasks in SSIS packages using the free BIMLExpress. Since we have different versions of .NET Framework installed in our environment I really need to be able to set the Framework version for the script project. Although I know how to change it manually, it would be very difficult to change it manually.
I have already tried looking for a solution and this answer suggests to use TargetFrameworkVersion property but I don't see that property at all, I've tried using it with no effect. I don't know if it only works with BimlStudio the paid version.
I'm using BIMLExpress 5.0.61915.0 with Visual Studio 2015.
Any help is greatly appreciated.
Thanks
I opened the generated .dtsx package and found that the TargetFrameworkVersion node placed inside of a separate PropertyGroup node. After I had moved it out to the first PropertyGroup of the same arrayElement node, then reopened my package in Visual Studio again, issue was gone! So you can write a script to move TargetFrameworkVersion node into the proper place for now.
Varigence support team told me that a public preview release is coming late next week which will include a fix for that.

How to open this .net project with no errors

I have this project from github, database on sales and inventory system. But when I open it, it encounters errors.
I really need help on how to open this project with no errors? What should I do to fix this project?
PS: Need a step by step explanation regarding this, I just started databases, so I'm not sure what other tools I should be needing like MS Access or SQL.
The error is self-explanatory: underlined data types cannot be found.
That's means these types are defined in assemblies, currently not available to the compiler.
So in order to build the solution you need to supply these assemblies. There are multiple options, but I'd recommend doing this through NuGet as it is fully automated(you know about it, right?).
The missing assembly is related to the Microsoft.Reporting. So install this and try to build again.

Try-before-you-buy

I want to submit an app I wrote to the Windows store. All the examples I have found about implementing trial functionality in an app, seem to be dated. For example, most tell you to add the using directive 'using Microsoft.Phone.MarketPlace; which causes Visual Studio 2013 to ask if I have forgotten an assembly reference. Am I supposed to add a NuGet package or something? Any help would be greatly appreciated.
using Microsoft.Phone.Marketplace;
Can anyone suggest a good, reliable, and current source of information?
It should be in the Microsoft.Phone assembly, Microsoft.Phone.dll.
It may be available as an assembly reference on your machine, I couldn't see it on nuget.org.
https://msdn.microsoft.com/en-us/library/windows/apps/microsoft.phone.marketplace.licenseinformation(v=vs.105).aspx

Change compiler errors language in Visual Studio 2013

I installed the english version of Visual Studio 2013. The GUI is in English but compiler errors are in French. That's a nightmare when I want to Google an error...
How can I switch C# compiler output language to English ?
You'd have to switch your machine's system locale to English, Control Panel + Language.
That's a rather impactful change since it also changes the locale for every other program on your machine. One thing you can try (but I cannot verify) is to whack the localization file that the C# compiler uses for strings. On your machine it should be located in c:\windows\microsoft.net\framework\v4.0.30319\1036\cscui.dll. Rename the file so the C# compiler can't find it and is forced to fallback to, hopefully, English. Btw, I guessed at 1036, there are lots of French locales. Locale IDs are listed here.
I have solved this as well. Switching language in the IDE did not worked for me, because if the MS compiler was invoked from another program (Qt Creator in my case), the language output was still in the locale language.
Solution: Remove the language you don't want from Visual Studio using the installation tool and leave only English. It's clean, you don't have to mess with the internal files and you even save some disk space.
Just solve same problem with Deutsch:)
Do this: inside of Visual Studio:
Tools-->Options-->Environment-->International Settings. There you need to download an additional language(i.e. English) and install it.

How to sign a binary as part of post build step using sn.exe from Windows SDK?

I am a totally unfamiliar in this C# Visual Studio programming environment but I am required to finish a task.
I am sorry if my question seems silly. But I really could not understand what other posts on this site or other site on the net explaining. I need a step by step guide to do this final step to accomplish my task.
I have been given an application called MCC written using Visual Studio 2008. However, this application could not run properly in Window Vista due to the issue of DEP. MCC has a function to display video from an IP camera. This required the ActiveX control of AxGif89aLite. However, DEP in Vista is by default enabled. The flag IMAGE_DLLCHARACTERISTICS_NX_COMPAT in PE header do not allow this control to be used. Several tests have been run and identified this is the problem.
From an article online,
http://blog.dyadica.net/archives/data-execution-prevention-workaround, they suggest I need to add the below to MCC post build event.
call $(DevEnvDir).. \tools\vsvars32.bat
editbin.exe /NXCOMPAT:NO $(C:\Program Files\Aerocut\MCC\MCC2.exe)
So, I add this and rebuild the MCC solution file. Then, I cannot get what this last step required me to do.
Please note that if you sign the binary in Visual Studio, flipping the IMAGE_DLLCHARACTERISTICS_NX_COMPAT flag in the post build step after the binary has been signed will result in an assembly that will fail strong name validation. To work around this sign your binary as part of the post build steps.
To do this, use SN.EXE from the Windows SDK.
I am really confused what is this signing binary.
From information that I googled, signing an application is getting a certificate for the program so that it is more secured, am I right here?
I got the SN.EXE in my computer. But, how do I sign my binary as post build step? The binary should be my compiled execution file right?
I reinstalled the MCC with the rebuilt setup file. It still give me the following error:
Unable to get the window handler for the 'AxGif89aLite' control. Windowless ActiveX controls are not supported.
Help is very much appreciated. I would like to express thank you in advance here first.
If you're not signing the executable already as part of the compilation then you don't need to worry about it.