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

C# Visual Studio 2010 Express IDE, My program runs perfectly, in the IDE - Debug or without Debug... But will not run outside of the IDE.

$
0
0

OK, so I have read all the recommended reading.  And nothing really related.

I am told to do things... that apparently in the Visual Studio 2010 Express... it cannot do... like Dependency Walker??

Also "attach to process", which I cannot find...

If I knew this would be this hard... I would have developed with VS 2008, because I did not have them problems there.

I wanted to use something more modern, so I could move into the future.  

I have been programming for 4 months... so you can understand the extent of my development.  I need to now test it outside the IDE.   But am not able to... cause it don't run outside the IDE?

Why would it run therein, and then on the same computer... Install and not run.  That is crazy

I am willing to run programs, test, find what you need to help me... so please help?

Be aware, I am not an advanced user, of this VS software... My program is written in C#.  It is a new CNC control UI.

Problem signature:
  Problem Event Name:    CLR20r3
  Problem Signature 01:    truemachinecnc4.exe
  Problem Signature 02:    1.0.0.0
  Problem Signature 03:    53bdba98
  Problem Signature 04:    KMotion_dotNet
  Problem Signature 05:    1.0.1.0
  Problem Signature 06:    5133ac38
  Problem Signature 07:    3a
  Problem Signature 08:    e1
  Problem Signature 09:    KMotion_dotNet.DMException
  OS Version:    6.1.7601.2.1.0.768.3
  Locale ID:    1033
  Additional Information 1:    0a9e
  Additional Information 2:    0a9e372d3b4ad19135b953a78882e789
  Additional Information 3:    0a9e
  Additional Information 4:    0a9e372d3b4ad19135b953a78882e789


"File>Open>Open Project/Solution" is not responding

$
0
0

My solution has more than 50 projects and all of them need same VC++ directories.

So In order to set the global settings I modified the file C:\Users\XXX\AppData\Local\Microsoft\MSBuild\v4.0\Microsoft.Cpp.x64.user.props

Since then on VS2012, "Open project" or "File>Open>Open Project/Solution" is not responding.

Not just modification of the props file, I realized any change in the C:\Users\XXX\AppData\Local\Microsoft\MSBuild\ folder is creating the problem.

Steps to reproduce:

1. Open VS2012, click "Open Project". It works and opens a dialog. Cancel it and close VS2012.

2. Go to C:\Users\XXX\AppData\Local\Microsoft\MSBuild\, Copy and past the v4.0 folder. That means you will create a copy of v4.0 folder.

3. Now open VS2012, click "Open Project". It won't respond.

This will not stop my work however I am afraid there may be some more underlying issues because of this.

Microsoft: Please look into it ASAP.

About my VS2012 installation:

Microsoft Visual Studio Professional 2012
Version 11.0.61030.00 Update 4
Microsoft .NET Framework
Version 4.5.51209

Installed Version: Professional


Is it possible to determine the specific Visual Studio 2012 instance that initiated a build from within a build task?

$
0
0

Given a build initiated interactively from a Visual Studio 2012 process, is it possible to find the devenv process that started the build from within a Microsoft.Build.Utilities.Task class via one of the managed properties (or some other non-kludgy way)? I'd like to take into account the possibility of multiple Visual Studio instances having the same solution or project open at the same time.

It appears that the build in 2012, instead of 2010 or 2008, runs completely out-of-process from Visual Studio's perspective and that MSBuild processes are potentially shared between Visual Studio instances.

Thanks.

project referencing incorrect msbuild version

$
0
0

Hi,

I opened a related post here.

My set up is that I have a nuget package that, when installing, calls a command line app that does a bunch of things.  One of those things is creating a config file and including it in the installing project.  When I go to get reference to the project, I get an error:

Microsoft.Build.Exceptions.InvalidProjectFileException: The 
imported project "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" was not found. Confirm that the path in the <Import> declaration is 
correct, and that the file exists on disk.

Notice the Visual Studio version folder: "v10.0."  I, like a lot of my coworkers, only have VS13 installed so none of us will have that. Why is this being targeted? How can we update it so we are pulling the correct version?

TIA,
Matt



There is indeed a harmony to the universe.

ADFS 2.0 Configuration Issue (Cannot connect to ArtifactStorage in the configuration database. )

$
0
0

