Quantcast
Channel: MSBuild forum
Viewing all 2763 articles
Browse latest View live

SGEN "Could not load file or assembly file '' or one of its dependences. Operation is not supported."

$
0
0

I am getting the following error when I try to build an ASP.NET 4 project in Visual Studio 2010: "Could not load file or assembly 'file:///C:\Dev\project\trunk\bin\Elmah.dll' or one of its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515)".

I have verified that the dll does, in fact, exist, and is getting copied to the bin folder correctly. I have also tried removing and then re-adding the reference to the project.

The build only fails when I switch the Solution Configuration to "Release". It does not fail when the Solution Configuration is set to "Debug".

The only difference between the two configurations (that I know of) is shown in the following Web.config transform, Web.Release.config:

 

<?xmlversion="1.0"?><configurationxmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform"><connectionStrings><addname="SqlServer"connectionString="" providerName="System.Data.SqlClient"xdt:Transform="SetAttributes"xdt:Locator="Match(name)"/></connectionStrings><system.web><compilationxdt:Transform="RemoveAttributes(debug)"/><customErrorsmode="On"xdt:Transform="Replace"><errorstatusCode="404"redirect="lost.htm"/><errorstatusCode="500"redirect="uhoh.htm"/></customErrors></system.web></configuration>

 

I have tried using Fusion Log Viewer to track down the assembly binding issue, but it looks like it is finding and loading the assembly correctly. Here is the log:

 

*** Assembly Binder Log Entry (6/8/2010 @ 10:01:54 AM) ***

The operation was successful.
Bind result: hr = 0x0. The operation completed successfully.

Assembly manager loaded from: C:\Windows\Microsoft.NET\Framework\v4.0.30319\clr.dll
Running under executable c:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\bin\NETFX 4.0 Tools\sgen.exe
--- A detailed error log follows. 

=== Pre-bind state information ===
LOG: User = User
LOG: Where-ref bind. Location = C:\Dev\project\trunk\bin\Elmah.dll
LOG: Appbase = file:///c:/Program Files (x86)/Microsoft SDKs/Windows/v7.0A/bin/NETFX 4.0 Tools/
LOG: Initial PrivatePath = NULL
LOG: Dynamic Base = NULL
LOG: Cache Base = NULL
LOG: AppName = sgen.exe
Calling assembly : (Unknown).
===
LOG: This bind starts in LoadFrom load context.
WRN: Native image will not be probed in LoadFrom context. Native image will only be probed in default load context, like with Assembly.Load().
LOG: No application configuration file found.
LOG: Using host configuration file: 
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
LOG: Attempting download of new URL file:///C:/Dev/project/trunk/bin/Elmah.dll.
LOG: Assembly download was successful. Attempting setup of file: C:\Dev\project\trunk\bin\Elmah.dll
LOG: Entering run-from-source setup phase.
LOG: Assembly Name is: Elmah, Version=1.1.11517.0, Culture=neutral, PublicKeyToken=null
LOG: Re-apply policy for where-ref bind.
LOG: Where-ref bind Codebase does not match what is found in default context. Keep the result in LoadFrom context.
LOG: Binding succeeds. Returns assembly from C:\Dev\project\trunk\bin\Elmah.dll.
LOG: Assembly is loaded in LoadFrom load context.

 

I feel like there is a fundamental lack of understanding on my part as to what exactly is going on here. Any explanation/help is much appreciated!


Microsoft.Cpp.Win32.user property sheet file shared by both VS2010 and VS2012?

$
0
0

I have both VS2010 and VS2012 installed.  The problem I had initially was that VS2012 projects would not build complaining of a missing Kernel32.lib file.  Subsequent searching through the forums revealed the issue was that the Microsoft.Cpp.Win32.user property sheet file was referencing in Library Directories "$(WindowsSdkDir)lib" which will not work for VS2012.  It should be changed to "$(WindowsSdk_LibraryPath_x86)lib" instead. 

I changed it and that does make VS2012 build okay but it breaks VS2010.  It appears both VS2010 and VS2012 use the same Microsoft.Cpp.Win32.user file.  Is there some way to have VS2012 use a different Microsoft.Cpp.Win32.user from VS2010 so that both will build projects successfully?  The file is located in C:\Users\<me>\AppData\Local\Microsoft\MSBuild\v4.0.

