How to give a .net 1.1 dll a strong name in VS2003 - visual-studio-2003

I have a .net 1.1 dll I need to digitally sign for a legacy project. I have created a .snk file. What steps must I take in Visual Studio to apply the signature?
Edit: Found this http://www.robrich.org/archive/2006/11/29.aspx

Maybe these links will be helpfull:
Strong name WinForms 1.1
.NET Framework 1.1 Security Guidelines - Strong Names

prepare a key file to give strong name
**ex: sn.exe -k test.dll test.snk

Related

How to create custom TFS check-in policies in .NET Core 2.0?

I'm familiar with the new deployment/installation design of VS 2017, and the way it leaves no footprint on registry.
And I'm also familiar with how we need to change our check-in policy installation from registry manipulation to VS extension creation.
However, now I need to create check-in policies in .NET Core 2.0. The problem is that I need to use Microsoft.TeamFoundation.VersionControl.Client dll to be able to access PolicyBase and also PendingChange classes. This results in FileNotFoundException.
Also I need to use Mono.Cecil as the reflection library, to be able to process things in more detail before checking-in. I can't find if Mono.Cecil supports .NET Core 2.0 or not. Nuget page is not informative and the libraries page on GitHub is also not easy to understand.
And another obstacle is to create a VS Extension. I can't find out the required package definition items to be added to source control.
Can you please provide a simple example of how to create a custom TFS Check-in Policy in VS 2017 via .NET Core 2.0?
Since the policy ends up running in the context of Visual Studio itself, I believe you have to be compatible with the .NET framework that Visual Studio is running in, and that is the "classic" .NET Framework, not .NET Core. Libraries written to a .NET Standard can potentially be consumed by both .NET Framework and .NET Core applications, and I believe you could also include separate executables in an extension and run them as separate processes if there's some piece that absolutely must run in a .NET Core environment, but you can't mix-and-match within a single process, and the extension code itself doesn't get a choice: it runs in the Visual Studio process.

Unable to utilize Entity Framework after deployment

i m using publish option for my project using Entity framework.
the 'bin' of the published folder does contain the dll of project that has Entity framework but the features of my application (using EF) stop working when they Get / Insert Data using Entity Framework .
the error is as follows in my application's File log:
02/01/2015 10:25:36 AM|TraceError |Exception is :The specified store provider cannot be found in the configuration, or is not valid.| |<EOL>
Am i missing any thing? ... Please help.
This might be happening due to system architecture of processors (32 bit and 64 bit versions of dll).
Try the following steps.
Open Inetmgr (IIS).
Go to application pools.
Open advance properties of the application pool on which your application is running.
Set Enable 32 bit Applications (in general category) to True.
I think this will solve your issue.
If you are using an Oracle database, I assume you must have installed the ODP.NET components. Unless you are using a third party provider such as Devart, which offers direct access to Oracle with its DirectConnect feature, there has to be a middle layer that the developer installs which would translate EF to Oracle. (Even if you used a third party provider, then you must have installed that third party provider on your development environment). Long story short, your VM does not have the provider that your developer PC has. You need to find out if you are using ODP.NET or a third party provider on your development PC, (which, I guarantee you, does not come with any Visual Studio or framework installation, somebody has to install it separately), then install it on your VM

MaxLength Attribute in EF4.3.1