Hi,

I am new to the ADFS 2.0.I have installed the ADFS 2.0  as per the guid lines given in the       http://technet.microsoft.com/en-us/library/adfs2-federation-wif-application-step-by-step-guide(WS.10).aspx

When i am trying to access the http://MyDomainadfs/ls i am getting the following error.There was a problem accessing the site.

Try to browse to the site again.If the problem persists, contact the administrator of this site and provide the reference number to identify the problem.Reference number: 289aa827-f378-40c9-9c79-637db39aaa1e

 Then i went to the Event logger and checked for the error list these are the errors i am getting into.
 
  • MSIS3115: Cannot connect to ArtifactStorage in the configuration database.
  •  Exception details:
    System.NullReferenceException
       at System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode, IntPtr errorInfo)
       at System.Management.ManagementObject.Initialize(Boolean getObject)
       at System.Management.ManagementBaseObject.get_Properties()
       at System.Management.ManagementBaseObject.GetPropertyValue(String propertyName)
       at System.Management.ManagementBaseObject.get_Item(String propertyName)
       at Microsoft.IdentityServer.Web.PassiveWmiUtility.SettingsObject.get_Item(String propertyName)
       at Microsoft.IdentityServer.Web.PassiveWmiUtility.IsProxy()
       at Microsoft.IdentityServer.Web.PassivePolicyManager..ctor()
       at Microsoft.IdentityServer.Web.FederationPassiveAuthentication.GetIssuerFriendlyName()

If any body knows how to reslove this things please let me know.

Thanks


Venugopal

Faking the ToolsVersion attribute

$
0
0

I have a long running tooling project that creates packages for multiple versions of visual studio (2005/2008/2010/2012/2013). The .csproj files (of which there are dozens) are all heavily macroized using an external targets files that gets the right references, framework version, etc. based on environment variable settings. Although I'm required to have a separate solution file per project for each VS version [these are small files and only the version information at the top changes], I've managed to keep all of the project files loading in all visual studio versions without VS either telling me the files aren't recognized or trying to upgrade them.

The fly in the ointment has been the ToolsVersion attribute, which cannot be macroized due to its placement on the root element of the project file. I always use toolsversion:#.# for command line builds with msbuild, but AFAIK VS doesn't have a similar setting. I've just been setting this attribute to the latest version as new ones roll out: the earlier VS versions have been ignoring unrecognized tools and reverting to their default tool set, and the latest VS version doesn't try to upgrade my project when I open the file.

This worked great until the switch to ToolsVersion="12.0". VS2013 tries to upgrade my projects for any earlier version (the project files were all previously 4.0), but VS2008 refuses to load them at all with this ToolsVersion. After some reading and experimentation, I discovered that VS doesn't care about the number of the ToolsVersion attribute, but rather about what it points to in the registry.

