faker-cs icon indicating copy to clipboard operation
faker-cs copied to clipboard

System.IO.FileNotFoundException : Could not load file or assembly 'Faker.Net.Standard.2.0, Version=1.5.136.0

Open ManikandanMani opened this issue 3 years ago • 15 comments

image Unable to use faker references from .net standard 2.0 which is referenced to a .net framework V4.8 test project , the compile time assembly of faker included in a .net standard project is changed to .net framework.

ManikandanMani avatar May 13 '21 15:05 ManikandanMani

Yes, this sucks. Would you like to submit a fix?

Siliconrob avatar May 15 '21 03:05 Siliconrob

@ManikandanMani I can't replicate it can you upload your project somewhere please?

Siliconrob avatar May 15 '21 04:05 Siliconrob

@ManikandanMani I can't replicate it can you upload your project somewhere please?

@Siliconrob https://github.com/ManikandanMani/FakerIssueRepro

ManikandanMani avatar May 16 '21 03:05 ManikandanMani

@Siliconrob , @oriches I assume its similar to this (https://github.com/dotnet/runtime/issues/25770) the issue is caused seems theyhave mentioned that it were fixed it in net472 (https://github.com/Microsoft/dotnet/blob/master/releases/net471/KnownIssues/514195-Targeting%20.NET%20Framework%204.7.1%20copies%20extra%20files%20to%20your%20bin%20directory.md) but i tried targetting net 472 & 48 but didn't resolve , one work around is adding the faker dll under reference include didn't throw any exception instead of adding under package reference include . image

ManikandanMani avatar May 16 '21 04:05 ManikandanMani

Give me a day or so to look over it. Thanks for the upload

Siliconrob avatar May 16 '21 04:05 Siliconrob

@ManikandanMani I was able to reproduce your issue and I tracked it down to the embedded resource. I made some slight changes to the project linking for the resources and it was fine. Here is the fix I think will get this working #17

@oriches can you review?

Siliconrob avatar May 16 '21 17:05 Siliconrob

@oriches Would you publish the change in #17 to nuget please

Siliconrob avatar May 18 '21 17:05 Siliconrob

Pushed, but i think we still have the issue after testing.

Let me know what you see...

------ Original Message ------ From: "Siliconrob" @.> To: "oriches/faker-cs" @.> Cc: "Ollie Riches" @.>; "Mention" @.> Sent: Tuesday, 18 May, 21 At 18:50 Subject: Re: [oriches/faker-cs] System.IO.FileNotFoundException : Could not load file or assembly 'Faker.Net.Standard.2.0, Version=1.5.136.0 (#16)

@oriches https://github.com/oriches Would you publish the change in #17 https://github.com/oriches/faker-cs/pull/17 to nuget please — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/oriches/faker-cs/issues/16#issuecomment-843400691 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AAI6FZ32VEL5IDI5ZC3INKTTOKSF3ANCNFSM442ZCMLQ .

oriches avatar May 18 '21 18:05 oriches

😦😖😞 I will check it tonight, but if it doesn't work I will do further investigation.

Siliconrob avatar May 18 '21 18:05 Siliconrob

I think the nuGet spec is wrong for 4.6 - 4.8 versions, I think they need to be the .net standard versions 2.0 - 2.1, so when they are referenced they will be the correct assemblies when referencing a .net standard project in a .net 4.8 project where Faker is unused from nuGet.On 18 May 2021 19:19, Siliconrob @.***> wrote:

😦😖😞 I will check it tonight, but if it doesn't work I will do further investigation.

—You are receiving this because you were mentioned.Reply to this email directly, view it on GitHub, or unsubscribe.

oriches avatar May 18 '21 18:05 oriches

Yes, you are right it doesn't work. I have an idea about multi-targeting the framework for the library, but it's not working so far. Does this even sound like a good idea?

Siliconrob avatar May 18 '21 23:05 Siliconrob

Multi target did not solve issue. Open to suggestions, but not sure why you want to use NUnit 4.8 framework for tests. Switch to .NET Core or use Xunit is what I would say to do @ManikandanMani

Siliconrob avatar May 23 '21 21:05 Siliconrob

I have an idea of around hacking the nuGet package once installed for the project, if it works it measn changing the nuSpec only, I'll try and find sometime later this week.

Thanks Ollie

------ Original Message ------ From: "Siliconrob" @.> To: "oriches/faker-cs" @.> Cc: "Ollie Riches" @.>; "Mention" @.> Sent: Sunday, 23 May, 21 At 22:04 Subject: Re: [oriches/faker-cs] System.IO.FileNotFoundException : Could not load file or assembly 'Faker.Net.Standard.2.0, Version=1.5.136.0 (#16)

Multi target did not solve issue. Open to suggestions, but not sure why you want to use NUnit 4.8 framework for tests. Switch to .NET Core or use Xunit is what I would say to do @ManikandanMani https://github.com/ManikandanMani — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/oriches/faker-cs/issues/16#issuecomment-846624257 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AAI6FZZ3NQIWOXLUSHREU63TPFUXDANCNFSM442ZCMLQ .

oriches avatar May 24 '21 20:05 oriches

Multi target did not solve issue. Open to suggestions, but not sure why you want to use NUnit 4.8 framework for tests. Switch to .NET Core or use Xunit is what I would say to do @ManikandanMani

@Siliconrob Since our project need xrm.sdk dll which supports only net frameworks , when referencing it other projects types doesn't support xrm.sdk dlls. so net framework was the only option.

ManikandanMani avatar May 26 '21 04:05 ManikandanMani

Multi target did not solve issue. Open to suggestions, but not sure why you want to use NUnit 4.8 framework for tests. Switch to .NET Core or use Xunit is what I would say to do @ManikandanMani

@Siliconrob Since our project need xrm.sdk dll which supports only net frameworks , when referencing it other projects types doesn't support xrm.sdk dlls. so net framework was the only option.

🙁😿

Waiting for what @oriches can turn up

Siliconrob avatar May 26 '21 16:05 Siliconrob