visual studio 2013 on rebuild ddl Issue - c#

I have a asp.net solution which consists of multiple class library whose dll' are been used in one web application.When I build and rebuild the class library I don't face any issue, later when I try to build and rebuild the solution few of my dll files gets deleted from bin.Tried adding reference path but in vein.
Warning : Could not resolve this reference. Could not locate the assembly "classlibrary2". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors. classlibrary1
Error 10 The type or namespace name 'Classlibrary1' could not be found (are you missing a using directive or an assembly reference?)
Note:All projects are in same framework

Related

Namespace for Referenced DLL is Available in Controllers/Models, Not in Views

I have an MVC project that makes reference to a custom DLL in another project. The DLL is called "Web" and has the classes that I need in "Models".
I have added the DLL as a reference in the project where it is needed, and in the controllers and the models of the project, it is available. I can use the line:
using Web.Models.Base;
And
using Web.Models.AppToolKit
And all the objects in those classes are available.
However in the views, in that same project, the Web namespace is not available at all. I get:
Severity Code Description Project File Line Suppression State
Error CS0246 The type or namespace name 'Web' could not be found (are you missing a using directive or an assembly reference?)
And when I use the model I created in the project in the view, which inherits from the reference DLL and compiles with no problem, I get the error:
Error CS0012 The type 'BasicNetPageModel' is defined in an assembly that is not referenced. You must add a reference to assembly 'Web, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'.
Even though that DLL is referenced, and is working in both the models and the controllers for the same project.
I am using VS 2019. I have tried removing/re-adding the reference and cleaning/rebuilding many times.
I have tried adding:
<add namespace="TASWeb.Models.Base"/>
in the web.config.
Any idea?
Looks like the problem was a second DLL, which was referenced from within the first DLL.
The project for that one was set to x86. I set it to ANY CPU, recompiled, then recompiled the first DLL, then the project in question was able to recognize the namespace.

The referenced component 'ceTe.DynamicPDF.40' could not be found in VS Source Control

I am trying to debug a web app in VS Source Control. But, I am getting the error
The type or namespace name 'ceTe' could not be found (are you missing a using directive or an assembly reference?)
The referenced component 'ceTe.DynamicPDF.40' could not be found
On expanding the References folder in the Solution Explorer in Visual Studio, ceTe.DynamicPDF.40 is listed but marked with a yellow warning icon.
How do I fix this? I referred to this Refrenced Toolkit could not be found question but my problem is with the source control code. I do not have the related dll in my local repository of the project so I can't add it's reference.
Resolved this by copying over the respective dll file from the server.

Unable to build caliburn.micro project in TFS 2013 build server

We have a solution which has Wpf project that references caliburn.micro version 3.2.0. The solution builds fine locally with Visual Studio 2015. But the build server (TFS 2013 with MSBuild 14.0) is throwing exception that it cannot find the assembly.
AppBootstrapper.cs (4): The type or namespace name 'Caliburn' could
not be found (are you missing a using directive or an assembly
reference?)
ViewModels\EmcInventoryViewModel.cs (39): The type or namespace name
'IEventAggregator' could not be found (are you missing a using
directive or an assembly reference?)
Checked the build log file and got the following warning,
C:\Program Files
(x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets (1820):
Could not resolve this reference. Could not locate the assembly
"Caliburn.Micro, Version=3.0.3.0, Culture=neutral,
PublicKeyToken=8e5891231f2ed21f, processorArchitecture=MSIL". Check to
make sure the assembly exists on disk. If this reference is required
by your code, you may get compilation errors.
Tried different options like,
Updated to the latest version of Caliburn.Micro
Set the MsBuild Argument with /tv:14.0
No luck.

Build errors ONLY occur when publishing

I'm trying to publish my project which has references to other projects in my solution.
Whenever I build the solution regularly it builds just fine without any errors.
However, whenever I attempt to publish the project I get the message "Build failed".
When I check the output log I see the following 3 errors:
C:\Users\MyUsername\Dropbox\Projects\SEO\QualityLinkBuilder\Web\RealestateJobsMigrations\RealestateJobsConfiguration.cs(10,101,10,124):
error CS0234: The type or namespace name 'RealestateJobsDbContext'
does not exist in the namespace 'RealestateScraper' (are you missing
an assembly reference?)
C:\Users\MyUsername\Dropbox\Projects\SEO\QualityLinkBuilder\Web\RealestateJobsMigrations\RealestateJobsConfiguration.cs(18,56,18,79):
error CS0234: The type or namespace name 'RealestateJobsDbContext'
does not exist in the namespace 'RealestateScraper' (are you missing
an assembly reference?)
C:\Users\MyUsername\Dropbox\Projects\SEO\QualityLinkBuilder\Web\ViewModels\JobsVm.cs(364,51,364,69):
error CS0246: The type or namespace name 'ClosedRealestateId' could
not be found (are you missing a using directive or an assembly
reference?)
However, I have referenced the project "RealestateScraper" and the class RealestateJobsDbContext&ClosedRealestateId exists in the "RealestateScraper" project root namespace which HAS been marked as using in the locations where the output marked the errors.
(like I previously stated, the project builds fine too when not publishing).
What could be the issue here?
I have cleaned&rebuilt but that doesn't seem to change anything.
Note: I'm not showing the code with the errors since it seems to serve no purpose as I am referencing the assemblies in the files correctly (using RealestateScraper;)
I was experiencing this as well- build only failed during publish. Turns out I was using the wrong password for the azure publish and for some reason I cannot explain it would show that the build failed and include some build errors. After correcting the password this was resolved.
Apparently in the RealestateScraper project I was referencing another project .dll at a location where it no longer existed. I updated the reference location and it fixed it.
In my case, I could not identify the error itself. I just changed the publish property "pre-compile". I UNchecked it and then I was able to publish my website
I had some compiler if-then statements in a class. These worked okay when I did a local build, but when publishing they were not interpreted and caused build errors. I refactored my code to remove the compiler directives and it now publishes.
Example:
#if SERVICE
using System.Web
#endif
Changed to:
using System.Web
unfortunately I have the same unresolved problem solution -prog a -prog b completes both the prog and the solution but when I go to publish it gives me error c0246 on using of the project b called in the project a
Help
I tried all of these solutions, and they might have contributed, but I was still getting the error.
I was tipped off by a warning. I had to make this file not read-only within the project, then it worked.
\obj\Release\netcoreapp3.0\PubTmp\Out\web.config

Webservice reference cannot find assembly reference

I have a c# project with a reference that cannot be found when checking in to TFS. The project runs fine when i debug.
It its in my services project the problem is located. I have a reference to lets say ProjectSec. And i have a wewbservice reference to Projectservice.
The webservice uses the ProjectSecurity.Security namespace that is located in the ProcectSec assembly.
When i check in my files i get the following error:
The type or namespace name 'ProjectSecurity' could not be found (are you missing a using directive or an assembly reference?)
Could not resolve this reference. Could not locate the assembly "ProjectSec". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors.
The ProjectSec.dll is located in the lib folder and its there. There is no error when i try to use it elsewhere in my project.
This may not be a perfect explanation but does anyone know what i could try?
I have removed the reference and added it over again, but no luck.
A common pitfall with TFS-build is to have in Source Control something, for example, like this:
$/Sources/Webservice
$/Libs/ProjectSecurity
And then, in the build definition that is validating your checkin, to have only
Active | $/Sources/Webservice | $(SourceDir)
as workspace mappings.(You can access this by right-clicking on the build definition in TeamExplorer, select "Edit Build Definition.." & go to Tab "Workspace")

Categories

Resources