Given that none of the official ToolsVersion numbers work with all of the VS versions I created a fake version instead. The project files now have ToolsVersion="12.34", and I have a small batch file that copies the full contents of 2.0/3.5/4.0/12.0 keys under HKLM\SOFTWARE[\Wow6432Node]\Microsoft\MSBuild\ToolsVersions into the 12.34 key in the same location. I now run my little batch file before opening the projects in a given version of VS (look at the VSVer.bat file in the trunk directory at orm.sf.net if you're curious).

Obviously, this feels like a total hack, but desperate times call for desperate measures. Building the older versions from the latest VS incarnation is not a viable option because I have multiple academic teams that build this project: I can't control which VS version is in use, and I can't make them install specific/multiple/all versions. One project file per VS version is also not a realistic option due the explosion in maintenance costs. Dynamically changing the project files before opening is also not realistic because of the source control implications. Basically, any solution that doesn't allow the same project file to open unmodified in all of the VS versions is unacceptable.

Question:

  1. I'm curious what others have done in this situation.
  2. Is there any other more official way, or should I continue with this approach?
  3. Can I macroize this information in some property group? This would need to work for all of the VS versions.
  4. Is there some hidden VS command line option or setting that does the same thing astoolsversion for MSBuild?

Thanks,

-Matt

Preprocessing embedded resource files

$
0
0

I'd like some advice on the best approach for modifying the contents of resource files before they are included as embedded resource files. Specially, I have a number of XML files (XML, XSLT, XSD) files that I load out of manifest resources. The goal is to rip the spacing and comments from these files before placing them in the resources as this represents a significant size reduction (the stripped files are about 1/3 the size of the originals).

I have a .targets file (inherited, not self-written) built for the 2.0 tools (VS2005) that triggers this by replacing the _CopyNonResxEmbeddedResources task description from the Microsoft.Common.targets file and replacing the Copy tasks with CopyWithPreprocessing (a custom task). Unfortuately, the _CopyNonResxEmbeddedResources task is no longer present in the 3.5 or later frameworks, so nothing happens and none of the xml is compressed. Given that this is done by the wholesale replacement of a functioning task description it feels extremely hacked, and as there is no obvious replacement for this task in the later common targets files I'm looking for a different approach.

I'm very much a newbie in MSBuild tasks, and the resource creation steps are relatively complex due to the satellite resources, different kinds of resources (Win32 vs .NET vs embedded), etc. So, I'm wondering if anyone has done this (or something like it) or has some advice on how to proceed. Obviously, I'd like this to run without touching the project files, which just include these files with EmbeddedResource tags.

I'm pretty sure I need to plug a new task into PrepareResourcesDependsOn or PrepareResourceNamesDependsOn, but I'm not clear on the control flow required to first do the preprocessing (to produce a temporary output file) and then to redirect any references to the embedded resource file to use the modified file instead of the original. The compression task needs to be tied to file type of the embedded resource.

Any pointers would be much appreciated. Has anyone else done something similar? Again, apart from lots of macro manipulation I'm a newbie in the area of build and installing custom tasks. Please be gentle:)

Thanks,

-Matt

Circular File References are not allowed!

$
0
0

This one is really starting to BUG ME!

I have a fairly large website written in both classic ASP and ASP.Net with
VB.Net being the main language. We use Visual Studio 2010 for the IDE.

Usually, the website compiles without much trouble, but every once it a while
VS2010 decides on its own that there is a circular file reference (where there
wasn't one the last time it compiled!) and refuses to compile the site.

SOMETIMES we can clear this up by telling VS2010 to REBUILD the whole
website.
SOMETIMES we can clear this up by deleting all of the IIS temporary
files.

However, right now I can't get VS2010 to compile the site no matter what I
do.  I've re-booted my machine several times (to great consternation, the number
of circular file references seems to change with every reboot!).

Of course, this never happens on the simple one or two page demo
websites..Yell


Anyone have any ideas of what I can try.  I'm pretty sure there is no
circular file reference (in the current case, it's just an ascx page that
includes another ascx page on it).  I wish VS2010 would tell me the FREAKIN'
PATH that it THINKS has the circular file reference!!!!

SHEESH.

Wait!  

AAAAAAAARRRRRRGGGGHHH!

TWO MORE RECOMPILES and the STUPID Circular File Reference errors WENT AWAY! 
No, I did not change ANY CODE or anything else. Just hit the BUILD SOLUTION menu
item two or three more times!

WHAT THE FREAK?!?!?!?!

Oh, now when I try to debug the solution, the circular file references are back!

Ok, so "Build/Rebuild Solution" followed immediately by "Build/Build Solution" gets rid of the circular file references! (But NOT EVERY TIME, only works 1 out of 3 or 4 times).

But then hit F5 to debug, and they are back.

So, "Build/Rebuid Solution" followed immediately by F5 to debug and -- Nope, always gets circular file references.

Very frustrating.

TIA,
Owen


Build Visual Studio 2010 solution file from msbuild

$
0
0

Hi,

We are using Bamboo continuous integration server and am trying to configure VS2010 .sln file using MSBuild for a task in Bamboo.I have mentioned below settings for a task and getting following error "MSBUILD : error MSB1009: Project file does not exist" when I try to build. Please let me know how to build a VS2010 solution using MSBuild?


Execcutable: MSBuild V4.0 (32)

Project File:Samplefolder/sample.sln

Options: /p:Configuration=Release

Thanks in Advance

C:\Program Files (x86)\MSBuild\12.0\bin\amd64\Microsoft.Common.CurrentVersion.targets (1696): Cound not resolve this reference.

$
0
0

I'm getting numerous errors like the following.  All the referenced packages or dlls are in the packages folder.  All paths are relative in the csproj file.  Any ideas on how to resolve this?



Thank you,

Richard

Intermittent import library generation failure building 64-bit binary in Visual Studio 2013

$
0
0

    I have a 64-bit c++ project that randomly fails to build because the import library generation silently fails in the link step.  I have scoured the "diagnostic level" log trying to find some hint at why the import library fails to be created, but there doesn't seem to be any information.

    It's pretty random.  When it fails, I can do a clean build and everything builds.  After a successful build, I can do another clean rebuild and see it fail again.

    The 32-bit version consistently builds fine.  I see the 64-bit problem regularly in any configuration (Release or Debug).

    I'm running VS2013 Update 2 RC.

    Any hints on how to debug this?  Is this a known issue for which there is a patch?

Compile .Net projects with MSBuild and creating a log for compiled, failed & skipped projects

$
0
0

Please bear with me since I'm still new to MSBuild; Actually i was trying to use the MSBuild task to compile a list of .Net project files. I wanted to have a log of the list of project files that were compiled successfully, a list of those which were skipped due to not having any new changes checked into TFS and finally a list of those projects which failed to compile.

I tried a few options after looking at a few code snippets on the net but am still not able to get the logs populated correctly.
Please find below the sample project file that i am using:

<Target Name="CoreBuild">
           <MSBuild Projects="@(ProjectsToBuild)"
                                        ContinueOnError="true"
                                        Properties="OutputPath=D:\Projects\bin-dotnet\;
                                        OutDir=D:\Projects\bin-dotnet\;
                                        Configuration=Debug;
                                        DefineTrace=true;
                                        SkipUnchanged=true;">
                         <Output TaskParameter="TargetOutputs" ItemName="CompiledAssemblies" />
                         <Output ItemName="OutputFiles" TaskParameter="TargetOutputs"/>
            </MSBuild>
</Target>

<ItemGroup>
    <DotNetRecompileLog Include="D:\Projects\Dot_Net_Compile_Log.log"/>
    <DotNetSkippedLog Include="D:\Projects\Dot_Net_Skipped_Log.log"/>
    <DotNetFailedLog Include="D:\Projects\Dot_Net_Failed_Log.log"/>
   
    <CompiledProjects Include="@(ProjectsToBuild)"/>
    <SkippedProjects Include="@(ProjectsToBuild)"/>
    <FailedProjects Include="@(ProjectsToBuild)"/>
</ItemGroup>
 
<Target Name="WriteLogs">
    <WriteLinesToFile File="@(DotNetRecompileLog)" Lines="@(CompiledProjects)" Overwrite="true" Encoding="UTF-8" />
    <WriteLinesToFile File="@(DotNetSkippedLog)" Lines="@(SkippedProjects)" Overwrite="true" Encoding="UTF-8" />
    <WriteLinesToFile File="@(DotNetFailedLog)" Lines="@(FailedProjects)" Overwrite="true" Encoding="UTF-8" />
</Target> 

Basically i am trying to get the list of:

             1. Successfully recompiled projects into D:\Projects\Dot_Net_Compile_Log.log

             2. Skipped projects into D:\Projects\Dot_Net_Skipped_Log.log

             3. Failed projects into D:\Projects\Dot_Net_Failed_Log.log

For the time being, it's just flushing out the complete list of projects into all 3 logs. Can anyone please help me find a way of doing that?

Decompiling a .DLL file to view Source Code

$
0
0

Hi guys,

I have a DLL file which I would like to decompile in order to edit the source code... Does anyone have any idea of  how I come go about doing this?

I don not have the original solution (The person who wrote it has left the company)

Thanks

Neefy

How to use VS2008 Toolset from VS2013

$
0
0

Could anyone help me with my really simple situation?

  • I installed VS2008 (Professional)
  • Updated to SP1
  • Installed other updates offered by Windwos Update
  • Installed VS2013 (Update 2 Ultimate)

After that I made a new project, opened projects and I was disappointed, because the following thing was shown:

http://grabilla.com/04710-36a0424a-57c7-4e35-9792-72fd6310c989.png

Could anyone help me what should I do now? I have VS2008 installed, but it doesn't show up on the platform toolset list. Do you have to set something? Did I make something wrong?

Thank you for your help guys! :)