The type 'System.ComponentModel.DataAnnotations.MaxLengthAttribute'
exists in both
[path...]\packages\EntityFramework.4.3.1\lib\net40\EntityFramework.dll
and
'c:\Program Files (x86)\Reference Assemblies\Microsoft\Framework
\.NETFramework\v4.5\System.ComponentModel.DataAnnotations.dll'
Now, I have read on msdn that its safe to exclude the EntityFramework reference (which was added through the nuget package). However, when I do that, I cant create a DBContext properly as the DbModelBuilder class lives in the EntityFramework dll. Also, some other critical classes are missing when I remove the EntityFramework refference so this is old and irrelevant solution now.
Update (disambiguation): Both System.ComponentModel.DataAnnotations.dll and EntityFramework.dll include System.ComponentModel.DataAnnotations.MaxLengthAttribute. The problem is that each dll also includes other classes that are critical to EF code-first design. For example:
EntityFramework.dll:
- System.Data.Entity.DbModelBuilder
System.ComponentModel.DataAnnotations.dll:
- System.ComponentModel.DataAnnotations.RegularExpressionAttribute
Add this statement to top of your class
using System.ComponentModel.DataAnnotations;
System.ComponentModel.DataAnnotations namespace is distibuted across the EntityFramework.dll and System.ComponontModel.DataAnnotations.dll. So you need to add a reference to both of that in your project to make use of DataAnnotations.
The MaxLenth attribute is present in EntityFramework.dll. So make sure you have that reference to that dll present in your project references section.
EDIT : As of .NET framework 4.5, this namespace is moved to the System.ComponentModel.DataAnnotations.dll. So If you use .NET Framework 4.5 with Entity Framework 4.3.1 or less, You will run in to this conflict. The solution is to switch to Entity framework 1.50 beta 1/ 2 release if you want to stick with .NET 4.5 or downgrade to .NET 4 to use EntityFramework 4.3.1.
From the msdn documentations.
Starting with Entity Framework 5.0 Beta 1, the EntityFramework.dll
does not contain definitions for data annotations. These definitions
were moved to System.ComponentModel.DataAnnotations.dll and are
defined in the System.ComponentModel.DataAnnotations.Schema namespace.
I didn't have the option of upgrading the project to use EF5, or downgrading the build machine to .Net Framework 4.
There is a way to solve this though! It turns out when you install Visual Studio 2012 it adds the following folder (amongst others).
C:\Program Files\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0
In VS if you open a project targetting 4.0 and look at the properties of your reference to System.ComponentModel.DataAnnotations you'll see that the path is pointing to the above location, rather than the GAC.
This folder contains the original Framework 4.0 assemblies. If they're present on the machine then MSBuild etc., upon building a project targeting 4.0 will reference these rather than the modified ones that 4.5 puts into the GAC.
In our case this meant we could fix the problem by copying that folder from a dev machine with VS installed up to our build server in the same location. (N.b. We only needed to copy this folder, there was no need to install VS on the build server).
More info here: http://marcgravell.blogspot.co.uk/2012/09/iterator-blocks-missing-methods-and-net.html
Hope this helps someone else!

How to ensure valid version of System.Web.Mvc is used

My hosting provider has MVC 2 Preview 2 installed on server.
How to ensure my app uses MVC 2 Beta dll ?
Add the .dll to a folder in your project, and reference it by browsing to it in the Add Reference dialog. Make sure it gets uploaded with your project.
Using file references will always ensure you're referencing the assembly you want. If you use GAC references, then the reference can change to some other assembly version unless you've specified to use a specific version.

Sharing ASP.NET MVC applications

Like everybody else on this planet, I am currently working on a blogging engine using ASP.NET MVC .
I am planning to make this open source under GPL, with a requirement that people already have ASP.NET 3.5 already installed on their machines. Let us say that they do not already have ASP.NET MVC installed (on a shared host)
But, I would like them to host my application inspite of that.
I found this interesting post here by Haack http://haacked.com/archive/2008/11/03/bin-deploy-aspnetmvc.aspx, which suggests to include the below references in Bin directory
System.Web.Mvc
System.Web.Routing
System.Web.Abstractions
My question is, Is it legal for me to include these assemblies in the bin directory when sharing the application?
Thanks,
Chandra
Yes it is. These are redistributable assemblies.
The license is MS-PL, an open source license from Microsoft that allows redistribution.
http://weblogs.asp.net/scottgu/archive/2009/04/01/asp-net-mvc-1-0.aspx
The only catch is that it's not compatible with GPL, so you may want to think of using a different open source license for your project.
Since ASP.NET MVC is released under the Microsoft Public License, you can read more here http://www.opensource.org/licenses/ms-pl.html
I'd say that'd be perfectly legal. It is open source after all.
You can also read some more about the license here: http://www.opensource.org/licenses/ms-pl.html

Resources