If the Microsoft.Cpp.Win32.user property sheet is meant to be shared by all VS versions, then is there some way to have all new VS2012 projects automatically inherit a custom property sheet I create?  For example, I made a custom property sheet called"Common" that is identical to Microsoft.Cpp.Win32.user.props except that "$(WindowsSdkDir)lib" was changed to "$(WindowsSdk_LibraryPath_x86)lib" in the Library Directories row and I added that to my VS2012 project.  It built successfully (while VS2010 projects are unaffected). 

So my VS2012 project now shows this in property manager:

Thanks in advance for solutions.

How to build a solution within C# (.NET 4.0) ?

$
0
0
 

With .NET 3.5 I could build a solution or a project with the following code:

Engine e =newEngine();

BuildPropertyGroup properties =newBuildPropertyGroup();

properties.SetProperty("Configuration","Release");

properties.SetProperty("Platform","Any CPU");

bool ok = e.BuildProjectFile(solutionOrProjectFileName,newstring[] { "rebuild" }, properties);

 

With .NET 4.0 the class Engine has been deprecated.

With the following new way I can build a project but no solution:

var pc =newProjectCollection();

pc.SetGlobalProperty("Configuration","Release");

pc.SetGlobalProperty("Platform","Any CPU");

BuildManager.DefaultBuildManager.Build(newBuildParameters(pc), newBuildRequestData(newProjectInstance(projectFileName), newstring[] { "Rebuild" }));

 

HOW CAN I BUILD A COMPLETE SOLUTION???

TFS Build Definition Configurations to Build

$
0
0

In a TFS build definition, the "Configurations to Build" field's tooltip states:

"If no configurations are specified each solution or project will be built using its default configuration."

How do you identify/change what the default configuration is for a given solution or project?

Wildcards with

$
0
0

Is there any way to import all of the targets files matching a wildcard?  It would be nice if one could do this:

<Import Project="Custom.After.Bentley.*.targets" />

Since that doesn't work , is there some more elaborate incantation that can work?

 

 

VS2012 Won't Publish Website with Virtual Folders

$
0
0

I have several web sites that contain virtual folders in the project and will not publish.  The error is "/website/virtualfolder/foo.ascx does not exist.

If I run the project in debug mode using IIS express everything runs and works great.  It's only on the publish that this has started to fail.  This has worked in the past and I believe that something in Update #3 for VS2012 has caused this error to occur.

The only work around I have found is to copy the contents of the virtual folders to physical folders in the web site and publish.  Once the website has been deployed to the web server, I remove the physical copies of the virtual folders and the web site works using the original virtual folders on the web server.

Has anyone come across this same problem?  Is there a fix for this?

'System.Windows.Input.ICommand' claims it is defined issue with MSBuild

$
0
0

I am running a continuous inspection system in which I use msbuild for building solutions and part of the analysis is done with fxcopcmd (10.0). With one project of one solution, the fxcop however seems to get engine exception that were related of not finding referenced ICommand. 

The exception message in fxcop report file is following:

<ExceptionMessage>The following error was encountered while reading module 'xxx.yyy_Accessor': Could not resolve type reference: [System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]System.Windows.Input.ICommand.</ExceptionMessage>

When I started to investigate the reason, I noticed that for that one specific project I get following warnings from msbuild when building it:

warning CS1684: Reference to type 'System.Windows.Input.ICommand' claims it is defined in 'c:\Program Files\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.dll', but it could not be found

This seems to be in line with failure of fxcop to analyze project.

Strange part on this is that whenever I build the solution first through Visual Studio IDE (using 2012), and then running fxcop from command line, the fxcop does not fail on that which would indicate that the reference issue does not exist when I build in VS IDE. 

There are also other projects in same solution that are using ICommand and they have no issues when building with MSBuild.

The project I am building is targeting to framework 4.0. I have also checked that all the assemblies of the project are referencing on the reference assemblies paths as they should. In addition I've removed and added PresentationCore and System assemblies, cleaned and rebuild, and also deleted obj an bin folders in middle just to be sure. 

None of those actions seem to help, but situation seems to stay as it is.

So if anyone has tackled similar situation, or has any ideas of what to try next, I'd be very thankful.

Package deployment through web application

$
0
0