Linq Query Error condition - combobox.ValueMember

$
0
0

ComboboxCourse.DataSource = from p in db.Courses
where p.IdEducationGroup = Combobox.EducationGroup.ValueMember => error
select new { p.IdCourse, p.NameCourse }

and

int id=ideg;
var rb=from p in db.ClassRoom
where p.IdEducationGroup = id => error
select new { p.IdClassRoom, p.NameClassRoom }

C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.WinFX.targets(268,9): error MC1000: Unknown build error, 'Index was outside the bounds of the array.' while compiling

$
0
0

Hello,

I have a Visual Studio C# solution that contains about 40 different projects.

Recently when running our build system workflow that launches the compilation via msbuild, the compilation of the solution sometimes fails because of one of the projects and generates the following error:

C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.WinFX.targets(268,9): error MC1000: Unknown build error, 'Index was outside the bounds of the array.'

The only changes I can think of is that Visual Studio 2012 has recently been installed on our build machines so I was thinking this may be the problem.

Any ideas?

Building definition for solution with mixed versions of software

$
0
0

Hello,

I have a solution that was created with VisualStudio 2010 (and includes projects like WebSite). The solution was upgraded to load and build with VisualStudio 2013 (almost all projects has ToolsVersion=4.0). I have TFS 2012.

