I installed VS2015 RTM en VS2013 Update 5 RTM. Now my solution is not being created because I have an interface that has an X509Certificate2 return type a. Now my fakes are not being built. I also created a test project, and there I have the same problem, so this is not my solution. The message I get:
Unable to create a stub for ClassLibrary1.Interfaces.ICertificateProvider: method System.Security.Cryptography.X509Certificates.X509Certificate2 ClassLibrary1.Interfaces.ICertificateProvider.getbla () unubbable: the method is abstract and cannot be pointed, enter Systemography.Security.rypt X509Certificates.X509Certificate2 is not available in the original version.
Now I uninstall VS2015 RTM, but the problem is still there. When I comment on a method with a return type, everything works. When I uncomment this, the problem is there.
Update 1 I just tested this on another system. At first I tried it with VS2013 Update 4 en VS2015 RC. Everything was fine with this setting. Then I installed RTM Update 5 on this system, and then it no longer worked. Therefore, update 5 should be a problem! Final update
Playback: Create a solution with two class libraries and one test project with .Net Framework 4.5.1. Creating an interface in a class library 1.
namespace ClassLibrary1.Interfaces { public interface ICertificateProvider {
Create a class in the second class library. Deploy the interface and add a link to the first class library.
namespace ClassLibrary1 { public class CertificateProvider : ClassLibrary1.Interfaces.ICertificateProvider { public X509Certificate2 getbla() { throw new NotImplementedException(); } } }
Add a fake assembly for the interface project in the unittest project. Read the following code in the test:
using System; using Microsoft.VisualStudio.TestTools.UnitTesting; using ClassLibrary1.Interfaces.Fakes; namespace UnitTestProject1 { [TestClass] public class UnitTest1 { [TestMethod] public void TestMethod1() { StubICertificateProvider provider = new StubICertificateProvider(); } } }
Now your project will not be created. If you comment on the method in the interface that your project will be created. Include diagnostics in the .fakes file for the error message.
Any solution?
Update 2 Changing the solution to use .Net Framework 4.6 is working. Switching to 4.5.2 does not work.
Update 3 Link to Github official error: https://github.com/dotnet/coreclr/issues/1303