Visual Studio 11 complains about one namespace import in web.config - reference

I have a .NET 4.0 web site which was coded in Visual Studio 2010.
I installed the VS11 beta last night, and am using that to work on the web site today. I did NOT change the web site to be .NET 4.5, it is still 4.0.
I have a number of custom libraries which I've written, and use in most of my projects (db access, LINQ extensions, etc.). I have them all <system.web><pages><namespaces><add/>ed in the web.config of my project so that I don't need to put an Import line at the top of every file where I want to use things from them.
This all works fine and as expected in VS2010, and in VS11 it all works fine, ... EXCEPT for one single exception. ONE and ONLY one of my custom libraries, when I have it included in the web.config, the design-time compiler outputs an error message to the Error List window stating:
Error: The namespace 'MyLibraries.LIB' is not a valid identifier.
All my other libraries continue to work fine, just as they did in VS2010. I thought maybe there was an invisible character embedded in the file or something, so took out the whole <add/> line for that namespace and retyped it from scratch. No joy. I've also tried removing the DLL (and associated files) from the bin directory and re-adding them, also with no change.

Turns out this wasn't so much a problem with VS11 itself, but with the Framework 4.5.
I uninstalled VS11 and VS2010 still had the same problem.
I then saw that uninsting VS11 did NOT uninstall .NET 4.5, so I uninstalled that, and then 2010 was good.

Related

Prevent Visual studio 2017 from copying almost 100 unnecessary system dlls to output folder for dll project

I made a new .NET Class Library solution if TFS, and added a bunch of preexisting classes that were developed for a windows forms application. Basically just dumped the old folder in. The forms app worked fine and the folders in bin were expectedly barren, apart from the exe and the required nuget references. The dll build however copies over libraries all the way from Microsoft.Win32.Primitives.dll, to System.Xml.XPath.XDocument.dll for no apparent reason. I have removed unused references with ReSharper and commented out unnecessary using statements. No difference whatsoever. I don't think it's a problem from the deployment perspective, it's just annoying to have so many files copied over each build. Could it be that the initial presence of Forms just poisoned the new project forever? Any help whatsoever would be much appreciated.
Prevent Visual studio 2017 from copying almost 100 unnecessary system
dlls to output folder for dll project
Please check if your VS2017 is very old and also check if the framework version of your project targets to 4.6 or 4.7.1.
If so, there is an known issue about this issue.
This is a .net standard 2.0/net 4.6/4.7.1 issue which was improved in 4.7.2. You can check this similar issue.
Suggestion
1) you should first update your VS2017 in case some updates fix it.
2) change the framework version of your project to net framework 4.7.2.(if you do not have net frameowork 4.7.2, you should install it in the VS Installer)

Project is targeting frameworks not installed or are included as part of future updates to Visual Studio

I am attempting to convert the Microsoft.Health C# class library that is installed as part of the HealthVault SDK, using instructions provided here. After following these instructions, I get the following error when attempting to load the project into Visual Studio 2013.
"The project is targeting frameworks hat are either not installed or
are included as part of future updates to Visual Studio. See
http://go.microsoft.com/fwlink/?LinkId=287985"
Visiting the link takes me to .NET SDKs and Downloads. Once there, I have no clue on what needs to be done.
I do realize that one will have to leverage the Portable Class Library Contrib project to fill in some missing bits, especially code related to System.Security. This, I will deal with later.
Any one run into a similar problem?
Maybe so late but for those who have the same problem.
I had the same error in a project which was working perfect before updating VS2013 and finally after 3 hours looking for the source of the error I found that the error is about TargetFrameworkProfile.
In my case I sloved it like so:
Right click in the unloaded project in your solution and click Edit.
Find the TargetFrameworkProfile tag and set it as below:
<TargetFrameworkProfile>Profile78</TargetFrameworkProfile>
At a guess, this is because you need to specify the TargetFrameworkVersion and TargetFrameworkProfile properties in the project file. Compare the .csproj you are trying to create to a newly created PCL project file, and make sure that everything that's not specific to your project matches.
I ran into the same issue and got it resolved by installing the latest Visual Studio Update

TFS Server Side Plugin no longer works in 2013

I had created (modified an existing project) a server side plugin that has been working (on TFS 2012) for quite awhile. When I upgraded the server to 2013, I copied the .dlls over to the same folder within the 2013 directory structure (Application Tier\Web Services\bin\Plugins), but it no longer works.
I installed remote debugging, attached my debugger to the w3wp.exe process (like here: Problem with Custom TFS Web Service Plugin), and performed check-ins. I'm pretty sure everything was in place because the first time I tried Visual Studio reported that symbols weren't loaded, but after copying up the .pdbs it looked
good. The ProcessEvent method never hit.
I can't find any new documentation on this stuff, guess this is just desperation, does anyone know what to do to make my plugin load?
You need to recompile the plugin against the 2013 assemblies (there are tricks using binding redirects, but if you have the sources, please just recompile). And you need to set the .NET framework version to .NET 4.5 in order for the solution to compile (the TFS 2013 binaries target that framework version, so your plugin must target either 4.5 or higher in order to reference these assemblies).

Windows Work flow assemblies not picking up

We we trying to create a work flow dll using Windows Work Flow but we are running into major problems regarding referencing.
1.) We have a class that calls an activity but the class cannot pick up the activity that has already been created
WorkflowAcivity workflowActivity = new WorkflowActivity(string id)
This then throws an error message saying cannot find WorkflowActivity
2.) We then added extra assemblies, like one of our other dll's, Visual Studio also cant find these references when we call a class in those dll's we are referencing.
3.) Intellisence has also stopped working??
What do we do to fix this, is it the version we are using or are there any other assemblies we are missing here??
We have tried opeing the solution on another pc, uninstalled vs 2012 and installed vs 2013 and still have no luck!
Got caused by System.Net.Http.Primitives.dll referencing some dll's that were missing and caused the workflow to break without any warnings.
Removing this dll or adding the referenced dlls back in (System.Runtime.dll and System.Runtime.InteropServices.dll) fixed the problem.
Microsoft ticket for this.

MS Charts version 3.5 in VS2012 giving an error in the designer

We have just upgraded to VS2012 from VS2010. However, any form with a chart control on it will not load in the designer (although it compiles and runs OK). We are using the .Net 3.5 version of MSCharts and cannot go to .Net 4.0.
We are getting errors like:
Could not find type 'System.Windows.Forms.DataVisualization.Charting.ChartArea'. Please make sure that the assembly that contains this type is referenced. If this type is a part of your development project, make sure that the project has been successfully built using settings for your current platform or Any CPU.
The chart control works fine in VS2010, and I have double checked that we have the correct dll referenced, so this looks a lot like a bug in VS2012.
Does anyone know if there is a patch/service pack for this bug?
If not, has anybody figured out a workaround?

Resources