In order to resolve attempts of the TFS to add files to Bin folder of the website that cause multiple check-out requests for existing binaries and add new files request for missing ones, we created a .NET class library "dummy" project which contains dependencies on NuGet packages and other projects and no code. The website project is set to reference the "dummy" project. This trick let us remove Bin folder from TFS. This solution works when we run build in VisualStudio (2013).

When I launch Building Definition (with MSBuild Arguments /p:GenerateProjectSpecificOutputFolder=true;Configuration=Publish;Platform="Mixed Platforms") I get error for building a website project that saying "The type or namespace name '<some name>' does not exist in the namespace '<some namespace>'. It is happening because binaries from "dummy" project are not copied to Bin folder of the website project.

I think it is due GenerateProjectSpecificOutputFolder=true argument of the MSBuild which works incorrectly with website project. Can you advise if there is a way to resolve it?



Regards, Leo

Create folders with subfolders

$
0
0

Hello.

I need some help to create small folder structure with msbuild.

Example:

<Target Name="CreateFolderInfo">
<ItemGroup>
<RootFolders Include="a;b" />
</ItemGroup>

<ItemGroup>
<SubFolders Include="1;2;3" />
  </ItemGroup>
</Target>

Result should be:

- a
- 1
- 2
- 3
- b
- 1
- 2
- 3

You can iterate the array items with @(RootFolders->'%(identity)').
So: <MakeDir Directories="@(RootFolders->'%(identity)')" />

But i dont know how to include the creation of the subfolders in the same step.

Any suggestions?

Best wishes
Steve

custom build: The system cannot find the path specified

$
0
0
   

I'm trying to use custom build in vs2010 on win2003, but geting a error:

Initializing task factory "XamlTaskFactory" from assembly "Microsoft.Build.Tasks.v4.0".
Using "version" task from the task factory "XamlTaskFactory".
Task "version"
  cmd.exe /C "C:\Documents and Settings\Administrator\Local Settings\Temp\39638548cfb44206b36618de11f17b1a.cmd"
  call "c:\工具\dev_tools\tools\cygwin\setup_env.bat"
  The system cannot find the path specified.
  C:\del\games\斗地主\游戏客户端>call "c:\??\dev_tools\tools\cygwin\setup_env.bat" 

the .props file's content is:

<ItemDefinitionGroup><version><CommandLineTemplate>call &quot;c:\工具\dev_tools\tools\cygwin\setup_env.bat&quot;</CommandLineTemplate><Outputs>game_obj\%(Filename)_version.rc</Outputs><ExecutionDescription>Generating version information in &quot;game_obj/%(Filename)_version.rc&quot;</ExecutionDescription><AdditionalDependencies>c:\工具\dev_tools\build\game_version.rc.version;app\VERSION;app\BRANDING</AdditionalDependencies></version></ItemDefinitionGroup>

and when i change the path of setup_env.bat without chinese, it works! what's the problem? how to fix it?

MSBuild

$
0
0

  I have a very simple question. I contact with MSbuild very little. If I can get the location of the build project or the solution.

Regards,

Viewing all 2763 articles
Browse latest View live


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