Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
524 views
in Technique[技术] by (71.8m points)

c# - The primary reference "Microsoft.CSharp", which is a framework assembly, could not be resolved in the currently targeted framework

I started a new winforms project, fairly simple, has a few labels, text boxes, and a button. All code is running fine. I forgot to change the framework version from 4 (using VS 2010) to 3.5 before I created the app and when I changed it to 3.5 or 3.5 client profile I get the following warning:

The primary reference "Microsoft.CSharp", which is a framework assembly, could not be resolved in the currently targeted framework. ".NETFramework,Version=v3.5". To resolve this problem, either remove the reference "Microsoft.CSharp" or retarget your application to a framework version which contains "Microsoft.CSharp".

It's not a huge amount of trouble to recreate this with a 3.5 setting from the start and I'm fairly sure I'm not using anything from the 4 framework that I need.

question from:https://stackoverflow.com/questions/4339004/the-primary-reference-microsoft-csharp-which-is-a-framework-assembly-could-n

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

In most/all project templates in VS 2010 for .NET 4, the Microsoft.CSharp assembly reference is added. So when you created the project you were given this assembly reference automatically. You shouldn't have any problems just removing the reference.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...