Hi,

        I am working on a web application, and I have such requirement where user can install a package in running application.

I have 5 Packages in my application, so it will be a free option to user what he wants to install on his site.

When I googled it, I got to do it through Command Prompt-> msdeploy command, but is there any other way, we can do same thing through our application( because we can not ask to user to do it on Command Prompt).

Please help me by sharing your ideas with me.

Thanks

VD

<style type="text/css">img.imageResizerActiveClass{cursor:nw-resize !important;outline:1px dashed black !important;} img.imageResizerChangedClass{z-index:300 !important;max-width:none !important;max-height:none !important;} img.imageResizerBoxClass{margin:auto; z-index:99999 !important; ; top:0; left:0; right:0; bottom:0; border:1px solid white; outline:1px solid black;} </style>

TFS Build Drop folder structure

$
0
0

Hello,

I'm completely a noob to the MSBuild and TFS Build so please forgive me if this is a very basic question. I've tried to found informations about it but it still obscure for me.

I've a solution containing many projects with direct references on some projects and just dependencies in others.

For exemple :

I've found sample (in MSDN and blogs) where the build output gets a folder for each projects. I would like to do something similar but only for some projects...

I would like to know if it is possible to get a build which looks like this :

Solution_yyyyMMdd_HHmm\
  Service\
    Project_SVC_1.exe
    Project_SVC_1.exe.settings
    Project_DLL_1.dll
    Project_DLL_2.dll
    Project_DLL_3.dll
    Project_DLL_5.dll
    Project_DLL_6.dll

  Web\
    web.config
    ... (web project files)
    bin\
      Project_DLL_3.dll
      Project_DLL_4.dll

Does someone knows a good book about MSBuild and TFS  (may be 'Inside The Microsoft Build Engine 2nd Edition') ?

Thanks for your help.



LNK2011 -- but stdafx.obj *is* linked in

$
0
0

I have a customer w/ a large solution composed of many projects.  Several of the projects are getting LNK2011. When he compiles w/o using PCH, everything is fine, (but slow). 

Additionally, there is a LNK1120 message: "fatal error LNK1120: 1 unresolved externals", but no symbols are listed, and we don't get the LNK2011 message, so it makes no sense whatsoever.

This is an MFC project created w/ the MFC wizard, using PCH thru stdafx.cpp, (and stdafx.h).  The stdafx.obj file is on the linker command line.

Can anyone shed some light on what triggers LNK2011?  Ie: What makes the linker *think* the the PCH object is not included?

What happens to CodeBehind file after publishing - Visual Studio 2010

$
0
0

During deployment to dev site my code was erased and I have no backup accept for when I published to production site.  When taking files from prod I do not see the codebehind files anymore.  What happens to them and is there a way to get them back or get the code they use?

Thank you in advance. 

Example:

default.aspx has codebehind file default.aspx.vb

When I publish to a website I don't see the default.aspx.vb file on the website. 

How do I regenerate the codebehind file if I only have the published page?

Auto Publish WinForm Application through ClickOnce Deployment on a specific build.

$
0
0

Hi,

I wanted to auto publish the winform application using TFS 'Click Once Deployment'. I am publishing the application to a network share. I have several build definitions for the project like CI build , Daily build etc. I wanted the auto publish to happen only when the Daily build runs and not for any other builds. Is there a way where we can set those settings in TFS, either in build definitions or in 'Click Once Deployment' settings. 

Thanks for the help!!


-Chandrahas

MS Build mismatch dll version

MSBuild error "CSC : error CS2001: Source File 'x' could not be found" with Linked Files after upgrading to Visual Studio 2012

$
0
0

Greetings,

After automatically upgrading the project file for a .Net 4.0 web application to work with Visual Studio 2012 everything worked ok at first however when compiling I got lots of errors like this:

And when trying to build using MSBuild (passing just the project full path, with no additional parameters) in the "Developer Command Prompt for VS2012" we got basically the same errors:

Basically: "CSC : error CS2001: Source File 'x' could not be found"

All errors refer to Linked Files (aspx,cs,etc) located in other web applications projects located at a different deep in our code Branch (that's why all the '..\..\' at the beginning of the paths)

To me it looks like a problem with the file Length, I had the same problem a while ago when building the projects on our CI server using MSBuild, I was able to manage it by manipulating the project files before building them using a custom script without the need to move the branch around or reduce the deep of the projects, I didn't have to move anything, the important thing at the time it was that developers using Visual Studio 2010 could compile everything without problems. I learned by this that compiling/Building with MSBuild was different that with DevEnv/VS, and for example MSBuild didn't support building Setup projects and DevEnv did.

Since this is happening now with VS 2012/DevEnv 2012 , plus that VS 2012 doesn't support setup projects anymore (like msbuild), plus VS/DevEnv have the same problem with the file length, it looks like VS 2012 its finally using msbuild under the hood or are more tightly integrated, however I didn't find any article to confirm this. 

Changing the branch structure/changing the deep of the projects its not an option right now due to several reasons (large code base, high number of projects, risk , timing, effort, etc).

Does someone have an alternative solution or a fix for this issue in Visual Studio 2012?

Regards,


JPC

Error signing assemblies in VS2012

$
0
0
I am upgrading several VB projects from VS2010 on Windows Server 2008 R2 to VS2012 on Windows Server 2012.  They all produce signed assemblies which have been built without issue in VS2010 and prior versions of VS for several years.  When I try to Build in VS2012 I get the error "Unable to sign assembly: Error signing assembly -- Incorrect function."  I don't see this on the list for "Al.exe Tool Errors and Warning"....or anywhere else on the Internet.  Does anyone know what might be causing this error?

Tracker/Stampinf error

$
0
0
Hi

I get below err when I try to compile for win8 or 8.1 x64 bit? Pls let me know
how to resolve this. Issue happens only with x64 bit with any of VS (12,13) or
WDKs' (9200, 94*)

1>------ Build started: Project: drive, Configuration: Debug x64 ------
1>TRACKER : error TRK0002: Failed to execute command:
"C:\driver\dependencies\Microsoft\WDK\v8.1\bin\x64\stampinf.exe -d * -a amd64 -v
* -k 1.11 -u 1.11.0 -f x64\Debug\driver.inf". The operation identifier is not
valid.
1> 
1> 
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========v

error MSB3323: Unable to find manifest signing certificate in the certificate store.

$
0
0
Problems began when I received the MSDN Final VS 2005 v8.0.50727.42 and uninstalled the RC build which I had worked with without issue and replaced it with the previously mentioned.

After four or so installs/uninstalls I got past the Invalid license data. Reinstall is required. http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=162712&SiteID=1

I have tested C++ project builds for managed and unmanaged code and both work without a problem. My C# projects however fail to build, the error I get is:

------ Rebuild All started: Project: D And P, Configuration: Release Any CPU ------
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Microsoft.Common.targets(1718,7): error MSB3323: Unable to find manifest signing certificate in the certificate store.
Done building project "D And P.csproj" -- FAILED.
========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========

If anyone has any idea of what a next step is please let me know.

Problem building

$
0
0

I'm developing a fairly largish project in VS2005. A problem I'm having at the moment is that it intermittently displays the error

Unable to copy file ‘obj\Debug\xxx.dll’ to ‘bin\Debug\xxx.dll’. The process cannot access the file 'bin\Debug\xxx.dll' because it is being used by another process.

Which is strange because the only process that has control of that file is Visual Studio. I was just wondering if anyone has come across this before, how they solved it and why it occurred? The xxx dll is used by other dlls say yyy and zzz but they’re not used outside of the solution, and nothing else other that the dlls within the solution uses xxx.

Automating visual studio 2010 builds

$
0
0

Our windows application projects are made on visual studio 2010 and .net framework 4.0.

we are using TFS 2010 for check in and check out but make a build on developer machine, it uses local machine's code for build.

we want to make build from any developer machine or any other machine for the particular version of the project and builds will be made on TFS machine. 

I'm beginner of TFS 2010, and no idea how to automating the builds.

can anyone suggest me step by step process to accomplish that process.

Thanks,

Saurabh

How to solve warning MSB8004 ?

$
0
0

Dear all,

    I developed an application in vc++. In that I am getting 1 warning:

warning MSB8004: Output Directory does not end with a trailing slash.  This build instance will add the slash as it is required to allow proper evaluation of the Output Directory. 

  Anyone please help me to solve this warning..

Thanks & Regards,

Revathy SB


Viewing all 2763 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>